Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a non-zero return on error #52

Merged
merged 8 commits into from
Apr 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions setup_environment
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ echo -n "GPGPU-Sim version $GPGPUSIM_VERSION_STRING (build $GPGPUSIM_BUILD_STRIN

if [ ! -n "$CUDA_INSTALL_PATH" ]; then
echo "ERROR ** Install CUDA Toolkit and set CUDA_INSTALL_PATH.";
return;
return 1;
fi

if [ ! -d "$CUDA_INSTALL_PATH" ]; then
echo "ERROR ** CUDA_INSTALL_PATH=$CUDA_INSTALL_PATH invalid (directory does not exist)";
return;
return 1;
fi

if [ ! `uname` = "Linux" -a ! `uname` = "Darwin" ]; then
echo "ERROR ** Unsupported platform: GPGPU-Sim $GPGPUSIM_VERSION_STRING developed and tested on Linux."
return;
return 1;
fi

export PATH=`echo $PATH | sed "s#$GPGPUSIM_ROOT/bin:$CUDA_INSTALL_PATH/bin:##"`
Expand All @@ -41,7 +41,7 @@ if [ $? = 1 ]; then
echo " Try adding $CUDA_INSTALL_PATH/bin/ to your PATH environment variable.";
echo " Please also be sure to read the README file if you have not done so.";
echo "";
return;
return 1;
fi

CC_VERSION=`gcc --version | head -1 | awk '{for(i=1;i<=NF;i++){ if(match($i,/^[0-9]\.[0-9]\.[0-9]$/)) {print $i; exit 0}}}'`
Expand All @@ -51,7 +51,7 @@ export CUDA_VERSION_NUMBER=`echo $CUDA_VERSION_STRING | sed 's/\./ /' | awk '{pr
if [ $CUDA_VERSION_NUMBER -gt 11100 -o $CUDA_VERSION_NUMBER -lt 2030 ]; then
echo "ERROR ** GPGPU-Sim version $GPGPUSIM_VERSION_STRING not tested with CUDA version $CUDA_VERSION_STRING (please see README)";
echo $CUDA_VERSION_NUMBER
return
return 1;
fi

if [ $CUDA_VERSION_NUMBER -ge 6000 ]; then
Expand Down Expand Up @@ -121,21 +121,21 @@ fi
if [ -d $GPGPUSIM_ROOT/src/accelwattch/ ]; then
if [ ! -f $GPGPUSIM_ROOT/src/accelwattch/gpgpu_sim.verify ]; then
echo "ERROR ** gpgpu_sim.verify not found in $GPGPUSIM_ROOT/src/accelwattch";
return;
return 1;
fi
export GPGPUSIM_POWER_MODEL=$GPGPUSIM_ROOT/src/accelwattch/;
echo "configured with AccelWattch.";
elif [ -n "$GPGPUSIM_POWER_MODEL" ]; then
if [ ! -f $GPGPUSIM_POWER_MODEL/gpgpu_sim.verify ]; then
echo "";
echo "ERROR ** gpgpu_sim.verify not found in $GPGPUSIM_ROOT/src/accelwattch/ - Either incorrect directory or incorrect McPAT version";
return;
return 1;
fi
echo "configure with power model in $GPGPUSIM_POWER_MODEL.";
elif [ ! -d $GPGPUSIM_POWER_MODEL ]; then
echo "";
echo "ERROR ** GPGPUSIM_POWER_MODEL ($GPGPUSIM_POWER_MODEL) does not exist... Please set this to the gpgpusim_mcpat directory or unset this environment variable.";
return;
return 1;
else
echo "configured without a power model.";
fi
Expand Down