diff options
| author | JRPan <[email protected]> | 2024-04-04 14:19:44 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-04-04 14:19:44 -0400 |
| commit | 63893019e953269d1b0fb38e1fa8754992dd8d80 (patch) | |
| tree | bf6d10fa31f5d510e67cbe55fb79d81c5fd160fd | |
| parent | b1ff53d46bb10ed594a236e01724785538a905b8 (diff) | |
| parent | 0b93c158d8aa6d8f1f8325130a9bd0192cf0b388 (diff) | |
Merge pull request #52 from tgrogers/dev
Adding a non-zero return on error
| -rw-r--r-- | setup_environment | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/setup_environment b/setup_environment index 7eeaa4f..871bb59 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 |
