Skip to content

Commit

Permalink
Merge pull request #52 from tgrogers/dev
Browse files Browse the repository at this point in the history
Adding a non-zero return on error
  • Loading branch information
JRPan authored Apr 4, 2024
2 parents b1ff53d + 0b93c15 commit 6389301
Showing 1 changed file with 8 additions and 8 deletions.
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

0 comments on commit 6389301

Please sign in to comment.