|
1 | 1 | AC_DEFUN([CHECK_LDMS], |
2 | 2 | [ |
3 | | -AC_ARG_WITH(ldms, |
| 3 | +AC_ARG_WITH([ldms], |
4 | 4 | [ --with-ldms=DIR Root directory path of LDMS installation (defaults to |
5 | | - to /usr/local or /usr if not found in /usr/local) |
6 | | -], |
| 5 | + to /usr/local or /usr if not found in /usr/local)], |
7 | 6 | [if test -d "$withval"; then |
8 | | - LDMS_HOME="$withval" |
9 | | - LDFLAGS="$LDFLAGS -L${LDMS_HOME}/lib -Wl,-rpath=${LDMS_HOME}/lib" |
10 | | - CPPFLAGS="$CPPFLAGS -I${LDMS_HOME}/include" |
11 | | - __DARSHAN_LDMS_LINK_FLAGS="-L${LDMS_HOME}/lib" |
12 | | - __DARSHAN_LDMS_INCLUDE_FLAGS="-I${LDMS_HOME}/include" |
| 7 | + LDMS_HOME="$withval" |
| 8 | + LDFLAGS="$LDFLAGS -L${LDMS_HOME}/lib -Wl,-rpath=${LDMS_HOME}/lib" |
| 9 | + CPPFLAGS="$CPPFLAGS -I${LDMS_HOME}/include" |
| 10 | + __DARSHAN_LDMS_LINK_FLAGS="-L${LDMS_HOME}/lib" |
| 11 | + __DARSHAN_LDMS_INCLUDE_FLAGS="-I${LDMS_HOME}/include" |
13 | 12 | else |
14 | | - AC_MSG_ERROR(LDMS installation path is required) |
| 13 | + AC_MSG_ERROR([LDMS installation path is required]) |
15 | 14 | fi]) |
16 | 15 |
|
17 | 16 | AC_CHECK_HEADERS([ldms/ldms.h ldms/ldmsd_stream.h ovis_json/ovis_json.h ovis_util/util.h], |
18 | | - [ldms_found_stream_headers=yes; break;], |
19 | | - [AC_MSG_ERROR(One or more LDMS headers not found. Please check installation path or LDMS version is > [4.3.4])]) |
| 17 | + [ldms_found_stream_headers=yes], |
| 18 | + [AC_MSG_ERROR([One or more LDMS headers not found. Please check installation path or LDMS version > 4.3.4])]) |
20 | 19 |
|
21 | 20 | AS_IF([test "x$ldms_found_stream_headers" = "xyes"], |
22 | | - [AC_DEFINE([HAVE_LDMS],[1], [Define if standard LDMS library headers exist])], |
| 21 | + [AC_DEFINE([HAVE_LDMS], [1], [Define if standard LDMS library headers exist])], |
23 | 22 | [AC_MSG_ERROR([Unable to find the standard LDMS headers for Darshan.])]) |
| 23 | +
|
| 24 | +AC_CHECK_LIB([ldms], [ldms_xprt_new_with_auth], [], |
| 25 | + [AC_MSG_ERROR([libldms.so is missing or incompatible])]) |
| 26 | +
|
| 27 | +AC_MSG_CHECKING([whether ldms_xprt_new_with_auth has 3 or 4 arguments]) |
| 28 | +AC_COMPILE_IFELSE( |
| 29 | + [AC_LANG_SOURCE([[ |
| 30 | +#include <ldms/ldms.h> |
| 31 | +ldms_t ldms_xprt_new_with_auth(const char *xprt_name, const char *auth_name, struct attr_value_list *auth_av_list); |
| 32 | +]])], |
| 33 | + [AC_DEFINE([LDMS_XPRT_NEW_WITH_AUTH_3], [1], [Define if ldms_xprt_new_with_auth has 3 arguments])], |
| 34 | + [ |
| 35 | + AC_COMPILE_IFELSE( |
| 36 | + [AC_LANG_SOURCE([[ |
| 37 | +#include <ldms/ldmsd_stream.h> |
| 38 | +ldms_t ldms_xprt_new_with_auth(const char *xprt_name, ldms_log_fn_t log_fn, const char *auth_name, struct attr_value_list *auth_av_list); |
| 39 | +]])], |
| 40 | + [AC_DEFINE([LDMS_XPRT_NEW_WITH_AUTH_4], [1], [Define if ldms_xprt_new_with_auth has 4 arguments])], |
| 41 | + [AC_MSG_ERROR([Cannot determine the number of arguments for ldms_xprt_new_with_auth])] |
| 42 | + ) |
| 43 | + ] |
| 44 | +) |
| 45 | +
|
24 | 46 | ]) |
0 commit comments