diff --git a/setup_environment b/setup_environment index 7eeaa4f12..871bb593a 100644 --- a/setup_environment +++ b/setup_environment @@ -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:##"` @@ -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}}}'` @@ -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 @@ -121,7 +121,7 @@ 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."; @@ -129,13 +129,13 @@ 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