Skip to content

Commit

Permalink
PAPI: disabble config fail if no -lrt and correct syscall.h location
Browse files Browse the repository at this point in the history
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
  • Loading branch information
rhaas80 committed Aug 28, 2020
1 parent 18a95d5 commit 179578e
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
13 changes: 13 additions & 0 deletions 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

21 changes: 21 additions & 0 deletions 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 <syscall.h>
+ #include <sys/syscall.h>
#include <unistd.h>
unsigned long _papi_gettid(void)
{
@@ -611,7 +611,7 @@
return (unsigned long)(gettid());
}
#elif defined(HAVE_SYSCALL_GETTID)
- #include <syscall.h>
+ #include <sys/syscall.h>
#include <sys/types.h>
unsigned long _papi_gettid(void)
{
2 changes: 2 additions & 0 deletions src/build.sh
Expand Up @@ -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
Expand Down

0 comments on commit 179578e

Please sign in to comment.