Commit f72ff8d6 authored by Philip Carns's avatar Philip Carns

updated script, needs testing

git-svn-id: 3b7491f3-a168-0410-bf4b-c445ed680a29
parent f3e19641
...@@ -12,7 +12,6 @@ use English; ...@@ -12,7 +12,6 @@ use English;
$DARSHAN_LIB_PATH="@darshan_lib_path@"; $DARSHAN_LIB_PATH="@darshan_lib_path@";
my $input_file = ""; my $input_file = "";
...@@ -94,15 +93,46 @@ if [ "$linking" = yes ] ; then ...@@ -94,15 +93,46 @@ if [ "$linking" = yes ] ; then
# prepend the path for the shared libraries to the library list # prepend the path for the shared libraries to the library list
mpilibs="$C_LINKPATH_SHL$libdir $mpilibs" mpilibs="$C_LINKPATH_SHL$libdir $mpilibs"
fi fi
# check to see if the command line refers to any profilers that might
# use PMPI.
print OUTPUT <<EOF; print OUTPUT <<EOF;
profiler_check=`echo "\$\{allargs\[\@\]\}" | $DARSHAN_BIN_PATH/` # Trial run to generate a symbol listing. We only enable Darshan if:
if [ "\$profiler_check" = "" ] ; then # a) MPI is used
\$Show $link_cmd # b) PMPI is _not_ used
else #
\$Show $base_link_cmd # 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
# create a temporary file
# generate a map of the symbol names
# don't use -shared for this step
stock_link_cmd_no_shared=`echo \$base_link_cmd | sed 's/ -shared / /g'`
\$stock_link_cmd_no_shared -Wl,-Map,\$tmpfile \$LDFLAGS -o /dev/null >& /dev/null
# is MPI in there?
grep MPI \$tmpfile >& /dev/null
# is PMPI in there (except for the mpich library itself)?
grep \\(PMPI \$tmpfile | grep -v mpich.cnk.a >& /dev/null
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 \$link_cmd
# otherwise use the normal command line
if [ "\$used_darshan" = "0" ] ; then
\$Show \$base_link_cmd
fi fi
rc=\$? rc=\$?
else 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