Skip to content

Commit 47696b4

Browse files
committed
actually check that version is greater than 4.7
1 parent 17c46bf commit 47696b4

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Makefile.x86_64

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,10 @@ ifndef NO_AVX2
7474
ifeq ($(C_COMPILER), GCC)
7575
# AVX2 support was added in 4.7.0
7676
GCCVERSIONGTEQ4 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 4)
77+
GCCVERSIONGTEQ5 := $(shell expr `$(CC) -dumpversion | cut -f1 -d.` \>= 5)
7778
GCCMINORVERSIONGTEQ7 := $(shell expr `$(CC) -dumpversion | cut -f2 -d.` \>= 7)
78-
ifeq ($(GCCVERSIONGTEQ4)$(GCCMINORVERSIONGTEQ7), 11)
79+
GCCVERSIONCHECK := $(GCCVERSIONGTEQ5)$(GCCVERSIONGTEQ4)$(GCCMINORVERSIONGTEQ7)
80+
ifeq ($(GCCVERSIONCHECK), $(filter $(GCCVERSIONCHECK), 011 110 111))
7981
CCOMMON_OPT += -mavx2
8082
endif
8183
else
@@ -86,8 +88,10 @@ endif
8688
ifeq ($(F_COMPILER), GFORTRAN)
8789
# AVX2 support was added in 4.7.0
8890
GCCVERSIONGTEQ4 := $(shell expr `$(FC) -dumpversion | cut -f1 -d.` \>= 4)
91+
GCCVERSIONGTEQ5 := $(shell expr `$(FC) -dumpversion | cut -f1 -d.` \>= 5)
8992
GCCMINORVERSIONGTEQ7 := $(shell expr `$(FC) -dumpversion | cut -f2 -d.` \>= 7)
90-
ifeq ($(GCCVERSIONGTEQ4)$(GCCMINORVERSIONGTEQ7), 11)
93+
GCCVERSIONCHECK := $(GCCVERSIONGTEQ5)$(GCCVERSIONGTEQ4)$(GCCVERSIONMINORGTEQ7)
94+
ifeq ($(GCCVERSIONCHECK), $(filter $(GCCVERSIONCHECK), 011 110 111))
9195
FCOMMON_OPT += -mavx2
9296
endif
9397
else

0 commit comments

Comments
 (0)