Commit b1391198 authored by Kevin Harms's avatar Kevin Harms
Browse files

fixes 106; Add test to see that MPI_Init is weak linked. This solves an issue...

fixes 106; Add test to see that MPI_Init is weak linked. This solves an issue with people using a fake MPI for various reasons

git-svn-id: https://svn.mcs.anl.gov/repos/darshan/trunk@704 3b7491f3-a168-0410-bf4b-c445ed680a29
parent 66f6dcee
...@@ -245,6 +245,7 @@ print OUTPUT<<"EOF"; ...@@ -245,6 +245,7 @@ print OUTPUT<<"EOF";
# create a temporary file # create a temporary file
tmpfile=`mktemp` tmpfile=`mktemp`
binfile=`mktemp`
# generate a map of the symbol names # generate a map of the symbol names
# don't use -shared for this step # don't use -shared for this step
argno=0 argno=0
...@@ -255,7 +256,7 @@ print OUTPUT<<"EOF"; ...@@ -255,7 +256,7 @@ print OUTPUT<<"EOF";
fi fi
argno=`expr \$argno + 1` argno=`expr \$argno + 1`
done done
\$CC $link_cmd_prefix $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 \$binfile >& /dev/null
# is MPI in there? # is MPI in there?
grep MPI \$tmpfile >& /dev/null grep MPI \$tmpfile >& /dev/null
...@@ -265,12 +266,23 @@ print OUTPUT<<"EOF"; ...@@ -265,12 +266,23 @@ print OUTPUT<<"EOF";
rc_pmpi=\$? rc_pmpi=\$?
rm \$tmpfile >& /dev/null rm \$tmpfile >& /dev/null
# is MPI_Init a weak symbol?
# disable darshan if it is not
if [ -e \$binfile ];
then
nm \$binfile | grep -i "mpi_init" | grep -i "w" >& /dev/null
rc_weak=\$?
else
rc_weak=1
fi
rm \$binfile >& /dev/null
# disable darshan if the executable is not an MPI program (this feature # disable darshan if the executable is not an MPI program (this feature
# mainly allows runtime configure tests to work # mainly allows runtime configure tests to work
if [ \$rc_mpi -eq 0 ] ; then if [ \$rc_mpi -eq 0 ] ; then
# disable darshan if something else is already using PMPI; we don't # disable darshan if something else is already using PMPI; we don't
# want to cause any symbol conflicts # want to cause any symbol conflicts
if [ \$rc_pmpi -ne 0 ] && [ \$compiler_check -eq 0 ]; then if [ \$rc_pmpi -ne 0 ] && [ \$compiler_check -eq 0 ] && [ \$rc_weak -eq 0 ]; then
\$Show \$CC $link_cmd_prefix $link_cmd_suffix \$Show \$CC $link_cmd_prefix $link_cmd_suffix
used_darshan=1 used_darshan=1
fi fi
......
...@@ -246,6 +246,7 @@ print OUTPUT<<"EOF"; ...@@ -246,6 +246,7 @@ print OUTPUT<<"EOF";
# create a temporary file # create a temporary file
tmpfile=`mktemp` tmpfile=`mktemp`
binfile=`mktemp`
# generate a map of the symbol names # generate a map of the symbol names
# don't use -shared for this step # don't use -shared for this step
argno=0 argno=0
...@@ -256,7 +257,7 @@ print OUTPUT<<"EOF"; ...@@ -256,7 +257,7 @@ print OUTPUT<<"EOF";
fi fi
argno=`expr \$argno + 1` argno=`expr \$argno + 1`
done done
\$CXX $link_cmd_prefix $link_cmd_no_shared_suffix -Wl,-Map,\$tmpfile \$LDFLAGS -o /dev/null >& /dev/null \$CXX $link_cmd_prefix $link_cmd_no_shared_suffix -Wl,-Map,\$tmpfile \$LDFLAGS -o \$binfile >& /dev/null
# is MPI in there? # is MPI in there?
grep MPI \$tmpfile >& /dev/null grep MPI \$tmpfile >& /dev/null
...@@ -280,12 +281,23 @@ print OUTPUT<<"EOF"; ...@@ -280,12 +281,23 @@ print OUTPUT<<"EOF";
rm \$tmpfile >& /dev/null rm \$tmpfile >& /dev/null
# is MPI_Init a weak symbol?
# disable darshan if it is not
if [ -e \$binfile ];
then
nm \$binfile | grep -i "mpi_init" | grep -i "w" >& /dev/null
rc_weak=\$?
else
rc_weak=1
fi
rm \$binfile >& /dev/null
# disable darshan if the executable is not an MPI program (this feature # disable darshan if the executable is not an MPI program (this feature
# mainly allows runtime configure tests to work # mainly allows runtime configure tests to work
if [ \$rc_mpi -eq 0 ] ; then if [ \$rc_mpi -eq 0 ] ; then
# disable darshan if something else is already using PMPI; we don't # disable darshan if something else is already using PMPI; we don't
# want to cause any symbol conflicts # want to cause any symbol conflicts
if [ \$rc_pmpi -ne 0 ] && [ \$compiler_check -eq 0 ]; then if [ \$rc_pmpi -ne 0 ] && [ \$compiler_check -eq 0 ] && [ \$rc_weak -eq 0 ]; then
\$Show \$CXX $link_cmd_prefix $link_cmd_suffix \$Show \$CXX $link_cmd_prefix $link_cmd_suffix
used_darshan=1 used_darshan=1
fi fi
......
...@@ -254,6 +254,7 @@ print OUTPUT<<"EOF"; ...@@ -254,6 +254,7 @@ print OUTPUT<<"EOF";
# create a temporary file # create a temporary file
tmpfile=`mktemp` tmpfile=`mktemp`
binfile=`mktemp`
# generate a map of the symbol names # generate a map of the symbol names
# don't use -shared for this step # don't use -shared for this step
argno=0 argno=0
...@@ -264,7 +265,7 @@ print OUTPUT<<"EOF"; ...@@ -264,7 +265,7 @@ print OUTPUT<<"EOF";
fi fi
argno=`expr \$argno + 1` argno=`expr \$argno + 1`
done done
\$FC $link_cmd_prefix $link_cmd_no_shared_suffix -Wl,-Map,\$tmpfile \$LDFLAGS -o /dev/null >& /dev/null \$FC $link_cmd_prefix $link_cmd_no_shared_suffix -Wl,-Map,\$tmpfile \$LDFLAGS -o \$binfile >& /dev/null
# is MPI in there? # is MPI in there?
grep -i MPI \$tmpfile >& /dev/null grep -i MPI \$tmpfile >& /dev/null
...@@ -285,12 +286,23 @@ print OUTPUT<<"EOF"; ...@@ -285,12 +286,23 @@ print OUTPUT<<"EOF";
rm \$tmpfile >& /dev/null rm \$tmpfile >& /dev/null
# is MPI_Init a weak symbol?
# disable darshan if it is not
if [ -e \$binfile ];
then
nm \$binfile | grep -i "mpi_init" | grep -i "w" >& /dev/null
rc_weak=\$?
else
rc_weak=1
fi
rm \$binfile >& /dev/null
# disable darshan if the executable is not an MPI program (this feature # disable darshan if the executable is not an MPI program (this feature
# mainly allows runtime configure tests to work # mainly allows runtime configure tests to work
if [ \$rc_mpi -eq 0 ] ; then if [ \$rc_mpi -eq 0 ] ; then
# disable darshan if something else is already using PMPI; we don't # disable darshan if something else is already using PMPI; we don't
# want to cause any symbol conflicts # want to cause any symbol conflicts
if [ \$rc_pmpi -ne 0 ] && [ \$compiler_check -eq 0 ]; then if [ \$rc_pmpi -ne 0 ] && [ \$compiler_check -eq 0 ] && [ \$rc_weak -eq 0 ]; then
\$Show \$FC $link_cmd_prefix $link_cmd_suffix \$Show \$FC $link_cmd_prefix $link_cmd_suffix
used_darshan=1 used_darshan=1
fi 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