Skip to content

Commit b212a2f

Browse files
authored
Add/modify "PGI" compiler options for NVIDIA SDK 20.11
1 parent e404165 commit b212a2f

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

Makefile.system

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ endif
181181

182182
# On x86_64 build getarch with march=native unless the compiler is PGI. This is required to detect AVX512 support in getarch.
183183
ifeq ($(HOSTARCH), x86_64)
184-
ifeq ($(findstring pgcc,$(HOSTCC)),)
184+
ifeq ($(findstring pgcc,$(HOSTCC))$(findstring nvc,$(HOSTCC)),)
185185
GETARCH_FLAGS += -march=native
186186
endif
187187
endif
@@ -847,9 +847,19 @@ endif
847847
endif
848848

849849
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
850857
ifdef BINARY64
851858
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
853863
else
854864
ifeq ($(ARCH), power)
855865
ifeq ($(CORE), POWER8)
@@ -1040,7 +1050,7 @@ endif
10401050
else
10411051
FCOMMON_OPT += -tp p7
10421052
endif
1043-
FCOMMON_OPT += -Mrecursive
1053+
FCOMMON_OPT += -Mrecursive -Kieee
10441054
ifeq ($(USE_OPENMP), 1)
10451055
FCOMMON_OPT += -mp
10461056
endif

0 commit comments

Comments
 (0)