papi: patch for cray fortran bug with -ffree-form (#41886)

PAPI 7.1.0 unconditionally adds `FFLAGS = -ffree-form` in the sysdetect tests,
regardless of the compiler.

This was added in https://github.com/icl-utk-edu/papi/pull/108 to make a build with
`armflang` work, but it breaks CCE (and our `develop` pipeline).

- [x] Add a patch that fixes both problems
- [x] Patch PAPI when at 7.1.0 or higher
This commit is contained in:
Todd Gamblin 2023-12-27 14:03:24 -08:00 committed by GitHub
parent b5668bac53
commit f721d4c625
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 0 deletions

View file

@ -84,6 +84,8 @@ class Papi(AutotoolsPackage, ROCmPackage):
sha256="64c57b3ad4026255238cc495df6abfacc41de391a0af497c27d0ac819444a1f8", sha256="64c57b3ad4026255238cc495df6abfacc41de391a0af497c27d0ac819444a1f8",
when="@5.4.0:5.6%gcc@8:", when="@5.4.0:5.6%gcc@8:",
) )
# 7.1.0 erroneously adds -ffree-form for all fortran compilers
patch("sysdetect-free-form-fix.patch", when="@7.1.0:")
patch("crayftn-fixes.patch", when="@6.0.0:%cce@9:") patch("crayftn-fixes.patch", when="@6.0.0:%cce@9:")
patch("intel-oneapi-compiler-fixes.patch", when="@6.0.0:%oneapi") patch("intel-oneapi-compiler-fixes.patch", when="@6.0.0:%oneapi")
patch("intel-cray-freeform.patch", when="@7.0.1") patch("intel-cray-freeform.patch", when="@7.0.1")

View file

@ -0,0 +1,17 @@
diff --git a/src/components/sysdetect/tests/Makefile b/src/components/sysdetect/tests/Makefile
index 63ac01358..79ce57e4b 100644
--- a/src/components/sysdetect/tests/Makefile
+++ b/src/components/sysdetect/tests/Makefile
@@ -21,11 +21,9 @@ endif
intel_compilers := ifort ifx
cray_compilers := ftn crayftn
-FFLAGS += -ffree-form
-
ifeq ($(notdir $(F77)),gfortran)
FFLAGS +=-ffree-form -ffree-line-length-none
-else ifeq ($(notdir $(F77)),flang)
+else ifeq ($(patsubst %flang,,$(notdir $(F77))),) # compiler name ends with flang
FFLAGS +=-ffree-form
else ifneq ($(findstring $(notdir $(F77)), $(intel_compilers)),)
FFLAGS +=-free