summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJRPan <[email protected]>2024-10-07 13:56:32 -0700
committerGitHub <[email protected]>2024-10-07 20:56:32 +0000
commit667834cfe5214523edd7769aeab77f91b7137686 (patch)
tree7cff43437614271b797f45d4c77f34a8b395e53c
parent980eb88b547dad53b2343cc90ed66c4dec48dea3 (diff)
we have gcc-11 now. Check version for more than 2 digits. (#79)
* we have gcc-11 now. Check version for more than 2 digits. * version detection as well - And support c++ 11 by default
-rw-r--r--setup_environment3
-rw-r--r--version_detection.mk4
2 files changed, 4 insertions, 3 deletions
diff --git a/setup_environment b/setup_environment
index 871bb59..3428101 100644
--- a/setup_environment
+++ b/setup_environment
@@ -44,7 +44,8 @@ if [ $? = 1 ]; then
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}}}'`
+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/,//'`;
export 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 81c1d2a..0bf3095 100644
--- a/version_detection.mk
+++ b/version_detection.mk
@@ -43,7 +43,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; exit 0 }}}')
+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; }')
+GNUC_CPP0X := 1