From 3b262c58837ae350ea5dceeb7913e31ec33fd3fa Mon Sep 17 00:00:00 2001 From: Roland Haas Date: Fri, 28 Aug 2020 09:09:04 -0500 Subject: [PATCH] PAPI: disabble config fail if no -lrt and correct syscall.h location this is required to build PAPI on OSX where there is no -lrt or timer_create and syscall.h is only in sy/syscall.h --- dist/create_timer.patch | 13 +++++++++++++ dist/syscall.patch | 21 +++++++++++++++++++++ src/build.sh | 2 ++ 3 files changed, 36 insertions(+) create mode 100644 dist/create_timer.patch create mode 100644 dist/syscall.patch diff --git a/dist/create_timer.patch b/dist/create_timer.patch new file mode 100644 index 0000000..2b96335 --- /dev/null +++ b/dist/create_timer.patch @@ -0,0 +1,13 @@ +diff -ur papi-6.0.0.1.orig/src/configure papi-6.0.0.1/src/configure +--- papi-6.0.0.1.orig/src/configure 2020-04-03 03:07:00.000000000 -0500 ++++ papi-6.0.0.1/src/configure 2020-08-28 08:46:33.000000000 -0500 +@@ -4301,7 +4315,8 @@ + $as_echo "found" >&6; } + LRT="-lrt" + else +- as_fn_error $? "cannot find timer_create and timer_*ettime symbols neither in the base system libraries nor in -lrt" "$LINENO" 5 ++ { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5 ++$as_echo "not found" >&6; } + fi + fi + diff --git a/dist/syscall.patch b/dist/syscall.patch new file mode 100644 index 0000000..a64a6e5 --- /dev/null +++ b/dist/syscall.patch @@ -0,0 +1,21 @@ +diff -ur papi-6.0.0.1.orig/src/threads.c papi-6.0.0.1/src/threads.c +--- papi-6.0.0.1.orig/src/threads.c 2020-04-03 03:07:00.000000000 -0500 ++++ papi-6.0.0.1/src/threads.c 2020-08-28 08:51:45.000000000 -0500 +@@ -598,7 +598,7 @@ + } + + #if defined(__NR_gettid) && !defined(HAVE_GETTID) +- #include ++ #include + #include + unsigned long _papi_gettid(void) + { +@@ -611,7 +611,7 @@ + return (unsigned long)(gettid()); + } + #elif defined(HAVE_SYSCALL_GETTID) +- #include ++ #include + #include + unsigned long _papi_gettid(void) + { diff --git a/src/build.sh b/src/build.sh index eb01976..c117e1c 100755 --- a/src/build.sh +++ b/src/build.sh @@ -54,6 +54,8 @@ find . -type f -print | xargs perl -pi -e 's/malloc.h/stdlib.h/' # disable Werror since new compiler warns about PAPI find . -name config.mk -print | xargs perl -pi -e 's/-Werror//g' ${PATCH?} -p1 < ${SRCDIR}/../dist/F77_COMMON_NAME.patch +${PATCH?} -p1 < ${SRCDIR}/../dist/create_timer.patch +${PATCH?} -p1 < ${SRCDIR}/../dist/syscall.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