Commit 2a22e1ff authored by Shane Snyder's avatar Shane Snyder

add autoconf checking for lustre module

parent 6eae98bd
......@@ -19,6 +19,7 @@ LD = @LD@
DISABLE_LDPRELOAD = @DISABLE_LDPRELOAD@
ENABLE_MMAP_LOGS = @ENABLE_MMAP_LOGS@
DARSHAN_USE_BGQ = @DARSHAN_USE_BGQ@
DARSHAN_USE_LUSTRE = @DARSHAN_USE_LUSTRE@
DARSHAN_LOG_FORMAT = $(srcdir)/../darshan-log-format.h
DARSHAN_VERSION = @DARSHAN_VERSION@
......@@ -37,10 +38,6 @@ LIBS = -lz @LIBBZ2@
DARSHAN_STATIC_MOD_OBJS = lib/darshan-posix.o lib/darshan-mpiio.o lib/darshan-hdf5.o lib/darshan-pnetcdf.o
DARSHAN_DYNAMIC_MOD_OBJS = lib/darshan-posix.po lib/darshan-mpiio.po lib/darshan-hdf5.po lib/darshan-pnetcdf.po
# TODO: make the lustre module enabled using config options
DARSHAN_STATIC_MOD_OBJS += lib/darshan-lustre.o
DARSHAN_DYNAMIC_MOD_OBJS += lib/darshan-lustre.po
ifdef DARSHAN_USE_BGQ
DARSHAN_STATIC_MOD_OBJS += lib/darshan-bgq.o
DARSHAN_DYNAMIC_MOD_OBJS += lib/darshan-bgq.po
......@@ -48,6 +45,13 @@ CFLAGS += -DDARSHAN_BGQ
CFLAGS_SHARED += -DDARSHAN_BGQ
endif
ifdef DARSHAN_USE_LUSTRE
DARSHAN_STATIC_MOD_OBJS += lib/darshan-lustre.o
DARSHAN_DYNAMIC_MOD_OBJS += lib/darshan-lustre.po
CFLAGS += -DDARSHAN_LUSTRE
CFLAGS_SHARED += -DDARSHAN_LUSTRE
endif
lib::
@mkdir -p $@
......@@ -111,10 +115,10 @@ lib/darshan-pnetcdf.po: lib/darshan-pnetcdf.c darshan.h darshan-dynamic.h darsha
lib/darshan-pnetcdf-stubs.o: lib/darshan-pnetcdf-stubs.c darshan.h $(DARSHAN_LOG_FORMAT) | lib
$(CC) $(CFLAGS) -c $< -o $@
lib/darshan-lustre.o: lib/darshan-lustre.c darshan.h darshan-common.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-lustre-log-format.h | lib
lib/darshan-lustre.o: lib/darshan-lustre.c darshan-lustre.h darshan.h darshan-common.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-lustre-log-format.h | lib
$(CC) $(CFLAGS) -c $< -o $@
lib/darshan-lustre.po: lib/darshan-lustre.c darshan.h darshan-dynamic.h darshan-common.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-lustre-log-format.h | lib
lib/darshan-lustre.po: lib/darshan-lustre.c darshan-lustre.h darshan.h darshan-dynamic.h darshan-common.h $(DARSHAN_LOG_FORMAT) $(srcdir)/../darshan-lustre-log-format.h | lib
$(CC) $(CFLAGS_SHARED) -c $< -o $@
lib/lookup3.o: lib/lookup3.c
......
......@@ -621,6 +621,7 @@ ac_includes_default="\
ac_subst_vars='LTLIBOBJS
LIBOBJS
DARSHAN_USE_LUSTRE
DARSHAN_USE_BGQ
MPICH_LIB_OLD
DARSHAN_VERSION
......@@ -689,6 +690,7 @@ enable_ld_preload
enable_cuserid
enable_group_readable_logs
enable_bgq_mod
enable_lustre_mod
enable_mmap_logs
with_mem_align
with_log_path_by_env
......@@ -1320,6 +1322,7 @@ Optional Features:
--enable-group-readable-logs
Set log files to be group readable
--disable-bgq-mod Disables compilation and use of BG/Q module (for BG/Q systems)
--disable-lustre-mod Disables compilation and use of the Lustre module
--enable-mmmap-logs Enables ability to mmap I/O data to log file
Optional Packages:
......@@ -3566,7 +3569,7 @@ fi
fi
# Check whether --enable-bgq_mod was given.
# Check whether --enable-bgq-mod was given.
if test "${enable_bgq_mod+set}" = set; then :
enableval=$enable_bgq_mod;
else
......@@ -3575,6 +3578,15 @@ else
fi
# Check whether --enable-lustre-mod was given.
if test "${enable_lustre_mod+set}" = set; then :
enableval=$enable_lustre_mod;
else
enable_lustre_mod=check
fi
# Check whether --enable-mmap-logs was given.
if test "${enable_mmap_logs+set}" = set; then :
enableval=$enable_mmap_logs; if test "x$enableval" = "xyes" ; then
......@@ -3694,6 +3706,7 @@ _ACEOF
fi
# if bgq module not disabled, check to make sure BG/Q environment available
if test x$enable_bgq_mod != xno; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BG/Q environment" >&5
$as_echo_n "checking for BG/Q environment... " >&6; }
......@@ -3726,6 +3739,20 @@ fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
# if lustre module not disabled, check for needed Lustre module header
if test x$enable_lustre_mod != xno; then
ac_fn_c_check_header_mongrel "$LINENO" "lustre/lustre_user.h" "ac_cv_header_lustre_lustre_user_h" "$ac_includes_default"
if test "x$ac_cv_header_lustre_lustre_user_h" = xyes; then :
DARSHAN_USE_LUSTRE=1
else
if test "x$enable_lustre_mod" = xyes; then :
as_fn_error $? "Cannot find required headers for the Lustre module" "$LINENO" 5
fi
fi
fi
if test x$GOT_ALIGNMENT != x1; then
as_fn_error $? "must provide --with-mem-align=<num> argument to configure." "$LINENO" 5
fi
......@@ -4331,6 +4358,7 @@ DARSHAN_VERSION="3.0.1"
ac_config_files="$ac_config_files Makefile darshan-mk-log-dirs.pl darshan-gen-cc.pl darshan-gen-cxx.pl darshan-gen-fortran.pl darshan-config share/craype-1.x/darshan-module share/craype-2.x/darshan-module lib/pkgconfig/darshan-runtime.pc share/mpi-profile/darshan-cc.conf share/mpi-profile/darshan-cxx.conf share/mpi-profile/darshan-f.conf share/mpi-profile/darshan-bg-cc.conf share/mpi-profile/darshan-bg-cxx.conf share/mpi-profile/darshan-bg-f.conf share/ld-opts/darshan-base-ld-opts"
cat >confcache <<\_ACEOF
......
......@@ -47,12 +47,19 @@ fi]
,)
AC_ARG_ENABLE(
[bgq_mod],
[bgq-mod],
[ --disable-bgq-mod Disables compilation and use of BG/Q module (for BG/Q systems)],
[],
[enable_bgq_mod=check]
)
AC_ARG_ENABLE(
[lustre-mod],
[ --disable-lustre-mod Disables compilation and use of the Lustre module],
[],
[enable_lustre_mod=check]
)
AC_ARG_ENABLE(mmap-logs,
[ --enable-mmmap-logs Enables ability to mmap I/O data to log file],
[if test "x$enableval" = "xyes" ; then
......@@ -130,6 +137,7 @@ AC_ARG_WITH(mod-mem,
fi
)
# if bgq module not disabled, check to make sure BG/Q environment available
if test x$enable_bgq_mod != xno; then
AC_MSG_CHECKING(for BG/Q environment)
AC_TRY_COMPILE([
......@@ -145,6 +153,15 @@ if test x$enable_bgq_mod != xno; then
[]))
fi
# if lustre module not disabled, check for needed Lustre module header
if test x$enable_lustre_mod != xno; then
AC_CHECK_HEADER([lustre/lustre_user.h],
DARSHAN_USE_LUSTRE=1,
AS_IF([test "x$enable_lustre_mod" = xyes],
AC_MSG_ERROR(Cannot find required headers for the Lustre module),
[]))
fi
if test x$GOT_ALIGNMENT != x1; then
AC_MSG_ERROR(must provide --with-mem-align=<num> argument to configure.)
fi
......@@ -334,6 +351,7 @@ AC_SUBST(ENABLE_MMAP_LOGS)
AC_SUBST(DARSHAN_VERSION)
AC_SUBST(MPICH_LIB_OLD)
AC_SUBST(DARSHAN_USE_BGQ)
AC_SUBST(DARSHAN_USE_LUSTRE)
AC_OUTPUT(Makefile
darshan-mk-log-dirs.pl
darshan-gen-cc.pl
......
......@@ -34,8 +34,9 @@
#include "darshan-core.h"
#include "darshan-dynamic.h"
/* XXX stick this into autoconf .h */
#ifdef DARSHAN_LUSTRE
#include <lustre/lustre_user.h>
#endif
extern char* __progname;
extern char* __progname_full;
......@@ -932,7 +933,7 @@ static void add_entry(char* buf, int* space_left, struct mntent* entry)
else
mnt_data_array[mnt_data_count].fs_info.block_size = 4096;
/* XXX */
#ifdef DARSHAN_LUSTRE
/* attempt to retrieve OST and MDS counts from Lustre */
mnt_data_array[mnt_data_count].fs_info.ost_count = -1;
mnt_data_array[mnt_data_count].fs_info.mdt_count = -1;
......@@ -960,6 +961,7 @@ static void add_entry(char* buf, int* space_left, struct mntent* entry)
closedir( mount_dir );
}
}
#endif
/* store mount information with the job-level metadata in darshan log */
ret = snprintf(tmp_mnt, 256, "\n%s\t%s",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment