Commit c3946b9d authored by Philip Carns's avatar Philip Carns

detect dynamic linking in profile conf

parent 2eae92a3
#!/bin/bash
# Example Darshan profiling configuration file for MPICH.
DARSHAN_PREFIX=@prefix@
# Check to see if user explicitly specified dynamic linking options
echo $CFLAGS |grep "\\-dynamic" >& /dev/null
dyncheck1=$?
echo $LDFLAGS |grep "\\-dynamic" >& /dev/null
dyncheck2=$?
echo "${allargs[@]}" | grep "\\-dynamic" >& /dev/null
dyncheck3=$?
DARSHAN_PREFIX=@prefix@
# Skip profiling if we know that dynamic linking is in use. See LD_PRELOAD
# method instead.
if [ "$dyncheck1" -ne 0 -a "$dyncheck2" -ne 0 -a "$dyncheck3" -ne 0 ]; then
# Libraries (and paths) to include before the MPI library
export PROFILE_PRELIB=`$DARSHAN_PREFIX/bin/darshan-config --pre-ld-flags`
# Libraries (and paths) to include before the MPI library
export PROFILE_PRELIB=`$DARSHAN_PREFIX/bin/darshan-config --pre-ld-flags`
# Libraries to include after the MPI library
export PROFILE_POSTLIB=`$DARSHAN_PREFIX/bin/darshan-config --post-ld-flags`
# Libraries to include after the MPI library
export PROFILE_POSTLIB=`$DARSHAN_PREFIX/bin/darshan-config --post-ld-flags`
fi
# C preprocessor arguments for any include files For example, to add
# /usr/local/myprof/include to the include path and the library libmyprof.a in
......
......@@ -6,15 +6,28 @@
DARSHAN_PREFIX=@prefix@
MPICH_LIB_OLD=@MPICH_LIB_OLD@
# Libraries (and paths) to include before the MPI library
if [ $MPICH_LIB_OLD -eq 1 ]; then
export PROFILE_PRELIB="-lmpichcxx `$DARSHAN_PREFIX/bin/darshan-config --pre-ld-flags`"
else
export PROFILE_PRELIB="-lmpicxx `$DARSHAN_PREFIX/bin/darshan-config --pre-ld-flags`"
fi
# Check to see if user explicitly specified dynamic linking options
echo $CFLAGS |grep "\\-dynamic" >& /dev/null
dyncheck1=$?
echo $LDFLAGS |grep "\\-dynamic" >& /dev/null
dyncheck2=$?
echo "${allargs[@]}" | grep "\\-dynamic" >& /dev/null
dyncheck3=$?
# Skip profiling if we know that dynamic linking is in use. See LD_PRELOAD
# method instead.
if [ "$dyncheck1" -ne 0 -a "$dyncheck2" -ne 0 -a "$dyncheck3" -ne 0 ]; then
# Libraries to include after the MPI library
export PROFILE_POSTLIB=`$DARSHAN_PREFIX/bin/darshan-config --post-ld-flags`
# Libraries (and paths) to include before the MPI library
if [ $MPICH_LIB_OLD -eq 1 ]; then
export PROFILE_PRELIB="-lmpichcxx `$DARSHAN_PREFIX/bin/darshan-config --pre-ld-flags`"
else
export PROFILE_PRELIB="-lmpicxx `$DARSHAN_PREFIX/bin/darshan-config --pre-ld-flags`"
fi
# Libraries to include after the MPI library
export PROFILE_POSTLIB=`$DARSHAN_PREFIX/bin/darshan-config --post-ld-flags`
fi
# C preprocessor arguments for any include files For example, to add
# /usr/local/myprof/include to the include path and the library libmyprof.a in
......
......@@ -6,15 +6,28 @@
DARSHAN_PREFIX=@prefix@
MPICH_LIB_OLD=@MPICH_LIB_OLD@
# Libraries (and paths) to include before the MPI library
if [ $MPICH_LIB_OLD -eq 1 ]; then
export PROFILE_PRELIB="-lfmpich `$DARSHAN_PREFIX/bin/darshan-config --pre-ld-flags`"
else
export PROFILE_PRELIB="-lmpifort `$DARSHAN_PREFIX/bin/darshan-config --pre-ld-flags`"
fi
# Check to see if user explicitly specified dynamic linking options
echo $CFLAGS |grep "\\-dynamic" >& /dev/null
dyncheck1=$?
echo $LDFLAGS |grep "\\-dynamic" >& /dev/null
dyncheck2=$?
echo "${allargs[@]}" | grep "\\-dynamic" >& /dev/null
dyncheck3=$?
# Skip profiling if we know that dynamic linking is in use. See LD_PRELOAD
# method instead.
if [ "$dyncheck1" -ne 0 -a "$dyncheck2" -ne 0 -a "$dyncheck3" -ne 0 ]; then
# Libraries to include after the MPI library
export PROFILE_POSTLIB=`$DARSHAN_PREFIX/bin/darshan-config --post-ld-flags`
# Libraries (and paths) to include before the MPI library
if [ $MPICH_LIB_OLD -eq 1 ]; then
export PROFILE_PRELIB="-lfmpich `$DARSHAN_PREFIX/bin/darshan-config --pre-ld-flags`"
else
export PROFILE_PRELIB="-lmpifort `$DARSHAN_PREFIX/bin/darshan-config --pre-ld-flags`"
fi
# Libraries to include after the MPI library
export PROFILE_POSTLIB=`$DARSHAN_PREFIX/bin/darshan-config --post-ld-flags`
fi
# C preprocessor arguments for any include files For example, to add
# /usr/local/myprof/include to the include path and the library libmyprof.a in
......
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