diff options
| author | Dongdong Li <[email protected]> | 2013-08-02 15:03:20 -0800 |
|---|---|---|
| committer | Andrew Boktor <[email protected]> | 2014-08-14 13:50:58 -0700 |
| commit | 5f91e7435742bab74dfbeca18afc63e466498f36 (patch) | |
| tree | 967b92fe1bc9c9e8d22b2d101dad54ea9f5138a3 | |
| parent | 4232b85d1ecd2f73cfc9e4226468c4b369476ca9 (diff) | |
Review: 76001: Setup environment quick fix for ubuntu
[git-p4: depot-paths = "//depot/gpgpu_sim_research/fermi/distribution/": change = 16725]
| -rw-r--r-- | setup_environment | 2 | ||||
| -rw-r--r-- | version_detection.mk | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/setup_environment b/setup_environment index 4d9472d..f1a63f2 100644 --- a/setup_environment +++ b/setup_environment @@ -39,7 +39,7 @@ if [ $? = 1 ]; then return; 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}}}'` +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}}}'` 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);}'` diff --git a/version_detection.mk b/version_detection.mk index 7f7925c..8796d5c 100644 --- a/version_detection.mk +++ b/version_detection.mk @@ -38,7 +38,7 @@ CUDA_VERSION_STRING:=$(shell $(CUDA_INSTALL_PATH)/bin/nvcc --version | awk '/rel CUDART_VERSION:=$(shell echo $(CUDA_VERSION_STRING) | sed 's/\./ /' | awk '{printf("%02u%02u", 10*int($$1), 10*$$2);}') # Detect GCC Version -CC_VERSION := $(shell gcc --version | head -1 | awk '{for(i=1;i<=NF;i++){ if(match($$i,/[0-9]\.[0-9]\.[0-9]/)) {print $$i}}}') +CC_VERSION := $(shell gcc --version | head -1 | awk '{for(i=1;i<=NF;i++){ if(match($$i,/^[0-9]\.[0-9]\.[0-9]$$/)) {print $$i; exit 0 }}}') # Detect Support for C++11 (C++0x) from GCC Version GNUC_CPP0X := $(shell gcc --version | perl -ne 'if (/gcc\s+\(.*\)\s+([0-9.]+)/){ if($$1 >= 4.3) {$$n=1} else {$$n=0;} } END { print $$n; }') |
