From: Martin Kroeker Date: Wed, 19 Aug 2020 13:06:30 +0000 (+0200) Subject: make march=cooperlake option conditional on gcc >= 10.1 X-Git-Tag: upstream/0.3.21~25^2~72^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bb9cf766f5cfd5112adebfeb30f916350854b05d;p=platform%2Fupstream%2Fopenblas.git make march=cooperlake option conditional on gcc >= 10.1 --- diff --git a/Makefile.x86_64 b/Makefile.x86_64 index 96e9dbe..00975b2 100644 --- a/Makefile.x86_64 +++ b/Makefile.x86_64 @@ -30,8 +30,15 @@ endif ifeq ($(CORE), COOPERLAKE) ifndef DYNAMIC_ARCH ifndef NO_AVX512 +ifeq ($(C_COMPILER), GCC) +# cooperlake support was added in 10.1 +GCCVERSIONGTEQ10 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 10) +GCCMINORVERSIONGTEQ1 := $(shell expr `$(CC) -dumpversion | cut -f2 -d.` \>= 1) +ifeq ($(GCCVERSIONGTEQ10)$(GCCMINORVERSIONGTEQ1), 11) CCOMMON_OPT += -march=cooperlake FCOMMON_OPT += -march=cooperlake +endif +endif ifeq ($(OSNAME), CYGWIN_NT) CCOMMON_OPT += -fno-asynchronous-unwind-tables FCOMMON_OPT += -fno-asynchronous-unwind-tables