Skip to content

Commit 22926e6

Browse files
committed
fix papi lookup
use pkg-config command to check if papi is installed. if yes, retrieve its cflags and libs
1 parent 3c9f06c commit 22926e6

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

darshan-runtime/configure.ac

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -333,11 +333,16 @@ if test "x$enable_darshan_runtime" = xyes ; then
333333
if test "x$ENABLE_MPI" = xno ; then
334334
AC_MSG_ERROR([--enable-apxc-mod Autoperf XC module requires MPI support])
335335
fi
336+
with_papi=`pkg-config --libs papi`
337+
if test "x$?" = x0 ; then
338+
CPPFLAGS+=`pkg-config --cflags papi`
339+
else
340+
AC_CHECK_HEADER([papi.h],
341+
[with_papi=-lpapi],
342+
[AC_MSG_ERROR([Cannot find papi header required for Autoperf XC module])],
343+
[])
344+
fi
336345
abssrcdir=$(readlink -f ${srcdir})
337-
AC_CHECK_HEADER([papi.h],
338-
[with_papi=-lpapi],
339-
[AC_MSG_ERROR([Cannot find papi header required for Autoperf XC module])],
340-
[])
341346
AC_CHECK_FILE([${abssrcdir}/../modules/autoperf/apxc/darshan-apxc-log-format.h],
342347
[],
343348
[AC_MSG_ERROR([The Autoperf XC git submodule is not present])])

0 commit comments

Comments
 (0)