summaryrefslogtreecommitdiff
path: root/Makefile.system
diff options
context:
space:
mode:
authorGuodong Xu <guodong.xu@linaro.com>2020-05-25 10:40:12 +0000
committerGuodong Xu <guodong.xu@linaro.com>2020-05-25 10:57:03 +0000
commit06387ac0e6c29d636dee1ae7d7c935dd9180591d (patch)
treedb90d812ffad144da61247d282460a089a3afa9e /Makefile.system
parent729ac6bd4a9971e83b2a110eb62d68e25df74846 (diff)
downloadopenblas-06387ac0e6c29d636dee1ae7d7c935dd9180591d.tar.gz
openblas-06387ac0e6c29d636dee1ae7d7c935dd9180591d.tar.bz2
openblas-06387ac0e6c29d636dee1ae7d7c935dd9180591d.zip
make GCC version detection OS-independent
Previous design put GCC version detection inside of OSNAME 'WINNT'. However, such detections are required for 'Linux' and possibly other OS'es as well. For example, there is usage of the GCC versions in Makefile.arm64. When compiling on Linux machine, in the previous design, Markfile.arm64 will not know the correct GCC version. The fix is to move GCC version detection into common part, not wrapped by anything. Signed-off-by: Guodong Xu <guodong.xu@linaro.com>
Diffstat (limited to 'Makefile.system')
-rw-r--r--Makefile.system16
1 files changed, 9 insertions, 7 deletions
diff --git a/Makefile.system b/Makefile.system
index 98d9ae313..08637e9ac 100644
--- a/Makefile.system
+++ b/Makefile.system
@@ -277,6 +277,15 @@ NO_LAPACK = 1
override FEXTRALIB =
endif
+ifeq ($(C_COMPILER), GCC)
+GCCVERSIONGTEQ4 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 4)
+GCCVERSIONGT4 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \> 4)
+GCCVERSIONGT5 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \> 5)
+GCCVERSIONGTEQ7 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 7)
+GCCVERSIONGTEQ9 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 9)
+GCCMINORVERSIONGTEQ7 := $(shell expr `$(CC) -dumpversion | cut -f2 -d.` \>= 7)
+endif
+
#
# OS dependent settings
#
@@ -323,13 +332,7 @@ ifeq ($(C_COMPILER), CLANG)
CCOMMON_OPT += -DMS_ABI
endif
-ifeq ($(C_COMPILER), GCC)
#Version tests for supporting specific features (MS_ABI, POWER9 intrinsics)
-GCCVERSIONGTEQ4 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 4)
-GCCVERSIONGT4 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \> 4)
-GCCVERSIONGTEQ7 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 7)
-GCCVERSIONGTEQ9 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 9)
-GCCMINORVERSIONGTEQ7 := $(shell expr `$(CC) -dumpversion | cut -f2 -d.` \>= 7)
ifeq ($(GCCVERSIONGT4), 1)
# GCC Major version > 4
# It is compatible with MSVC ABI.
@@ -343,7 +346,6 @@ ifeq ($(GCCMINORVERSIONGTEQ7), 1)
CCOMMON_OPT += -DMS_ABI
endif
endif
-endif
# Ensure the correct stack alignment on Win32
# http://permalink.gmane.org/gmane.comp.lib.openblas.general/97