Skip to content

Commit

Permalink
PAPI: make compile on x86 based macOS
Browse files Browse the repository at this point in the history
as usual it does not actually do anything on darwin based OS since
darwin is no longer supported by PAPI
  • Loading branch information
rhaas80 committed Feb 14, 2024
1 parent 6ee7210 commit f242070
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion dist/darwin_arm.patch
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ diff -ur papi-7.0.0.orig/src/configure papi-7.0.0/src/configure
- MISCSRCS="$MISCSRCS x86_cpuid_info.c"
-
- ;;
+ if test "$family" = "amd64"; then
+ if test "$family" = "amd64" || test "$family" = "x86_64" ; then
+ MISCSRCS="$MISCSRCS x86_cpuid_info.c"
+ CPU="x86"
+ elif test "${family:0:3}" = "arm" || test "$family" = "aarch64"; then
Expand Down
27 changes: 27 additions & 0 deletions dist/find.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
diff -ur papi-7.0.0.orig/src/configure papi-7.0.0/src/configure
--- papi-7.0.0.orig/src/configure 2022-11-14 11:44:31.000000000 -0600
+++ papi-7.0.0/src/configure 2024-02-14 12:18:15.000000000 -0600
@@ -7131,19 +7131,19 @@
fi

if test "x$comp" = "xsysdetect" ; then
- if test "x`find $PAPI_CUDA_ROOT -name "cuda.h"`" != "x" ; then
+ if test "x`find ${PAPI_CUDA_ROOT-.} -name "cuda.h"`" != "x" ; then
CFLAGS="$CFLAGS -DHAVE_CUDA"
fi

- if test "x`find $PAPI_CUDA_ROOT -name "nvml.h"`" != "x" ; then
+ if test "x`find ${PAPI_CUDA_ROOT-.} -name "nvml.h"`" != "x" ; then
CFLAGS="$CFLAGS -DHAVE_NVML"
fi

- if test "x`find $PAPI_ROCM_ROOT -name "hsa.h"`" != "x" ; then
+ if test "x`find ${PAPI_ROCM_ROOT-.} -name "hsa.h"`" != "x" ; then
CFLAGS="$CFLAGS -DHAVE_ROCM"
fi

- if test "x`find $PAPI_ROCM_ROOT -name "rocm_smi.h"`" != "x" ; then
+ if test "x`find ${PAPI_ROCM_ROOT-.} -name "rocm_smi.h"`" != "x" ; then
CFLAGS="$CFLAGS -DHAVE_ROCM_SMI"
fi
fi
1 change: 1 addition & 0 deletions src/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ ${PATCH?} -p1 < ${SRCDIR}/../dist/configure_flags.patch
${PATCH?} -p1 < ${SRCDIR}/../dist/darwin_arm.patch
${PATCH?} -p1 < ${SRCDIR}/../dist/soname.patch
${PATCH?} -p1 < ${SRCDIR}/../dist/libsde.patch
${PATCH?} -p1 < ${SRCDIR}/../dist/find.patch
# Some (ancient but still used) versions of patch don't support the
# patch format used here but also don't report an error using the exit
# code. So we use this patch to test for this
Expand Down

0 comments on commit f242070

Please sign in to comment.