Skip to content

Commit d55493b

Browse files
author
shanedsnyder
authored
Merge pull request #1009 from Snell1224/ldms_streams_patch
Patch for ldms streams function
2 parents 13233ad + 0ab374b commit d55493b

File tree

2 files changed

+38
-12
lines changed

2 files changed

+38
-12
lines changed

darshan-runtime/lib/darshan-ldms.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,11 @@ ldms_t setup_connection(const char *xprt, const char *host,
7272
ts.tv_nsec = 0;
7373
}
7474

75+
#ifdef LDMS_XPRT_NEW_WITH_AUTH_3
7576
dC.ldms_g = ldms_xprt_new_with_auth(xprt, auth, NULL);
77+
#elif defined(LDMS_XPRT_NEW_WITH_AUTH_4)
78+
dC.ldms_g = ldms_xprt_new_with_auth(xprt, NULL, auth, NULL);
79+
#endif
7680
if (!dC.ldms_g) {
7781
darshan_core_fprintf(stderr, "LDMS library: Error %d creating the '%s' transport.\n", errno, xprt);
7882
return NULL;

maint/config/check_ldms.m4

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,46 @@
11
AC_DEFUN([CHECK_LDMS],
22
[
3-
AC_ARG_WITH(ldms,
3+
AC_ARG_WITH([ldms],
44
[ --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)],
76
[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"
1312
else
14-
AC_MSG_ERROR(LDMS installation path is required)
13+
AC_MSG_ERROR([LDMS installation path is required])
1514
fi])
1615
1716
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])])
2019
2120
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])],
2322
[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+
2446
])

0 commit comments

Comments
 (0)