Merge pull request #2820 from RajalakshmiSR/clang

POWER9: Fix mcpu option with clang
This commit is contained in:
Martin Kroeker 2020-09-04 23:09:31 +02:00 committed by GitHub
commit 4d36711547
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 0 deletions

View File

@ -17,6 +17,7 @@ endif
ifeq ($(CORE), POWER9) ifeq ($(CORE), POWER9)
ifneq ($(C_COMPILER), PGI) ifneq ($(C_COMPILER), PGI)
CCOMMON_OPT += -Ofast -mvsx -fno-fast-math CCOMMON_OPT += -Ofast -mvsx -fno-fast-math
ifeq ($(C_COMPILER), GCC)
ifneq ($(GCCVERSIONGT4), 1) ifneq ($(GCCVERSIONGT4), 1)
$(warning your compiler is too old to fully support POWER9, getting a newer version of gcc is recommended) $(warning your compiler is too old to fully support POWER9, getting a newer version of gcc is recommended)
CCOMMON_OPT += -mcpu=power8 -mtune=power8 CCOMMON_OPT += -mcpu=power8 -mtune=power8
@ -24,10 +25,14 @@ else
CCOMMON_OPT += -mcpu=power9 -mtune=power9 CCOMMON_OPT += -mcpu=power9 -mtune=power9
endif endif
else else
CCOMMON_OPT += -mcpu=power9 -mtune=power9
endif
else
CCOMMON_OPT += -fast -Mvect=simd -Mcache_align CCOMMON_OPT += -fast -Mvect=simd -Mcache_align
endif endif
ifneq ($(F_COMPILER), PGI) ifneq ($(F_COMPILER), PGI)
FCOMMON_OPT += -O2 -frecursive -fno-fast-math FCOMMON_OPT += -O2 -frecursive -fno-fast-math
ifeq ($(C_COMPILER), GCC)
ifneq ($(GCCVERSIONGT4), 1) ifneq ($(GCCVERSIONGT4), 1)
$(warning your compiler is too old to fully support POWER9, getting a newer version of gcc is recommended) $(warning your compiler is too old to fully support POWER9, getting a newer version of gcc is recommended)
FCOMMON_OPT += -mcpu=power8 -mtune=power8 FCOMMON_OPT += -mcpu=power8 -mtune=power8
@ -35,6 +40,9 @@ else
FCOMMON_OPT += -mcpu=power9 -mtune=power9 FCOMMON_OPT += -mcpu=power9 -mtune=power9
endif endif
else else
FCOMMON_OPT += -mcpu=power9 -mtune=power9
endif
else
FCOMMON_OPT += -O2 -Mrecursive FCOMMON_OPT += -O2 -Mrecursive
endif endif
endif endif