Commit d3424981 authored by Philip Carns's avatar Philip Carns

experimental fix for mvapich2 on ranger/tacc


git-svn-id: https://svn.mcs.anl.gov/repos/darshan/trunk@636 3b7491f3-a168-0410-bf4b-c445ed680a29
parent e7187268
......@@ -74,23 +74,25 @@ open (OUTPUT, ">$output_file") || die("Error opening output file: $!");
# part before the "foo.o -o foo", which is assumed to be CC, and the part
# that comes afterwards, which is assumed to be the required link flags and
# libraries.
if(!($link_cmd =~ /(.+)\s+(foo.o -o foo)\s+(.*)/))
if(!($link_cmd =~ /(\S+)(.+)(foo.o -o foo)\s+(.*)/))
{
printf STDERR "Error: improperly formatted link cmd: $link_cmd\n";
exit(1);
}
$CC_from_link=$1;
$base_link_cmd_suffix="\"\$\{allargs\[\@\]\}\" $3";
$link_cmd_suffix="\"\$\{newallargs\[\@\]\}\" `$PREFIX/bin/darshan-config --pre-ld-flags` $3 `$PREFIX/bin/darshan-config --post-ld-flags`";
$link_cmd_prefix=$2;
$base_link_cmd_suffix="\"\$\{allargs\[\@\]\}\" $4";
$link_cmd_suffix="\"\$\{newallargs\[\@\]\}\" `$PREFIX/bin/darshan-config --pre-ld-flags` $4 `$PREFIX/bin/darshan-config --post-ld-flags`";
# repeat the above step for the compilation command line
if(!($compile_cmd =~ /(.+)\s+(-c foo.c)\s+(.*)/))
if(!($compile_cmd =~ /(\S+)(.+)(-c foo.c)\s+(.*)/))
{
printf STDERR "Error: improperly formatted compile cmd: $compile_cmd\n";
exit(1);
}
$CC_from_compile=$1;
$compile_cmd_suffix="\"\$\{allargs\[\@\]\}\" $3";
$compile_cmd_prefix=$2;
$compile_cmd_suffix="\"\$\{allargs\[\@\]\}\" $4";
# we expect to see the same CC command in both the link and compile steps
if($CC_from_link ne $CC_from_compile)
......@@ -252,7 +254,7 @@ print OUTPUT<<"EOF";
fi
argno=`expr \$argno + 1`
done
\$CC $link_cmd_no_shared_suffix -Wl,-Map,\$tmpfile \$LDFLAGS -o /dev/null >& /dev/null
\$CC $link_cmd_prefix $link_cmd_no_shared_suffix -Wl,-Map,\$tmpfile \$LDFLAGS -o /dev/null >& /dev/null
# is MPI in there?
grep MPI \$tmpfile >& /dev/null
......@@ -268,18 +270,18 @@ print OUTPUT<<"EOF";
# disable darshan if something else is already using PMPI; we don't
# want to cause any symbol conflicts
if [ \$rc_pmpi -ne 0 ] && [ \$compiler_check -eq 0 ]; then
\$Show \$CC $link_cmd_suffix
\$Show \$CC $link_cmd_prefix $link_cmd_suffix
used_darshan=1
fi
fi
# otherwise use the normal command line
if [ "\$used_darshan" = "0" ] ; then
\$Show \$CC $base_link_cmd_suffix
\$Show \$CC $link_cmd_prefix $base_link_cmd_suffix
fi
rc=\$?
else
\$Show \$CC $compile_cmd_suffix
\$Show \$CC $compile_cmd_prefix $compile_cmd_suffix
rc=\$?
fi
......
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