@@ -181,7 +181,7 @@ endif
181
181
182
182
# On x86_64 build getarch with march=native unless the compiler is PGI. This is required to detect AVX512 support in getarch.
183
183
ifeq ($(HOSTARCH), x86_64)
184
- ifeq ($(findstring pgcc,$(HOSTCC)),)
184
+ ifeq ($(findstring pgcc,$(HOSTCC))$(findstring nvc,$(HOSTCC)) ,)
185
185
GETARCH_FLAGS += -march=native
186
186
endif
187
187
endif
@@ -847,9 +847,19 @@ endif
847
847
endif
848
848
849
849
ifeq ($(C_COMPILER), PGI)
850
+ PGCVERSIONGT20 := $(shell expr `$(CC) --version|sed -n "2p" |sed -e "s/[^0-9.]//g" |cut -d "." -f 1` \> 20)
851
+ PGCVERSIONGTEQ20 := $(shell expr `$(CC) --version|sed -n "2p" |sed -e "s/[^0-9.]//g" |cut -d "." -f 1` \>= 20)
852
+ PGCMINORVERSIONGE11 := $(shell expr `$(CC) --version|sed -n "2p" |sed -e "s/[^0-9.]//g" |cut -c 4-5` == 11)
853
+ PGCVERSIONCHECK := $(PGCVERSIONGT20)$(PGCVERSIONEQ20)$(PGCMINORVERSIONGE11)
854
+ ifeq ($(PGCVERSIONCHECK), $(filter $(PGCVERSIONCHECK), 110 111 011))
855
+ NEWPGI := 1
856
+ endif
850
857
ifdef BINARY64
851
858
ifeq ($(ARCH), x86_64)
852
- CCOMMON_OPT += -tp p7-64 -D__MMX__ -Mnollvm
859
+ CCOMMON_OPT += -tp p7-64
860
+ ifneq ($(NEWPGI),1)
861
+ CCOMMON_OPT += -D__MMX__ -Mnollvm
862
+ endif
853
863
else
854
864
ifeq ($(ARCH), power)
855
865
ifeq ($(CORE), POWER8)
@@ -1040,7 +1050,7 @@ endif
1040
1050
else
1041
1051
FCOMMON_OPT += -tp p7
1042
1052
endif
1043
- FCOMMON_OPT += -Mrecursive
1053
+ FCOMMON_OPT += -Mrecursive -Kieee
1044
1054
ifeq ($(USE_OPENMP), 1)
1045
1055
FCOMMON_OPT += -mp
1046
1056
endif
0 commit comments