Skip to content

Commit 0fd7dfe

Browse files
committed
darshan-config: add a complete list of options configured
1 parent b781182 commit 0fd7dfe

File tree

2 files changed

+277
-19
lines changed

2 files changed

+277
-19
lines changed

darshan-runtime/configure.ac

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,7 @@ if test "x$enable_darshan_runtime" = xyes ; then
651651
)
652652
])
653653

654+
rdtscp_num=
654655
AC_ARG_ENABLE(rdtscp,
655656
[ --enable-rdtscp=<num> Use RDTSCP intrinsic for timing, with specified base frequency],
656657
[
@@ -662,6 +663,8 @@ if test "x$enable_darshan_runtime" = xyes ; then
662663
fi
663664
if test x$HAVE_RDTSCP != x1; then
664665
AC_MSG_ERROR(attempted to enable rdtscp timer, but it is not supported on this platform)
666+
else
667+
rdtscp_num=${enableval}
665668
fi
666669
],
667670
[]
@@ -832,6 +835,39 @@ else
832835
with_jobid_env=
833836
fi
834837

838+
AC_SUBST(ENABLE_LD_PRELOAD, ["$enable_ld_preload"])
839+
AC_SUBST(ENABLE_CUSERID, ["$enable_cuserid"])
840+
AC_SUBST(ENABLE_GROUP_READABLE_LOGS, ["$enable_group_readable_logs"])
841+
AC_SUBST(ENABLE_MMAP_LOGS, ["$enable_mmap_logs"])
842+
AC_SUBST(ENABLE_NULL_MOD, ["$enable_null_mod"])
843+
AC_SUBST(ENABLE_POSIX_MOD, ["$enable_posix_mod"])
844+
AC_SUBST(ENABLE_STDIO_MOD, ["$enable_stdio_mod"])
845+
AC_SUBST(ENABLE_DXT_MOD, ["$enable_dxt_mod"])
846+
AC_SUBST(ENABLE_HEATMAP_MOD, ["$enable_heatmap_mod"])
847+
AC_SUBST(ENABLE_MPIIO_MOD, ["$enable_mpiio_mod"])
848+
AC_SUBST(ENABLE_APMPI_MOD, ["$enable_apmpi_mod"])
849+
AC_SUBST(ENABLE_APMPI_COLL_SYNC, ["$enable_apmpi_coll_sync"])
850+
AC_SUBST(ENABLE_APXC_MOD, ["$enable_apxc_mod"])
851+
AC_SUBST(ENABLE_HDF5_MOD, ["$enable_hdf5_mod"])
852+
AC_SUBST(ENABLE_PNETCDF_MOD, ["$enable_pnetcdf_mod"])
853+
AC_SUBST(ENABLE_DAOS_MOD, ["$enable_daos_mod"])
854+
AC_SUBST(ENABLE_BGQ_MOD, ["$enable_bgq_mod"])
855+
AC_SUBST(ENABLE_LUSTRE_MOD, ["$enable_lustre_mod"])
856+
AC_SUBST(ENABLE_MDHIM_MOD, ["$enable_mdhim_mod"])
857+
AC_SUBST(ENABLE_LDMS_MOD, ["$enable_ldms_mod"])
858+
AC_SUBST(ENABLE_RDTSCP_NUM, ["$rdtscp_num"])
859+
AC_SUBST(ENABLE_EXIT_WRAPPER, ["$enable_exit_wrapper"])
860+
AC_SUBST(ZLIB_HOME, ["$ZLIB_HOME"])
861+
AC_SUBST(MEM_ALIGN, ["$with_mem_align"])
862+
AC_SUBST(DARSHAN_LOG_HINTS, ["$__DARSHAN_LOG_HINTS"])
863+
AC_SUBST(JOBID_ENV, ["$with_jobid_env"])
864+
AC_SUBST(USERNAME_ENV, ["$with_username_env"])
865+
AC_SUBST(MOD_MEM, ["$with_mod_mem"])
866+
AC_SUBST(NAME_MEM, ["$with_name_mem"])
867+
AC_SUBST(HDF5_PATH, ["$with_hdf5"])
868+
AC_SUBST(PNETCDF_PATH, ["$with_pnetcdf"])
869+
AC_SUBST(DAOS_PATH, ["$with_daos"])
870+
AC_SUBST(LDMS_PATH, ["$LDMS_HOME"])
835871

836872
AM_CONDITIONAL(ENABLE_MMAP_LOGS, [test "x$enable_mmap_logs" = xyes])
837873
AM_CONDITIONAL(ENABLE_LDPRELOAD, [test "x$enable_ld_preload" = xyes])

darshan-runtime/darshan-config.in

Lines changed: 241 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
#!/bin/sh
2+
#
3+
# See COPYRIGHT notice in top-level directory.
4+
#
5+
# @configure_input@
6+
7+
version="@PACKAGE_NAME@ @PACKAGE_VERSION@"
28

39
prefix="@prefix@"
410
exec_prefix="@exec_prefix@"
@@ -7,6 +13,119 @@ DARSHAN_SHARE_PATH="@datarootdir@"
713
DARSHAN_LD_FLAGS="@LDFLAGS@"
814
DARSHAN_LOG_PATH="@__DARSHAN_LOG_PATH@"
915
DARSHAN_LOG_ENV="@__DARSHAN_LOG_ENV@"
16+
DARSHAN_LUSTRE_LD_FLAGS="@DARSHAN_LUSTRE_LD_FLAGS@"
17+
DARSHAN_HDF5_LD_FLAGS="@DARSHAN_HDF5_LD_FLAGS@"
18+
19+
C_COMPILER="@CC@"
20+
C_COMPILER=`echo "$C_COMPILER" | sed -e 's/^[ \t]*//'`
21+
CPPFLAGS="@CPPFLAGS@"
22+
CPPFLAGS=`echo "$CPPFLAGS" | sed -e 's/^[ \t]*//'`
23+
CFLAGS="@CFLAGS@"
24+
CFLAGS=`echo "$CFLAGS" | sed -e 's/^[ \t]*//'`
25+
LIBS="@LIBS@"
26+
LIBS=`echo "$LIBS" | sed -e 's/^[ \t]*//'`
27+
28+
enable_ld_preload="@ENABLE_LD_PRELOAD@"
29+
enable_cuserid="@ENABLE_CUSERID@"
30+
enable_group_readable_logs="@ENABLE_GROUP_READABLE_LOGS@"
31+
enable_mmap_logs="@ENABLE_MMAP_LOGS@"
32+
enable_null_mod="@ENABLE_NULL_MOD@"
33+
enable_posix_mod="@ENABLE_POSIX_MOD@"
34+
enable_stdio_mod="@ENABLE_STDIO_MOD@"
35+
enable_dxt_mod="@ENABLE_DXT_MOD@"
36+
enable_heatmap_mod="@ENABLE_HEATMAP_MOD@"
37+
enable_mpiio_mod="@ENABLE_MPIIO_MOD@"
38+
enable_apmpi_mod="@ENABLE_APMPI_MOD@"
39+
enable_apmpi_coll_sync="@ENABLE_APMPI_COLL_SYNC@"
40+
enable_apxc_mod="@ENABLE_APXC_MOD@"
41+
enable_hdf5_mod="@ENABLE_HDF5_MOD@"
42+
enable_pnetcdf_mod="@ENABLE_PNETCDF_MOD@"
43+
enable_daos_mod="@ENABLE_DAOS_MOD@"
44+
enable_bgq_mod="@ENABLE_BGQ_MOD@"
45+
enable_lustre_mod="@ENABLE_LUSTRE_MOD@"
46+
enable_mdhim_mod="@ENABLE_MDHIM_MOD@"
47+
enable_ldms_mod="@ENABLE_LDMS_MOD@"
48+
enable_rdtscp_num="@ENABLE_RDTSCP_NUM@"
49+
enable_exit_wrapper="@ENABLE_EXIT_WRAPPER@"
50+
51+
zlib_home="@ZLIB_HOME@"
52+
mem_align="@MEM_ALIGN@"
53+
log_hints="@DARSHAN_LOG_HINTS@"
54+
jobid_env="@JOBID_ENV@"
55+
if test "x$jobid_env" = xNONE ; then username_env= ; fi
56+
username_env="@USERNAME_ENV@"
57+
if test "x$username_env" = xno ; then username_env= ; fi
58+
mod_mem="@MOD_MEM@"
59+
if test "x$mod_mem" = xno ; then mod_mem= ; fi
60+
name_mem="@NAME_MEM@"
61+
if test "x$name_mem" = xno ; then name_mem= ; fi
62+
hdf5_path="@HDF5_PATH@"
63+
if test "x$hdf5_path" = xno ; then hdf5_path= ; fi
64+
pnetcdf_path="@PNETCDF_PATH@"
65+
if test "x$pnetcdf_path" = xno ; then pnetcdf_path= ; fi
66+
daos_path="@DAOS_PATH@"
67+
if test "x$daos_path" = xno ; then daos_path= ; fi
68+
ldms_path="@LDMS_PATH@"
69+
if test "x$ldms_path" = xno ; then ldms_path= ; fi
70+
71+
all()
72+
{
73+
echo
74+
echo "This $version was built with the following features:"
75+
echo
76+
echo " --ld-preload -> $enable_ld_preload"
77+
echo " --cuserid -> $enable_cuserid"
78+
echo " --group-readable-logs -> $enable_group_readable_logs"
79+
echo " --mmap-logs -> $enable_mmap_logs"
80+
echo " --null-mod -> $enable_null_mod"
81+
echo " --posix-mod -> $enable_posix_mod"
82+
echo " --stdio-mod -> $enable_stdio_mod"
83+
echo " --dxt-mod -> $enable_dxt_mod"
84+
echo " --heatmap-mod -> $enable_heatmap_mod"
85+
echo " --mpiio-mod -> $enable_mpiio_mod"
86+
echo " --apmpi-mod -> $enable_apmpi_mod"
87+
echo " --apmpi-coll-sync -> $enable_apmpi_coll_sync"
88+
echo " --apxc-mod -> $enable_apxc_mod"
89+
echo " --hdf5-mod -> $enable_hdf5_mod"
90+
echo " --pnetcdf-mod -> $enable_pnetcdf_mod"
91+
echo " --daos-mod -> $enable_daos_mod"
92+
echo " --bgq-mod -> $enable_bgq_mod"
93+
echo " --lustre-mod -> $enable_lustre_mod"
94+
echo " --mdhim-mod -> $enable_mdhim_mod"
95+
echo " --ldms-mod -> $enable_ldms_mod"
96+
if test "x$enable_rdtscp_num" = x ; then
97+
echo " --rdtscp -> no"
98+
else
99+
echo " --rdtscp -> $enable_rdtscp_num"
100+
fi
101+
echo " --exit-wrapper -> $enable_exit_wrapper"
102+
103+
echo
104+
echo "This $version was built using the following compilers and flags:"
105+
echo
106+
echo " --cc -> $C_COMPILER"
107+
echo " --cppflags -> $CPPFLAGS"
108+
echo " --cflags -> $CFLAGS"
109+
echo " --ldflags -> $LDFLAGS"
110+
echo " --libs -> $LIBS"
111+
echo ""
112+
echo " --pre-ld-flags -> $PRE_LD_FLAGS"
113+
echo " --post-ld-flags -> $POST_LD_FLAGS"
114+
echo " --dyn-ld-flags -> $DYN_LD_FLAGS"
115+
echo " --log-path -> $DARSHAN_LOG_ALL"
116+
echo ""
117+
echo " --with-zlib-path -> $zlib_home"
118+
echo " --with-mem-align -> $mem_align"
119+
echo " --with-log-hints -> $log_hints"
120+
echo " --with-jobid-env -> $jobid_env"
121+
echo " --with-username-env -> $username_env"
122+
echo " --with-mod-mem -> $mod_mem"
123+
echo " --with-name-mem -> $name_mem"
124+
echo " --with-hdf5 -> $hdf5_path"
125+
echo " --with-pnetcdf -> $pnetcdf_path"
126+
echo " --with-daos -> $daos_path"
127+
echo " --with-ldms -> $ldms_path"
128+
}
10129

11130
# NOTE:
12131
# - we deliberately list libdarshan twice in the link command when
@@ -15,14 +134,14 @@ DARSHAN_LOG_ENV="@__DARSHAN_LOG_ENV@"
15134
# resolve indirect dependencies on PnetCDF and HDF5 symbols (if the
16135
# app used a library which in turn used one of those HLLs).
17136

18-
PRE_LD_FLAGS="-L$DARSHAN_LIB_PATH $DARSHAN_LD_FLAGS -ldarshan -lz -Wl,@$DARSHAN_SHARE_PATH/ld-opts/darshan-ld-opts"
19-
POST_LD_FLAGS="-L$DARSHAN_LIB_PATH -ldarshan @DARSHAN_LUSTRE_LD_FLAGS@ -lz -lrt -lpthread -lm"
137+
PRE_LD_FLAGS="-L$DARSHAN_LIB_PATH $DARSHAN_LD_FLAGS -ldarshan -lz -Wl,$DARSHAN_SHARE_PATH/ld-opts/darshan-ld-opts"
138+
POST_LD_FLAGS="-L$DARSHAN_LIB_PATH -ldarshan $DARSHAN_LUSTRE_LD_FLAGS -lz -lrt -lpthread -lm"
20139

21140
# NOTE:
22141
# - when dynamic linking there is no need for wrapping options, we simply
23142
# need to get the darshan symbol definitions early enough in the link
24143
# order. We also set no-as-needed for linkers that may not identify
25-
DYN_LD_FLAGS="-L$DARSHAN_LIB_PATH $DARSHAN_LD_FLAGS -Wl,-rpath=$DARSHAN_LIB_PATH -Wl,-no-as-needed -ldarshan @DARSHAN_LUSTRE_LD_FLAGS@ @DARSHAN_HDF5_LD_FLAGS@"
144+
DYN_LD_FLAGS="-L$DARSHAN_LIB_PATH $DARSHAN_LD_FLAGS -Wl,-rpath=$DARSHAN_LIB_PATH -Wl,-no-as-needed -ldarshan $DARSHAN_LUSTRE_LD_FLAGS $DARSHAN_HDF5_LD_FLAGS"
26145

27146
# NOTE:
28147
# - construct complete list of log path options, separated by commas.
@@ -43,8 +162,71 @@ else
43162
DARSHAN_LOG_ALL=$DARSHAN_LOG_PATH
44163
fi
45164

46-
usage="\
47-
Usage: darshan-config [--pre-ld-flags] [--post-ld-flags] [--dyn-ld-flags] [--log-path]"
165+
usage()
166+
{
167+
cat <<EOF
168+
darshan-config is a utility program to display the build and installation
169+
information of the Darshan runtime library.
170+
171+
Usage: darshan-config [OPTION]
172+
173+
Available values for OPTION include:
174+
175+
--help display this help message and exit
176+
--all display all options
177+
--cc C compiler used to build Darshan
178+
--cflags C compiler flags used to build Darshan
179+
--cppflags C pre-processor flags used to build Darshan
180+
--ldflags Linker flags used to build Darshan
181+
--libs Extra libraries used to build Darshan
182+
--pre-ld-flags Linker flags for setting env variable LD_PRELOAD
183+
--post-ld-flags Linker flags for statically linking
184+
--dyn-ld-flags Linker flags for dynamically linking
185+
--log-path Storage locations of Darshan log files
186+
187+
--ld-preload Whether LD_PRELOAD library is enabled
188+
--cuserid Whether cuserid() is used at run time
189+
--group-readable-logs Whether log files are group readable
190+
--mmap-logs Whether to use mmap I/O data to log file
191+
--null-mod Whether NULL module is enabled
192+
--posix-mod Whether POSIX module is enabled
193+
--stdio-mod Whether STDIO module is enabled
194+
--dxt-mod Whether DXT module is enabled
195+
--heatmap-mod Whether HEATMAP module is enabled
196+
--mpiio-mod Whether MPI-IO module is enabled
197+
--apmpi-mod Whether AUTOPERF MPI module is enabled
198+
--apmpi-coll-sync Whether sync for MPI collectives is enabled
199+
--apxc-mod Whether AUTOPERF XC module is enabled
200+
--hdf5-mod Whether HDF5 module is enabled
201+
--pnetcdf-mod Whether PnetCDF module is enabled
202+
--daos-mod Whether DAOS module is enabled
203+
--bgq-mod Whether BG/Q module is enabled
204+
--lustre-mod Whether Lustre module is enabled
205+
--mdhim-mod Whether mdhim module is enabled
206+
--ldms-mod Whether to include LDMS for runtime I/O monitoring
207+
--rdtscp Frequency of using RDTSCP intrinsic for timing
208+
--exit-wrapper Whether to wrap _exit() calls as last ditch shutdown
209+
hook for the Darshan library when used in non-MPI mode
210+
211+
--with-zlib Root directory path of zlib installation
212+
--with-mem-align Memory alignment in bytes
213+
--with-log-hints List of MPI-IO hints for log file write
214+
--with-log-path Location to store log files at run time
215+
--with-jobid-env Name of environment variable that stores the jobid
216+
--with-username-env Name of environment variable that stores the username
217+
--with-mod-mem Maximum runtime memory consumption per process (in
218+
MiB) across all instrumentation modules
219+
--with-name-mem Maximum runtime memory consumption per process (in
220+
MiB) for storing name records
221+
--with-hdf5 Installation directory for HDF5.
222+
--with-pnetcdf Installation directory for PnetCDF.
223+
--with-daos Installation directory for DAOS.
224+
--with-ldms Root directory path of LDMS installation
225+
226+
EOF
227+
exit $1
228+
}
229+
48230

49231
if test $# -eq 0; then
50232
echo "${usage}" 1>&2
@@ -58,22 +240,62 @@ while test $# -gt 0; do
58240
esac
59241

60242
case $1 in
61-
--pre-ld-flags)
62-
echo $PRE_LD_FLAGS
63-
;;
64-
--post-ld-flags)
65-
echo $POST_LD_FLAGS
66-
;;
67-
--dyn-ld-flags)
68-
echo $DYN_LD_FLAGS
69-
;;
70-
--log-path)
71-
echo $DARSHAN_LOG_ALL
72-
;;
243+
--help) usage 0 ;;
244+
--all) all ;;
245+
246+
--version) echo "$version" ;;
247+
--cc) echo "$C_COMPILER" ;;
248+
--cflags) echo "$CFLAGS" ;;
249+
--cppflags) echo "$CPPFLAGS" ;;
250+
--libdir) echo "$DARSHAN_LIB_PATH" ;;
251+
--ldflags) echo "$LDFLAGS" ;;
252+
--libs) echo "$LIBS" ;;
253+
254+
--ld-preload) echo "$enable_ld_preload" ;;
255+
--cuserid) echo "$enable_cuserid" ;;
256+
--group-readable-logs) echo "$enable_group_readable_logs" ;;
257+
--mmap-logs) echo "$enable_mmap_logs" ;;
258+
--null-mod) echo "$enable_null_mod" ;;
259+
--posix-mod) echo "$enable_posix_mod" ;;
260+
--stdio-mod) echo "$enable_stdio_mod" ;;
261+
--dxt-mod) echo "$enable_dxt_mod" ;;
262+
--heatmap-mod) echo "$enable_heatmap_mod" ;;
263+
--mpiio-mod) echo "$enable_mpiio_mod" ;;
264+
--apmpi-mod) echo "$enable_apmpi_mod" ;;
265+
--apmpi-coll-sync) echo "$enable_apmpi_coll_sync" ;;
266+
--apxc-mod) echo "$enable_apxc_mod" ;;
267+
--hdf5-mod) echo "$enable_hdf5_mod" ;;
268+
--pnetcdf-mod) echo "$enable_pnetcdf_mod" ;;
269+
--daos-mod) echo "$enable_daos_mod" ;;
270+
--bgq-mod) echo "$enable_bgq_mod" ;;
271+
--lustre-mod) echo "$enable_lustre_mod" ;;
272+
--mdhim-mod) echo "$enable_mdhim_mod" ;;
273+
--ldms-mod) echo "$enable_ldms_mod" ;;
274+
--rdtscp) echo "$enable_rdtscp_num" ;;
275+
--exit-wrapper) echo "$enable_exit_wrapper" ;;
276+
277+
--pre-ld-flags) echo "$PRE_LD_FLAGS" ;;
278+
--post-ld-flags) echo "$POST_LD_FLAGS" ;;
279+
--dyn-ld-flags) echo "$DYN_LD_FLAGS" ;;
280+
--log-path) echo "$DARSHAN_LOG_ALL" ;;
281+
--with-zlib-path) echo "$zlib_home" ;;
282+
--with-mem-align) echo "$mem_align" ;;
283+
--with-log-hints) echo "$log_hints" ;;
284+
--with-jobid-env) echo "$jobid_env" ;;
285+
--with-username-env) echo "$username_env" ;;
286+
--with-mod-mem) echo "$mod_mem" ;;
287+
--with-name-mem) echo "$name_mem" ;;
288+
--with-hdf5) echo "$hdf5_path" ;;
289+
--with-pnetcdf) echo "$pnetcdf_path" ;;
290+
--with-daos) echo "$daos_path" ;;
291+
--with-ldms) echo "$ldms_path" ;;
73292
*)
74-
echo "${usage}" 1>&2
75-
exit 1
293+
echo "unknown option: $1"
294+
echo ""
295+
usage 1
76296
;;
77297
esac
78298
shift
79299
done
300+
301+
exit 0

0 commit comments

Comments
 (0)