Skip to content

Commit c6b48e0

Browse files
authored
Merge pull request #2749 from martin-frbg/make_ppc
Reorganize OpenMP build options for POWER and allow compiling for POWER9 with old gcc
2 parents 4927251 + 39724e8 commit c6b48e0

File tree

1 file changed

+24
-30
lines changed

1 file changed

+24
-30
lines changed

Makefile.power

Lines changed: 24 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -10,54 +10,36 @@ USE_OPENMP = 1
1010
endif
1111

1212
ifeq ($(CORE), POWER10)
13-
ifeq ($(USE_OPENMP), 1)
14-
COMMON_OPT += -Ofast -mcpu=power10 -mtune=power10 -mvsx -DUSE_OPENMP -fno-fast-math -fopenmp
15-
FCOMMON_OPT += -O2 -frecursive -mcpu=power10 -mtune=power10 -DUSE_OPENMP -fno-fast-math -fopenmp
16-
else
1713
COMMON_OPT += -Ofast -mcpu=power10 -mtune=power10 -mvsx -fno-fast-math
1814
FCOMMON_OPT += -O2 -frecursive -mcpu=power10 -mtune=power10 -fno-fast-math
1915
endif
20-
endif
2116

2217
ifeq ($(CORE), POWER9)
23-
ifeq ($(USE_OPENMP), 1)
2418
ifneq ($(C_COMPILER), PGI)
25-
CCOMMON_OPT += -Ofast -mcpu=power9 -mtune=power9 -mvsx -DUSE_OPENMP -fno-fast-math -fopenmp
26-
else
27-
CCOMMON_OPT += -fast -Mvect=simd -Mcache_align -DUSE_OPENMP -mp
28-
endif
29-
ifneq ($(F_COMPILER), PGI)
30-
FCOMMON_OPT += -O2 -frecursive -mcpu=power9 -mtune=power9 -DUSE_OPENMP -fno-fast-math -fopenmp
19+
CCOMMON_OPT += -Ofast -mvsx -fno-fast-math
20+
ifneq ($(GCCVERSIONGT4), 1)
21+
$(warning your compiler is too old to fully support POWER9, getting a newer version of gcc is recommended)
22+
CCOMMON_OPT += -mcpu=power8 -mtune=power8
3123
else
32-
FCOMMON_OPT += -O2 -Mrecursive -DUSE_OPENMP -mp
24+
CCOMMON_OPT += -mcpu=power9 -mtune=power9
3325
endif
3426
else
35-
ifneq ($(C_COMPILER), PGI)
36-
CCOMMON_OPT += -Ofast -mcpu=power9 -mtune=power9 -mvsx -fno-fast-math
37-
else
3827
CCOMMON_OPT += -fast -Mvect=simd -Mcache_align
3928
endif
4029
ifneq ($(F_COMPILER), PGI)
41-
FCOMMON_OPT += -O2 -frecursive -mcpu=power9 -mtune=power9 -fno-fast-math
30+
FCOMMON_OPT += -O2 -frecursive -fno-fast-math
31+
ifneq ($(GCCVERSIONGT4), 1)
32+
$(warning your compiler is too old to fully support POWER9, getting a newer version of gcc is recommended)
33+
FCOMMON_OPT += -mcpu=power8 -mtune=power8
4234
else
43-
FCOMMON_OPT += -O2 -Mrecursive
35+
FCOMMON_OPT += -mcpu=power9 -mtune=power9
4436
endif
37+
else
38+
FCOMMON_OPT += -O2 -Mrecursive
4539
endif
4640
endif
4741

4842
ifeq ($(CORE), POWER8)
49-
ifeq ($(USE_OPENMP), 1)
50-
ifneq ($(C_COMPILER), PGI)
51-
CCOMMON_OPT += -Ofast -mcpu=power8 -mtune=power8 -mvsx -DUSE_OPENMP -fno-fast-math -fopenmp
52-
else
53-
CCOMMON_OPT += -fast -Mvect=simd -Mcache_align -DUSE_OPENMP -mp
54-
endif
55-
ifneq ($(F_COMPILER), PGI)
56-
FCOMMON_OPT += -O2 -frecursive -mcpu=power8 -mtune=power8 -DUSE_OPENMP -fno-fast-math -fopenmp
57-
else
58-
FCOMMON_OPT += -O2 -Mrecursive -DUSE_OPENMP -mp
59-
endif
60-
else
6143
ifneq ($(C_COMPILER), PGI)
6244
CCOMMON_OPT += -Ofast -mcpu=power8 -mtune=power8 -mvsx -fno-fast-math
6345
else
@@ -73,6 +55,18 @@ else
7355
FCOMMON_OPT += -O2 -Mrecursive
7456
endif
7557
endif
58+
59+
ifeq ($(USE_OPENMP), 1)
60+
ifneq ($(C_COMPILER), PGI)
61+
CCOMMON_OPT += -DUSE_OPENMP -fopenmp
62+
else
63+
CCOMMON_OPT += -DUSE_OPENMP -mp
64+
endif
65+
ifneq ($(F_COMPILER), PGI)
66+
FCOMMON_OPT += -DUSE_OPENMP -fopenmp
67+
else
68+
FCOMMON_OPT += -DUSE_OPENMP -mp
69+
endif
7670
endif
7771

7872
# workaround for C->FORTRAN ABI violation in LAPACKE

0 commit comments

Comments
 (0)