From a11e1e10f436f4601275669bdf7b951e6e8df0e8 Mon Sep 17 00:00:00 2001 From: Rajalakshmi Srinivasaraghavan Date: Fri, 29 Sep 2023 10:32:34 -0500 Subject: [PATCH] powerpc: Fix build errors with xlf This patch fixes errors when using xlf as fortran compiler on Linux. Tested with gcc/xlf and clang/xlf compiler combinations. --- Makefile.power | 4 ++++ Makefile.system | 2 +- f_check | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile.power b/Makefile.power index 33702c932..46afb2d4a 100644 --- a/Makefile.power +++ b/Makefile.power @@ -70,8 +70,12 @@ else FCOMMON_OPT += -O1 -frecursive -mcpu=power8 -mtune=power8 -fno-fast-math endif else +ifeq ($(F_COMPILER), IBM) +FCOMMON_OPT += -O2 -qrecur -qnosave +else FCOMMON_OPT += -O2 -frecursive -mcpu=power8 -mtune=power8 -fno-fast-math endif +endif else FCOMMON_OPT += -O2 -Mrecursive endif diff --git a/Makefile.system b/Makefile.system index ae6db40b0..b1a357fdf 100644 --- a/Makefile.system +++ b/Makefile.system @@ -1168,7 +1168,7 @@ endif ifeq ($(F_COMPILER), IBM) CCOMMON_OPT += -DF_INTERFACE_IBM FEXTRALIB += -lxlf90 -ifeq ($(C_COMPILER), GCC) +ifeq ($(C_COMPILER), $(filter $(C_COMPILER),GCC CLANG)) FCOMMON_OPT += -qextname endif # FCOMMON_OPT += -qarch=440 diff --git a/f_check b/f_check index f30231bc4..31f4376d0 100755 --- a/f_check +++ b/f_check @@ -117,6 +117,9 @@ else vendor=PGI openmp='-mp' ;; + *xlf*) + vendor=IBM + ;; *) vendor=G77 openmp=''