Skip to content

Commit

Permalink
opa2: improve autoconf tests
Browse files Browse the repository at this point in the history
  • Loading branch information
morrone committed Nov 8, 2022
1 parent 2386d13 commit 1ce5bc9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
13 changes: 12 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,6 @@ OPTION_DEFAULT_ENABLE([tsampler], [ENABLE_TSAMPLER])
OPTION_DEFAULT_ENABLE([cray_power_sampler], [ENABLE_CRAY_POWER_SAMPLER])
dnl cray_power_sampler won't build with --disable-tsampler

OPTION_DEFAULT_DISABLE([opa2], [ENABLE_OPA2])
OPTION_DEFAULT_ENABLE([loadavg], [ENABLE_LOADAVG])
OPTION_DEFAULT_ENABLE([vmstat], [ENABLE_VMSTAT])
OPTION_DEFAULT_ENABLE([procdiskstats], [ENABLE_PROCDISKSTATS])
Expand Down Expand Up @@ -451,6 +450,18 @@ AS_IF([test "$enable_ibnet" = xyes],[
[AC_MSG_ERROR([ibnet required <infiniband/complib/cl_nodenamemap.h> not found ])])
])

AC_ARG_ENABLE([opa2],
[AS_HELP_STRING([--enable-opa2], [require the opa2 plugin @<:@default=check@:>@])],
[],
[enable_opa2="check"])
AM_CONDITIONAL([ENABLE_OPA2], [test "xenable_opa2" != xno])
AS_IF([test "x$enable_opa2" = xyes],[
AS_IF([test "x$HAVE_LIBIBMAD" = xno],
[AC_MSG_ERROR([opa2 required libibmad or <infiniband/mad.h> not found])])
AS_IF([test "x$HAVE_LIBIBUMAD" = xno],
[AC_MSG_ERROR([opa2 required libibumad or <infiniband/umad.h> not found])])
])

# enable tx2mon by default only when sensible.
AC_ARG_ENABLE([tx2mon],
[AS_HELP_STRING([--enable-tx2mon], [require components that depend upon tx2mon header) @<:@default=check@:>@])],
Expand Down
9 changes: 6 additions & 3 deletions ldms/src/sampler/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -286,13 +286,16 @@ endif
endif

if ENABLE_OPA2
OPA2_LIBADD = -libmad -libumad -lpthread
if HAVE_LIBIBMAD
if HAVE_LIBIBUMAD
OPA2_LIBADD = $(LTLIBIBMAD) $(LTLIBIBUMAD) -lpthread
libopa2_la_SOURCES = opa2.c
OPAINC=/usr/include/infiniband
libopa2_la_CFLAGS = $(AM_CFLAGS) -I$(OPAINC)
libopa2_la_CFLAGS = $(AM_CFLAGS) -I/usr/include/infiniband
libopa2_la_LIBADD = $(AM_LDFLAGS) $(COMMON_LIBADD) $(OPA2_LIBADD) $(JOBID_LIBFLAGS)
pkglib_LTLIBRARIES += libopa2.la
endif
endif
endif

if ENABLE_ATASMART
libsampler_atasmart_la_SOURCES = sampler_atasmart.c
Expand Down

0 comments on commit 1ce5bc9

Please sign in to comment.