summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHoward Pritchard <howardp@lanl.gov>2023-03-01 14:33:55 -0700
committerGitHub <noreply@github.com>2023-03-01 13:33:55 -0800
commit18e0b893f268443d4d285bcfa7c071f4838c5557 (patch)
tree99276ef6767c52638488ca76c3032c4520aead6b
parentdf5b25764b28cf9ffca66b7535bbf1e0fa562312 (diff)
downloadspack-18e0b893f268443d4d285bcfa7c071f4838c5557.tar.gz
spack-18e0b893f268443d4d285bcfa7c071f4838c5557.tar.bz2
spack-18e0b893f268443d4d285bcfa7c071f4838c5557.tar.xz
spack-18e0b893f268443d4d285bcfa7c071f4838c5557.zip
papi: more fixes for Intel OneAPI compiler (#34048)
The Intel OneAPI's extreme pickiness continues to bring out buggy/noncompliant code. This patch fixes an error in the configure.in embedded 'c' test code and also in a file with an initialized, but unused, variable. Signed-off-by: Howard Pritchard <howardp@lanl.gov>
-rw-r--r--var/spack/repos/builtin/packages/papi/intel-oneapi-compiler-fixes.patch37
-rw-r--r--var/spack/repos/builtin/packages/papi/package.py6
2 files changed, 43 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/papi/intel-oneapi-compiler-fixes.patch b/var/spack/repos/builtin/packages/papi/intel-oneapi-compiler-fixes.patch
new file mode 100644
index 0000000000..5973d242ef
--- /dev/null
+++ b/var/spack/repos/builtin/packages/papi/intel-oneapi-compiler-fixes.patch
@@ -0,0 +1,37 @@
+diff --git a/src/configure.in b/src/configure.in
+index 3cf47edc..ef5463ff 100644
+--- a/src/configure.in
++++ b/src/configure.in
+@@ -566,7 +566,7 @@ AC_ARG_WITH(tls,
+ #include <unistd.h>
+ extern __thread int i;
+ static int res1, res2;
+- void thread_main (void *arg) {
++ void *thread_main (void *arg) {
+ i = (int)arg;
+ sleep (1);
+ if ((int)arg == 1)
+diff --git a/src/libpfm4/lib/pfmlib_common.c b/src/libpfm4/lib/pfmlib_common.c
+index 335155e2..38f3f957 100644
+--- a/src/libpfm4/lib/pfmlib_common.c
++++ b/src/libpfm4/lib/pfmlib_common.c
+@@ -1749,7 +1749,7 @@ pfmlib_pmu_validate_encoding(pfmlib_pmu_t *pmu, FILE *fp)
+ pfmlib_event_attr_info_t ainfo;
+ char *buf;
+ size_t maxlen = 0, len;
+- int i, u, n = 0, um;
++ int i, u, um;
+ int ret, retval = PFM_SUCCESS;
+
+ pfmlib_for_each_pmu_event(pmu, i) {
+@@ -1838,7 +1838,6 @@ pfmlib_pmu_validate_encoding(pfmlib_pmu_t *pmu, FILE *fp)
+ continue;
+ }
+ }
+- n++;
+ }
+ free(buf);
+
+--
+2.27.0
+
diff --git a/var/spack/repos/builtin/packages/papi/package.py b/var/spack/repos/builtin/packages/papi/package.py
index aec6a927c4..18ec2e77b5 100644
--- a/var/spack/repos/builtin/packages/papi/package.py
+++ b/var/spack/repos/builtin/packages/papi/package.py
@@ -82,6 +82,7 @@ class Papi(AutotoolsPackage, ROCmPackage):
when="@5.4.0:5.6%gcc@8:",
)
patch("crayftn-fixes.patch", when="@6.0.0:%cce@9:")
+ patch("intel-oneapi-compiler-fixes.patch", when="@6.0.0:%oneapi")
configure_directory = "src"
@@ -113,6 +114,11 @@ class Papi(AutotoolsPackage, ROCmPackage):
setup_run_environment = setup_build_environment
+ @when("@6.0.0:%oneapi")
+ def autoreconf(self, spec, prefix):
+ bash = which("bash")
+ bash("-c", "cd src && autoreconf -ivf")
+
def configure_args(self):
spec = self.spec
# PAPI uses MPI if MPI is present; since we don't require