summaryrefslogtreecommitdiff
path: root/setup_environment
diff options
context:
space:
mode:
authortgrogers <[email protected]>2018-03-20 14:47:54 -0400
committertgrogers <[email protected]>2018-03-20 14:47:54 -0400
commitc3977ebf0549c2fd2d82d761008c172c74fcd113 (patch)
tree8c86627d0954b4d47362e122b9dca180c0b71fc8 /setup_environment
parentb8ef5d34fddeea1dce57688df562d12f08743238 (diff)
Adding in some setupscript stuff to properly print the build version and get rid of this not fully tested warning
Diffstat (limited to 'setup_environment')
-rw-r--r--setup_environment10
1 files changed, 6 insertions, 4 deletions
diff --git a/setup_environment b/setup_environment
index 854a335..96cc362 100644
--- a/setup_environment
+++ b/setup_environment
@@ -6,7 +6,11 @@ export GPGPUSIM_SETUP_ENVIRONMENT_WAS_RUN=
export GPGPUSIM_ROOT="$( cd "$( dirname "$BASH_SOURCE" )" && pwd )"
GPGPUSIM_VERSION_STRING=`cat $GPGPUSIM_ROOT/version | awk '/Version/ {print $8}'`
-GPGPUSIM_BUILD_STRING=`cat $GPGPUSIM_ROOT/version | awk '/Change/ {print $6}'`
+#Detect Git branch and commit #
+GIT_COMMIT=`git log -n 1 | head -1 | sed -re 's/commit (.*)/\1/'`
+GIT_FILES_CHANGED=`git diff --numstat --cached && git diff --numstat | wc | sed -re 's/^\s+([0-9]+).*/\1/'`
+GPGPUSIM_BUILD_STRING="gpgpu-sim_git-commit-$GIT_COMMIT-modified_$GIT_FILES_CHANGED"
+
echo -n "GPGPU-Sim version $GPGPUSIM_VERSION_STRING (build $GPGPUSIM_BUILD_STRING) ";
if [ ! -n "$CUDA_INSTALL_PATH" ]; then
@@ -43,11 +47,9 @@ CC_VERSION=`gcc --version | head -1 | awk '{for(i=1;i<=NF;i++){ if(match($i,/^[0
CUDA_VERSION_STRING=`$CUDA_INSTALL_PATH/bin/nvcc --version | awk '/release/ {print $5;}' | sed 's/,//'`;
CUDA_VERSION_NUMBER=`echo $CUDA_VERSION_STRING | sed 's/\./ /' | awk '{printf("%02u%02u", 10*int($1), 10*$2);}'`
-if [ $CUDA_VERSION_NUMBER -gt 8000 -o $CUDA_VERSION_NUMBER -lt 2030 ]; then
+if [ $CUDA_VERSION_NUMBER -gt 9100 -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)";
return
-elif [ $CUDA_VERSION_NUMBER -gt 4020 ]; then
- echo "WARNING ** GPGPU-Sim version $GPGPUSIM_VERSION_STRING not fully tested with CUDA version $CUDA_VERSION_STRING (please see README)";
fi
if [ $# = '1' ] ;