Commit ede1b95f authored by Philip Carns's avatar Philip Carns

propitated symbol detection logic to fortran compiler scripts


git-svn-id: https://svn.mcs.anl.gov/repos/darshan/trunk@84 3b7491f3-a168-0410-bf4b-c445ed680a29
parent 17ae85ce
......@@ -262,7 +262,7 @@ if [ "$linking" = yes ] ; then
stock_link_cmd="$CXX ${allargs[@]} -I$includedir $CXXFLAGS $LDFLAGS -L$libdir -L$opalibdir $shllibpath $cxxlibs $mpilibs $MPI_OTHERLIBS"
darshan_link_cmd="$CXX ${allargs[@]} -L${DARSHAN_LIB_PATH} ${CP_ZLIB_LINK_FLAGS} -ldarshan-mpi-io -lz -I$includedir $CXXFLAGS ${CP_WRAPPERS} $LDFLAGS -L$libdir -L$opalibdir $shllibpath $cxxlibs $mpilibs $MPI_OTHERLIBS -L${DARSHAN_LIB_PATH} -ldarshan-posix"
darshan_link_cmd="$CXX ${allargs[@]} -L${DARSHAN_LIB_PATH} ${CP_ZLIB_LINK_FLAGS} -lcxxmpich.cnk -ldarshan-mpi-io -lz -I$includedir $CXXFLAGS ${CP_WRAPPERS} $LDFLAGS -L$libdir -L$opalibdir $shllibpath $cxxlibs $mpilibs $MPI_OTHERLIBS -L${DARSHAN_LIB_PATH} -ldarshan-posix"
used_darshan=0
......
......@@ -299,21 +299,47 @@ if [ "$linking" = yes ] ; then
# Prepend the path for the shared libraries to the library list
mpilibs="$FC_LINKPATH_SHL$libdir $mpilibs"
fi
# check to see if the command line refers to any profilers that might
# use PMPI.
profiler_check=`echo "${allargs[@]}" | ${DARSHAN_BIN_PATH}/darshan-pmpi-filter.sh`
if [ "$profiler_check" = "" ] ; then
# If we link link darshan-mpi-io before system mpi lib, we don't
# get a trace but if we don't link it early enough, we get
# undefined MPI symbols. Seems like listing the darshan libs
# twice does the trick
$Show $FC ${CP_WRAPPERS} "${allargs[@]}" -L${DARSHAN_LIB_PATH} \
${CP_ZLIB_LINK_FLAGS} -lfmpich.cnk -ldarshan-posix -ldarshan-mpi-io \
-I$includedir $FFLAGS $LDFLAGS -L$libdir \
-L$opalibdir $mpilibs $MPI_OTHERLIBS \
-L${DARSHAN_LIB_PATH} -ldarshan-posix -ldarshan-mpi-io -lz
else
$Show $FC "${allargs[@]}" -I$includedir $FFLAGS $LDFLAGS -L$libdir -L$opalibdir $mpilibs $MPI_OTHERLIBS
# Trial run to generate a symbol listing. We only enable Darshan if:
# a) MPI is used
# b) PMPI is _not_ used
#
# We want Darshan to get out of the way if the user is doing a runtime
# test in configure (in which case MPI objects break the executable) or
# if the user is using another PMPI based tool
stock_link_cmd="$FC ${allargs[@]} -I$includedir $FFLAGS $LDFLAGS -L$libdir -L$opalibdir $mpilibs $MPI_OTHERLIBS"
darshan_link_cmd="$FC ${CP_WRAPPERS} ${allargs[@]} -L${DARSHAN_LIB_PATH} ${CP_ZLIB_LINK_FLAGS} -lfmpich.cnk -ldarshan-posix -ldarshan-mpi-io -I$includedir $FFLAGS $LDFLAGS -L$libdir -L$opalibdir $mpilibs $MPI_OTHERLIBS -L${DARSHAN_LIB_PATH} -ldarshan-posix -ldarshan-mpi-io -lz"
used_darshan=0
# create a temporary file
tmpfile=`mktemp`
# generate a map of the symbol names
$stock_link_cmd -Wl,-Map,$tmpfile $LDFLAGS -o /dev/null >& /dev/null
# is MPI in there?
grep MPI $tmpfile >& /dev/null
rc_mpi=$?
# is PMPI in there (except for the mpich library itself)?
grep \(PMPI $tmpfile | grep -v mpich.cnk.a >& /dev/null
rc_pmpi=$?
rm $tmpfile >& /dev/null
# disable darshan if the executable is not an MPI program (this feature
# mainly allows runtime configure tests to work
if [ $rc_mpi -eq 0 ] ; then
# disable darshan if something else is already using PMPI; we don't
# want to cause any symbol conflicts
if [ $rc_pmpi -ne 0 ] ; then
$Show $darshan_link_cmd
used_darshan=1
fi
fi
# otherwise use the normal command line
if [ "$used_darshan" = "0" ] ; then
$Show $stock_link_cmd
fi
rc=$?
else
......
......@@ -346,21 +346,47 @@ if [ "$linking" = yes ] ; then
# Prepend the path for the shared libraries to the library list
mpilibs="$F90_LINKPATH_SHL$libdir $mpilibs"
fi
# check to see if the command line refers to any profilers that might
# use PMPI.
profiler_check=`echo "${allargs[@]}" | ${DARSHAN_BIN_PATH}/darshan-pmpi-filter.sh`
if [ "$profiler_check" = "" ] ; then
# If we link link darshan-mpi-io before system mpi lib, we don't
# get a trace but if we don't link it early enough, we get
# undefined MPI symbols. Seems like listing the darshan libs
# twice does the trick
$Show $F90 ${CP_WRAPPERS} "${allargs[@]}" -L${DARSHAN_LIB_PATH} \
${CP_ZLIB_LINK_FLAGS} -lfmpich.cnk -ldarshan-posix -ldarshan-mpi-io \
$F90INCDIRS $F90MODDIRS $F90FLAGS $LDFLAGS -L$libdir \
-L$opalibdir $F90MODLIBS $mpilibs $MPI_OTHERLIBS \
-L${DARSHAN_LIB_PATH} -ldarshan-posix -ldarshan-mpi-io -lz
else
$Show $F90 "${allargs[@]}" $F90INCDIRS $F90MODDIRS $F90FLAGS $LDFLAGS -L$libdir -L$opalibdir $F90MODLIBS $mpilibs $MPI_OTHERLIBS
# Trial run to generate a symbol listing. We only enable Darshan if:
# a) MPI is used
# b) PMPI is _not_ used
#
# We want Darshan to get out of the way if the user is doing a runtime
# test in configure (in which case MPI objects break the executable) or
# if the user is using another PMPI based tool
stock_link_cmd="$F90 ${allargs[@]} $F90INCDIRS $F90MODDIRS $F90FLAGS $LDFLAGS -L$libdir -L$opalibdir $F90MODLIBS $mpilibs $MPI_OTHERLIBS"
darshan_link_cmd="$F90 ${CP_WRAPPERS} ${allargs[@]} -L${DARSHAN_LIB_PATH} ${CP_ZLIB_LINK_FLAGS} -lfmpich.cnk -ldarshan-posix -ldarshan-mpi-io $F90INCDIRS $F90MODDIRS $F90FLAGS $LDFLAGS -L$libdir -L$opalibdir $F90MODLIBS $mpilibs $MPI_OTHERLIBS -L${DARSHAN_LIB_PATH} -ldarshan-posix -ldarshan-mpi-io -lz"
used_darshan=0
# create a temporary file
tmpfile=`mktemp`
# generate a map of the symbol names
$stock_link_cmd -Wl,-Map,$tmpfile $LDFLAGS -o /dev/null >& /dev/null
# is MPI in there?
grep MPI $tmpfile >& /dev/null
rc_mpi=$?
# is PMPI in there (except for the mpich library itself)?
grep \(PMPI $tmpfile | grep -v mpich.cnk.a >& /dev/null
rc_pmpi=$?
rm $tmpfile >& /dev/null
# disable darshan if the executable is not an MPI program (this feature
# mainly allows runtime configure tests to work
if [ $rc_mpi -eq 0 ] ; then
# disable darshan if something else is already using PMPI; we don't
# want to cause any symbol conflicts
if [ $rc_pmpi -ne 0 ] ; then
$Show $darshan_link_cmd
used_darshan=1
fi
fi
# otherwise use the normal command line
if [ "$used_darshan" = "0" ] ; then
$Show $stock_link_cmd
fi
rc=$?
else
......
......@@ -262,7 +262,7 @@ if [ "$linking" = yes ] ; then
stock_link_cmd="$CXX ${allargs[@]} -I$includedir $CXXFLAGS $LDFLAGS -L$libdir -L$opalibdir $shllibpath $cxxlibs $mpilibs $MPI_OTHERLIBS"
darshan_link_cmd="$CXX ${allargs[@]} -L${DARSHAN_LIB_PATH} ${CP_ZLIB_LINK_FLAGS} -ldarshan-mpi-io -lz -I$includedir $CXXFLAGS ${CP_WRAPPERS} $LDFLAGS -L$libdir -L$opalibdir $shllibpath $cxxlibs $mpilibs $MPI_OTHERLIBS -L${DARSHAN_LIB_PATH} -ldarshan-posix"
darshan_link_cmd="$CXX ${allargs[@]} -L${DARSHAN_LIB_PATH} ${CP_ZLIB_LINK_FLAGS} -lcxxmpich.cnk -ldarshan-mpi-io -lz -I$includedir $CXXFLAGS ${CP_WRAPPERS} $LDFLAGS -L$libdir -L$opalibdir $shllibpath $cxxlibs $mpilibs $MPI_OTHERLIBS -L${DARSHAN_LIB_PATH} -ldarshan-posix"
used_darshan=0
......
......@@ -262,7 +262,7 @@ if [ "$linking" = yes ] ; then
stock_link_cmd="$CXX ${allargs[@]} -I$includedir $CXXFLAGS $LDFLAGS -L$libdir -L$opalibdir $shllibpath $cxxlibs $mpilibs $MPI_OTHERLIBS"
darshan_link_cmd="$CXX ${allargs[@]} -L${DARSHAN_LIB_PATH} ${CP_ZLIB_LINK_FLAGS} -ldarshan-mpi-io -lz -I$includedir $CXXFLAGS ${CP_WRAPPERS} $LDFLAGS -L$libdir -L$opalibdir $shllibpath $cxxlibs $mpilibs $MPI_OTHERLIBS -L${DARSHAN_LIB_PATH} -ldarshan-posix"
darshan_link_cmd="$CXX ${allargs[@]} -L${DARSHAN_LIB_PATH} ${CP_ZLIB_LINK_FLAGS} -lcxxmpich.cnk -ldarshan-mpi-io -lz -I$includedir $CXXFLAGS ${CP_WRAPPERS} $LDFLAGS -L$libdir -L$opalibdir $shllibpath $cxxlibs $mpilibs $MPI_OTHERLIBS -L${DARSHAN_LIB_PATH} -ldarshan-posix"
used_darshan=0
......
......@@ -299,21 +299,47 @@ if [ "$linking" = yes ] ; then
# Prepend the path for the shared libraries to the library list
mpilibs="$FC_LINKPATH_SHL$libdir $mpilibs"
fi
# check to see if the command line refers to any profilers that might
# use PMPI.
profiler_check=`echo "${allargs[@]}" | ${DARSHAN_BIN_PATH}/darshan-pmpi-filter.sh`
if [ "$profiler_check" = "" ] ; then
# If we link link darshan-mpi-io before system mpi lib, we don't
# get a trace but if we don't link it early enough, we get
# undefined MPI symbols. Seems like listing the darshan libs
# twice does the trick
$Show $FC ${CP_WRAPPERS} "${allargs[@]}" -L${DARSHAN_LIB_PATH} \
${CP_ZLIB_LINK_FLAGS} -lfmpich.cnk -ldarshan-posix -ldarshan-mpi-io \
-I$includedir $FFLAGS $LDFLAGS -L$libdir \
-L$opalibdir $mpilibs $MPI_OTHERLIBS \
-L${DARSHAN_LIB_PATH} -ldarshan-posix -ldarshan-mpi-io -lz
else
$Show $FC "${allargs[@]}" -I$includedir $FFLAGS $LDFLAGS -L$libdir -L$opalibdir $mpilibs $MPI_OTHERLIBS
# Trial run to generate a symbol listing. We only enable Darshan if:
# a) MPI is used
# b) PMPI is _not_ used
#
# We want Darshan to get out of the way if the user is doing a runtime
# test in configure (in which case MPI objects break the executable) or
# if the user is using another PMPI based tool
stock_link_cmd="$FC ${allargs[@]} -I$includedir $FFLAGS $LDFLAGS -L$libdir -L$opalibdir $mpilibs $MPI_OTHERLIBS"
darshan_link_cmd="$FC ${CP_WRAPPERS} ${allargs[@]} -L${DARSHAN_LIB_PATH} ${CP_ZLIB_LINK_FLAGS} -lfmpich.cnk -ldarshan-posix -ldarshan-mpi-io -I$includedir $FFLAGS $LDFLAGS -L$libdir -L$opalibdir $mpilibs $MPI_OTHERLIBS -L${DARSHAN_LIB_PATH} -ldarshan-posix -ldarshan-mpi-io -lz"
used_darshan=0
# create a temporary file
tmpfile=`mktemp`
# generate a map of the symbol names
$stock_link_cmd -Wl,-Map,$tmpfile $LDFLAGS -o /dev/null >& /dev/null
# is MPI in there?
grep MPI $tmpfile >& /dev/null
rc_mpi=$?
# is PMPI in there (except for the mpich library itself)?
grep \(PMPI $tmpfile | grep -v mpich.cnk.a >& /dev/null
rc_pmpi=$?
rm $tmpfile >& /dev/null
# disable darshan if the executable is not an MPI program (this feature
# mainly allows runtime configure tests to work
if [ $rc_mpi -eq 0 ] ; then
# disable darshan if something else is already using PMPI; we don't
# want to cause any symbol conflicts
if [ $rc_pmpi -ne 0 ] ; then
$Show $darshan_link_cmd
used_darshan=1
fi
fi
# otherwise use the normal command line
if [ "$used_darshan" = "0" ] ; then
$Show $stock_link_cmd
fi
rc=$?
else
......
......@@ -299,21 +299,47 @@ if [ "$linking" = yes ] ; then
# Prepend the path for the shared libraries to the library list
mpilibs="$FC_LINKPATH_SHL$libdir $mpilibs"
fi
# check to see if the command line refers to any profilers that might
# use PMPI.
profiler_check=`echo "${allargs[@]}" | ${DARSHAN_BIN_PATH}/darshan-pmpi-filter.sh`
if [ "$profiler_check" = "" ] ; then
# If we link link darshan-mpi-io before system mpi lib, we don't
# get a trace but if we don't link it early enough, we get
# undefined MPI symbols. Seems like listing the darshan libs
# twice does the trick
$Show $FC ${CP_WRAPPERS} "${allargs[@]}" -L${DARSHAN_LIB_PATH} \
${CP_ZLIB_LINK_FLAGS} -lfmpich.cnk -ldarshan-posix -ldarshan-mpi-io \
-I$includedir $FFLAGS $LDFLAGS -L$libdir \
-L$opalibdir $mpilibs $MPI_OTHERLIBS \
-L${DARSHAN_LIB_PATH} -ldarshan-posix -ldarshan-mpi-io -lz
else
$Show $FC "${allargs[@]}" -I$includedir $FFLAGS $LDFLAGS -L$libdir -L$opalibdir $mpilibs $MPI_OTHERLIBS
# Trial run to generate a symbol listing. We only enable Darshan if:
# a) MPI is used
# b) PMPI is _not_ used
#
# We want Darshan to get out of the way if the user is doing a runtime
# test in configure (in which case MPI objects break the executable) or
# if the user is using another PMPI based tool
stock_link_cmd="$FC ${allargs[@]} -I$includedir $FFLAGS $LDFLAGS -L$libdir -L$opalibdir $mpilibs $MPI_OTHERLIBS"
darshan_link_cmd="$FC ${CP_WRAPPERS} ${allargs[@]} -L${DARSHAN_LIB_PATH} ${CP_ZLIB_LINK_FLAGS} -lfmpich.cnk -ldarshan-posix -ldarshan-mpi-io -I$includedir $FFLAGS $LDFLAGS -L$libdir -L$opalibdir $mpilibs $MPI_OTHERLIBS -L${DARSHAN_LIB_PATH} -ldarshan-posix -ldarshan-mpi-io -lz"
used_darshan=0
# create a temporary file
tmpfile=`mktemp`
# generate a map of the symbol names
$stock_link_cmd -Wl,-Map,$tmpfile $LDFLAGS -o /dev/null >& /dev/null
# is MPI in there?
grep MPI $tmpfile >& /dev/null
rc_mpi=$?
# is PMPI in there (except for the mpich library itself)?
grep \(PMPI $tmpfile | grep -v mpich.cnk.a >& /dev/null
rc_pmpi=$?
rm $tmpfile >& /dev/null
# disable darshan if the executable is not an MPI program (this feature
# mainly allows runtime configure tests to work
if [ $rc_mpi -eq 0 ] ; then
# disable darshan if something else is already using PMPI; we don't
# want to cause any symbol conflicts
if [ $rc_pmpi -ne 0 ] ; then
$Show $darshan_link_cmd
used_darshan=1
fi
fi
# otherwise use the normal command line
if [ "$used_darshan" = "0" ] ; then
$Show $stock_link_cmd
fi
rc=$?
else
......
......@@ -299,21 +299,47 @@ if [ "$linking" = yes ] ; then
# Prepend the path for the shared libraries to the library list
mpilibs="$FC_LINKPATH_SHL$libdir $mpilibs"
fi
# check to see if the command line refers to any profilers that might
# use PMPI.
profiler_check=`echo "${allargs[@]}" | ${DARSHAN_BIN_PATH}/darshan-pmpi-filter.sh`
if [ "$profiler_check" = "" ] ; then
# If we link link darshan-mpi-io before system mpi lib, we don't
# get a trace but if we don't link it early enough, we get
# undefined MPI symbols. Seems like listing the darshan libs
# twice does the trick
$Show $FC ${CP_WRAPPERS} "${allargs[@]}" -L${DARSHAN_LIB_PATH} \
${CP_ZLIB_LINK_FLAGS} -lfmpich.cnk -ldarshan-posix -ldarshan-mpi-io \
-I$includedir $FFLAGS $LDFLAGS -L$libdir \
-L$opalibdir $mpilibs $MPI_OTHERLIBS \
-L${DARSHAN_LIB_PATH} -ldarshan-posix -ldarshan-mpi-io -lz
else
$Show $FC "${allargs[@]}" -I$includedir $FFLAGS $LDFLAGS -L$libdir -L$opalibdir $mpilibs $MPI_OTHERLIBS
# Trial run to generate a symbol listing. We only enable Darshan if:
# a) MPI is used
# b) PMPI is _not_ used
#
# We want Darshan to get out of the way if the user is doing a runtime
# test in configure (in which case MPI objects break the executable) or
# if the user is using another PMPI based tool
stock_link_cmd="$FC ${allargs[@]} -I$includedir $FFLAGS $LDFLAGS -L$libdir -L$opalibdir $mpilibs $MPI_OTHERLIBS"
darshan_link_cmd="$FC ${CP_WRAPPERS} ${allargs[@]} -L${DARSHAN_LIB_PATH} ${CP_ZLIB_LINK_FLAGS} -lfmpich.cnk -ldarshan-posix -ldarshan-mpi-io -I$includedir $FFLAGS $LDFLAGS -L$libdir -L$opalibdir $mpilibs $MPI_OTHERLIBS -L${DARSHAN_LIB_PATH} -ldarshan-posix -ldarshan-mpi-io -lz"
used_darshan=0
# create a temporary file
tmpfile=`mktemp`
# generate a map of the symbol names
$stock_link_cmd -Wl,-Map,$tmpfile $LDFLAGS -o /dev/null >& /dev/null
# is MPI in there?
grep MPI $tmpfile >& /dev/null
rc_mpi=$?
# is PMPI in there (except for the mpich library itself)?
grep \(PMPI $tmpfile | grep -v mpich.cnk.a >& /dev/null
rc_pmpi=$?
rm $tmpfile >& /dev/null
# disable darshan if the executable is not an MPI program (this feature
# mainly allows runtime configure tests to work
if [ $rc_mpi -eq 0 ] ; then
# disable darshan if something else is already using PMPI; we don't
# want to cause any symbol conflicts
if [ $rc_pmpi -ne 0 ] ; then
$Show $darshan_link_cmd
used_darshan=1
fi
fi
# otherwise use the normal command line
if [ "$used_darshan" = "0" ] ; then
$Show $stock_link_cmd
fi
rc=$?
else
......
......@@ -299,21 +299,47 @@ if [ "$linking" = yes ] ; then
# Prepend the path for the shared libraries to the library list
mpilibs="$FC_LINKPATH_SHL$libdir $mpilibs"
fi
# check to see if the command line refers to any profilers that might
# use PMPI.
profiler_check=`echo "${allargs[@]}" | ${DARSHAN_BIN_PATH}/darshan-pmpi-filter.sh`
if [ "$profiler_check" = "" ] ; then
# If we link link darshan-mpi-io before system mpi lib, we don't
# get a trace but if we don't link it early enough, we get
# undefined MPI symbols. Seems like listing the darshan libs
# twice does the trick
$Show $FC ${CP_WRAPPERS} "${allargs[@]}" -L${DARSHAN_LIB_PATH} \
${CP_ZLIB_LINK_FLAGS} -lfmpich.cnk -ldarshan-posix -ldarshan-mpi-io \
-I$includedir $FFLAGS $LDFLAGS -L$libdir \
-L$opalibdir $mpilibs $MPI_OTHERLIBS \
-L${DARSHAN_LIB_PATH} -ldarshan-posix -ldarshan-mpi-io -lz
else
$Show $FC "${allargs[@]}" -I$includedir $FFLAGS $LDFLAGS -L$libdir -L$opalibdir $mpilibs $MPI_OTHERLIBS
# Trial run to generate a symbol listing. We only enable Darshan if:
# a) MPI is used
# b) PMPI is _not_ used
#
# We want Darshan to get out of the way if the user is doing a runtime
# test in configure (in which case MPI objects break the executable) or
# if the user is using another PMPI based tool
stock_link_cmd="$FC ${allargs[@]} -I$includedir $FFLAGS $LDFLAGS -L$libdir -L$opalibdir $mpilibs $MPI_OTHERLIBS"
darshan_link_cmd="$FC ${CP_WRAPPERS} ${allargs[@]} -L${DARSHAN_LIB_PATH} ${CP_ZLIB_LINK_FLAGS} -lfmpich.cnk -ldarshan-posix -ldarshan-mpi-io -I$includedir $FFLAGS $LDFLAGS -L$libdir -L$opalibdir $mpilibs $MPI_OTHERLIBS -L${DARSHAN_LIB_PATH} -ldarshan-posix -ldarshan-mpi-io -lz"
used_darshan=0
# create a temporary file
tmpfile=`mktemp`
# generate a map of the symbol names
$stock_link_cmd -Wl,-Map,$tmpfile $LDFLAGS -o /dev/null >& /dev/null
# is MPI in there?
grep MPI $tmpfile >& /dev/null
rc_mpi=$?
# is PMPI in there (except for the mpich library itself)?
grep \(PMPI $tmpfile | grep -v mpich.cnk.a >& /dev/null
rc_pmpi=$?
rm $tmpfile >& /dev/null
# disable darshan if the executable is not an MPI program (this feature
# mainly allows runtime configure tests to work
if [ $rc_mpi -eq 0 ] ; then
# disable darshan if something else is already using PMPI; we don't
# want to cause any symbol conflicts
if [ $rc_pmpi -ne 0 ] ; then
$Show $darshan_link_cmd
used_darshan=1
fi
fi
# otherwise use the normal command line
if [ "$used_darshan" = "0" ] ; then
$Show $stock_link_cmd
fi
rc=$?
else
......
......@@ -299,21 +299,47 @@ if [ "$linking" = yes ] ; then
# Prepend the path for the shared libraries to the library list
mpilibs="$FC_LINKPATH_SHL$libdir $mpilibs"
fi
# check to see if the command line refers to any profilers that might
# use PMPI.
profiler_check=`echo "${allargs[@]}" | ${DARSHAN_BIN_PATH}/darshan-pmpi-filter.sh`
if [ "$profiler_check" = "" ] ; then
# If we link link darshan-mpi-io before system mpi lib, we don't
# get a trace but if we don't link it early enough, we get
# undefined MPI symbols. Seems like listing the darshan libs
# twice does the trick
$Show $FC ${CP_WRAPPERS} "${allargs[@]}" -L${DARSHAN_LIB_PATH} \
${CP_ZLIB_LINK_FLAGS} -lfmpich.cnk -ldarshan-posix -ldarshan-mpi-io \
-I$includedir $FFLAGS $LDFLAGS -L$libdir \
-L$opalibdir $mpilibs $MPI_OTHERLIBS \
-L${DARSHAN_LIB_PATH} -ldarshan-posix -ldarshan-mpi-io -lz
else
$Show $FC "${allargs[@]}" -I$includedir $FFLAGS $LDFLAGS -L$libdir -L$opalibdir $mpilibs $MPI_OTHERLIBS
# Trial run to generate a symbol listing. We only enable Darshan if:
# a) MPI is used
# b) PMPI is _not_ used
#
# We want Darshan to get out of the way if the user is doing a runtime
# test in configure (in which case MPI objects break the executable) or
# if the user is using another PMPI based tool
stock_link_cmd="$FC ${allargs[@]} -I$includedir $FFLAGS $LDFLAGS -L$libdir -L$opalibdir $mpilibs $MPI_OTHERLIBS"
darshan_link_cmd="$FC ${CP_WRAPPERS} ${allargs[@]} -L${DARSHAN_LIB_PATH} ${CP_ZLIB_LINK_FLAGS} -lfmpich.cnk -ldarshan-posix -ldarshan-mpi-io -I$includedir $FFLAGS $LDFLAGS -L$libdir -L$opalibdir $mpilibs $MPI_OTHERLIBS -L${DARSHAN_LIB_PATH} -ldarshan-posix -ldarshan-mpi-io -lz"
used_darshan=0
# create a temporary file
tmpfile=`mktemp`
# generate a map of the symbol names
$stock_link_cmd -Wl,-Map,$tmpfile $LDFLAGS -o /dev/null >& /dev/null
# is MPI in there?
grep MPI $tmpfile >& /dev/null
rc_mpi=$?
# is PMPI in there (except for the mpich library itself)?
grep \(PMPI $tmpfile | grep -v mpich.cnk.a >& /dev/null
rc_pmpi=$?
rm $tmpfile >& /dev/null
# disable darshan if the executable is not an MPI program (this feature
# mainly allows runtime configure tests to work
if [ $rc_mpi -eq 0 ] ; then
# disable darshan if something else is already using PMPI; we don't
# want to cause any symbol conflicts
if [ $rc_pmpi -ne 0 ] ; then
$Show $darshan_link_cmd
used_darshan=1
fi
fi
# otherwise use the normal command line
if [ "$used_darshan" = "0" ] ; then
$Show $stock_link_cmd
fi
rc=$?
else
......
......@@ -299,21 +299,47 @@ if [ "$linking" = yes ] ; then
# Prepend the path for the shared libraries to the library list
mpilibs="$FC_LINKPATH_SHL$libdir $mpilibs"
fi
# check to see if the command line refers to any profilers that might
# use PMPI.
profiler_check=`echo "${allargs[@]}" | ${DARSHAN_BIN_PATH}/darshan-pmpi-filter.sh`
if [ "$profiler_check" = "" ] ; then
# If we link link darshan-mpi-io before system mpi lib, we don't
# get a trace but if we don't link it early enough, we get
# undefined MPI symbols. Seems like listing the darshan libs
# twice does the trick
$Show $FC ${CP_WRAPPERS} "${allargs[@]}" -L${DARSHAN_LIB_PATH} \
${CP_ZLIB_LINK_FLAGS} -lfmpich.cnk -ldarshan-posix -ldarshan-mpi-io \
-I$includedir $FFLAGS $LDFLAGS -L$libdir \
-L$opalibdir $mpilibs $MPI_OTHERLIBS \
-L${DARSHAN_LIB_PATH} -ldarshan-posix -ldarshan-mpi-io -lz
else
$Show $FC "${allargs[@]}" -I$includedir $FFLAGS $LDFLAGS -L$libdir -L$opalibdir $mpilibs $MPI_OTHERLIBS
# Trial run to generate a symbol listing. We only enable Darshan if:
# a) MPI is used
# b) PMPI is _not_ used
#
# We want Darshan to get out of the way if the user is doing a runtime
# test in configure (in which case MPI objects break the executable) or
# if the user is using another PMPI based tool
stock_link_cmd="$FC ${allargs[@]} -I$includedir $FFLAGS $LDFLAGS -L$libdir -L$opalibdir $mpilibs $MPI_OTHERLIBS"
darshan_link_cmd="$FC ${CP_WRAPPERS} ${allargs[@]} -L${DARSHAN_LIB_PATH} ${CP_ZLIB_LINK_FLAGS} -lfmpich.cnk -ldarshan-posix -ldarshan-mpi-io -I$includedir $FFLAGS $LDFLAGS -L$libdir -L$opalibdir $mpilibs $MPI_OTHERLIBS -L${DARSHAN_LIB_PATH} -ldarshan-posix -ldarshan-mpi-io -lz"
used_darshan=0
# create a temporary file
tmpfile=`mktemp`
# generate a map of the symbol names
$stock_link_cmd -Wl,-Map,$tmpfile $LDFLAGS -o /dev/null >& /dev/null
# is MPI in there?
grep MPI $tmpfile >& /dev/null
rc_mpi=$?
# is PMPI in there (except for the mpich library itself)?
grep \(PMPI $tmpfile | grep -v mpich.cnk.a >& /dev/null
rc_pmpi=$?
rm $tmpfile >& /dev/null
# disable darshan if the executable is not an MPI program (this feature
# mainly allows runtime configure tests to work
if [ $rc_mpi -eq 0 ] ; then
# disable darshan if something else is already using PMPI; we don't
# want to cause any symbol conflicts
if [ $rc_pmpi -ne 0 ] ; then
$Show $darshan_link_cmd
used_darshan=1
fi
fi
# otherwise use the normal command line
if [ "$used_darshan" = "0" ] ; then
$Show $stock_link_cmd
fi
rc=$?
else
......
......@@ -299,21 +299,47 @@ if [ "$linking" = yes ] ; then
# Prepend the path for the shared libraries to the library list
mpilibs="$FC_LINKPATH_SHL$libdir $mpilibs"
fi
# check to see if the command line refers to any profilers that might
# use PMPI.
profiler_check=`echo "${allargs[@]}" | ${DARSHAN_BIN_PATH}/darshan-pmpi-filter.sh`
if [ "$profiler_check" = "" ] ; then
# If we link link darshan-mpi-io before system mpi lib, we don't
# get a trace but if we don't link it early enough, we get
# undefined MPI symbols. Seems like listing the darshan libs
# twice does the trick
$Show $FC ${CP_WRAPPERS} "${allargs[@]}" -L${DARSHAN_LIB_PATH} \
${CP_ZLIB_LINK_FLAGS} -lfmpich.cnk -ldarshan-posix -ldarshan-mpi-io \
-I$includedir $FFLAGS $LDFLAGS -L$libdir \
-L$opalibdir $mpilibs $MPI_OTHERLIBS \
-L${DARSHAN_LIB_PATH} -ldarshan-posix -ldarshan-mpi-io -lz
else
$Show $FC "${allargs[@]}" -I$includedir $FFLAGS $LDFLAGS -L$libdir -L$opalibdir $mpilibs $MPI_OTHERLIBS
# Trial run to generate a symbol listing. We only enable Darshan if:
# a) MPI is used
# b) PMPI is _not_ used
#
# We want Darshan to get out of the way if the user is doing a runtime
# test in configure (in which case MPI objects break the executable) or
# if the user is using another PMPI based tool
stock_link_cmd="$FC ${allargs[@]} -I$includedir $FFLAGS $LDFLAGS -L$libdir -L$opalibdir $mpilibs $MPI_OTHERLIBS"
darshan_link_cmd="$FC ${CP_WRAPPERS} ${allargs[@]} -L${DARSHAN_LIB_PATH} ${CP_ZLIB_LINK_FLAGS} -lfmpich.cnk -ldarshan-posix -ldarshan-mpi-io -I$includedir $FFLAGS $LDFLAGS -L$libdir -L$opalibdir $mpilibs $MPI_OTHERLIBS -L${DARSHAN_LIB_PATH} -ldarshan-posix -ldarshan-mpi-io -lz"
used_darshan=0
# create a temporary file
tmpfile=`mktemp`
# generate a map of the symbol names
$stock_link_cmd -Wl,-Map,$tmpfile $LDFLAGS -o /dev/null >& /dev/null
# is MPI in there?
grep MPI $tmpfile >& /dev/null
rc_mpi=$?
# is PMPI in there (except for the mpich library itself)?
grep \(PMPI $tmpfile | grep -v mpich.cnk.a >& /dev/null
rc_pmpi=$?
rm $tmpfile >& /dev/null
# disable darshan if the executable is not an MPI program (this feature
# mainly allows runtime configure tests to work
if [ $rc_mpi -eq 0 ] ; then
# disable darshan if something else is already using PMPI; we don't
# want to cause any symbol conflicts
if [ $rc_pmpi -ne 0 ] ; then
$Show $darshan_link_cmd
used_darshan=1
fi
fi
# otherwise use the normal command line
if [ "$used_darshan" = "0" ] ; then
$Show $stock_link_cmd
fi
rc=$?
else
......
......@@ -299,21 +299,47 @@ if [ "$linking" = yes ] ; then
# Prepend the path for the shared libraries to the library list
mpilibs="$FC_LINKPATH_SHL$libdir $mpilibs"
fi
# check to see if the command line refers to any profilers that might
# use PMPI.
profiler_check=`echo "${allargs[@]}" | ${DARSHAN_BIN_PATH}/darshan-pmpi-filter.sh`
if [ "$profiler_check" = "" ] ; then
# If we link link darshan-mpi-io before system mpi lib, we don't
# get a trace but if we don't link it early enough, we get
# undefined MPI symbols. Seems like listing the darshan libs
# twice does the trick
$Show $FC ${CP_WRAPPERS} "${allargs[@]}" -L${DARSHAN_LIB_PATH} \
${CP_ZLIB_LINK_FLAGS} -lfmpich.cnk -ldarshan-posix -ldarshan-mpi-io \
-I$includedir $FFLAGS $LDFLAGS -L$libdir \
-L$opalibdir $mpilibs $MPI_OTHERLIBS \
-L${DARSHAN_LIB_PATH} -ldarshan-posix -ldarshan-mpi-io -lz
else
$Show $FC "${allargs[@]}" -I$includedir $FFLAGS $LDFLAGS -L$libdir -L$opalibdir $mpilibs $MPI_OTHERLIBS
# Trial run to generate a symbol listing. We only enable Darshan if:
# a) MPI is used
# b) PMPI is _not_ used
#
# We want Darshan to get out of the way if the user is doing a runtime
# test in configure (in which case MPI objects break the executable) or
# if the user is using another PMPI based tool
stock_link_cmd="$FC ${allargs[@]} -I$includedir $FFLAGS $LDFLAGS -L$libdir -L$opalibdir $mpilibs $MPI_OTHERLIBS"
darshan_link_cmd="$FC ${CP_WRAPPERS} ${allargs[@]} -L${DARSHAN_LIB_PATH} ${CP_ZLIB_LINK_FLAGS} -lfmpich.cnk -ldarshan-posix -ldarshan-mpi-io -I$includedir $FFLAGS $LDFLAGS -L$libdir -L$opalibdir $mpilibs $MPI_OTHERLIBS -L${DARSHAN_LIB_PATH} -ldarshan-posix -ldarshan-mpi-io -lz"
used_darshan=0
# create a temporary file
tmpfile=`mktemp`
# generate a map of the symbol names
$stock_link_cmd -Wl,-Map,$tmpfile $LDFLAGS -o /dev/null >& /dev/null
# is MPI in there?
grep MPI $tmpfile >& /dev/null
rc_mpi=$?
# is PMPI in there (except for the mpich library itself)?
grep \(PMPI $tmpfile | grep -v mpich.cnk.a >& /dev/null
rc_pmpi=$?
rm $tmpfile >& /dev/null
# disable darshan if the executable is not an MPI program (this feature
# mainly allows runtime configure tests to work
if [ $rc_mpi -eq 0 ] ; then
# disable darshan if something else is already using PMPI; we don't
# want to cause any symbol conflicts
if [ $rc_pmpi -ne 0 ] ; then
$Show $darshan_link_cmd
used_darshan=1
fi
fi
# otherwise use the normal command line
if [ "$used_darshan" = "0" ] ; then
$Show $stock_link_cmd
fi
rc=$?
else
......
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