diff --git a/compilers/mpicc-trace-bgp-V1R4.in b/compilers/mpicc-trace-bgp-V1R4.in index e7c414e9f35991a87c51bcf5541ce29cd0c77482..464cf4b6f8fdaf49731795d67fc3596e5834a5f3 100755 --- a/compilers/mpicc-trace-bgp-V1R4.in +++ b/compilers/mpicc-trace-bgp-V1R4.in @@ -251,7 +251,19 @@ if [ "$linking" = yes ] ; then # prepend the path for the shared libraries to the library list mpilibs="$C_LINKPATH_SHL$libdir $mpilibs" fi - $Show $CC "${allargs[@]}" -I$includedir $CFLAGS $LDFLAGS -L$libdir -L$opalibdir $mpilibs $MPI_OTHERLIBS + # 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 + $Show $CC "${allargs[@]}" -L${DARSHAN_LIB_PATH} \ + ${CP_ZLIB_LINK_FLAGS} -ldarshan-mpi-io -lz -I$includedir $CFLAGS \ + ${CP_WRAPPERS} $LDFLAGS -L$libdir -L$opalibdir $mpilibs \ + $MPI_OTHERLIBS -L${DARSHAN_LIB_PATH} -ldarshan-posix + else + # it looks like the user wants to use another tool with PMPI; don't + # link in Darshan PMPI wrappers (disables Darshan) + $Show $CC "${allargs[@]}" -I$includedir $CFLAGS $LDFLAGS -L$libdir -L$opalibdir $mpilibs $MPI_OTHERLIBS + fi rc=$? else $Show $CC "${allargs[@]}" -I$includedir $CFLAGS diff --git a/compilers/mpicxx-trace-bgp-V1R4.in b/compilers/mpicxx-trace-bgp-V1R4.in index a6ee769c30a327326555bc42127cad7fc661a4a6..e1d11998910fde8317af49896e6b8e893f3fee6c 100755 --- a/compilers/mpicxx-trace-bgp-V1R4.in +++ b/compilers/mpicxx-trace-bgp-V1R4.in @@ -251,7 +251,19 @@ if [ "$linking" = yes ] ; then # Prepend the path for the shared libraries to the library list shllibpath="$CXX_LINKPATH_SHL$libdir" fi - $Show $CXX "${allargs[@]}" -I$includedir $CXXFLAGS $LDFLAGS -L$libdir -L$opalibdir $shllibpath $cxxlibs $mpilibs $MPI_OTHERLIBS + # 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 + $Show $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 + else + # it looks like the user wants to use another tool with PMPI; don't + # link in Darshan PMPI wrappers (disables Darshan) + $Show $CXX "${allargs[@]}" -I$includedir $CXXFLAGS $LDFLAGS -L$libdir -L$opalibdir $shllibpath $cxxlibs $mpilibs $MPI_OTHERLIBS + fi rc=$? else $Show $CXX "${allargs[@]}" -I$includedir $CXXFLAGS diff --git a/compilers/mpixlc-trace-bgp-V1R4.in b/compilers/mpixlc-trace-bgp-V1R4.in index c66dd390c4767ef47479029af527d76ae4779d12..406810e44184be783fd678c836a55ef8f68abb1c 100755 --- a/compilers/mpixlc-trace-bgp-V1R4.in +++ b/compilers/mpixlc-trace-bgp-V1R4.in @@ -251,7 +251,19 @@ if [ "$linking" = yes ] ; then # prepend the path for the shared libraries to the library list mpilibs="$C_LINKPATH_SHL$libdir $mpilibs" fi - $Show $CC "${allargs[@]}" -I$includedir $CFLAGS $LDFLAGS -L$libdir -L$opalibdir $mpilibs $MPI_OTHERLIBS + # 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 + $Show $CC "${allargs[@]}" -L${DARSHAN_LIB_PATH} \ + ${CP_ZLIB_LINK_FLAGS} -ldarshan-mpi-io -lz -I$includedir $CFLAGS \ + ${CP_WRAPPERS} $LDFLAGS -L$libdir -L$opalibdir $mpilibs \ + $MPI_OTHERLIBS -L${DARSHAN_LIB_PATH} -ldarshan-posix + else + # it looks like the user wants to use another tool with PMPI; don't + # link in Darshan PMPI wrappers (disables Darshan) + $Show $CC "${allargs[@]}" -I$includedir $CFLAGS $LDFLAGS -L$libdir -L$opalibdir $mpilibs $MPI_OTHERLIBS + fi rc=$? else $Show $CC "${allargs[@]}" -I$includedir $CFLAGS diff --git a/compilers/mpixlc_r-trace-bgp-V1R4.in b/compilers/mpixlc_r-trace-bgp-V1R4.in index a78e6682c2c786a31b30959eab614ebdeef754dd..bce83147abcc74b82a9b8542fd33abbc9596d560 100755 --- a/compilers/mpixlc_r-trace-bgp-V1R4.in +++ b/compilers/mpixlc_r-trace-bgp-V1R4.in @@ -251,7 +251,19 @@ if [ "$linking" = yes ] ; then # prepend the path for the shared libraries to the library list mpilibs="$C_LINKPATH_SHL$libdir $mpilibs" fi - $Show $CC "${allargs[@]}" -I$includedir $CFLAGS $LDFLAGS -L$libdir -L$opalibdir $mpilibs $MPI_OTHERLIBS + # 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 + $Show $CC "${allargs[@]}" -L${DARSHAN_LIB_PATH} \ + ${CP_ZLIB_LINK_FLAGS} -ldarshan-mpi-io -lz -I$includedir $CFLAGS \ + ${CP_WRAPPERS} $LDFLAGS -L$libdir -L$opalibdir $mpilibs \ + $MPI_OTHERLIBS -L${DARSHAN_LIB_PATH} -ldarshan-posix + else + # it looks like the user wants to use another tool with PMPI; don't + # link in Darshan PMPI wrappers (disables Darshan) + $Show $CC "${allargs[@]}" -I$includedir $CFLAGS $LDFLAGS -L$libdir -L$opalibdir $mpilibs $MPI_OTHERLIBS + fi rc=$? else $Show $CC "${allargs[@]}" -I$includedir $CFLAGS diff --git a/compilers/mpixlcxx-trace-bgp-V1R4.in b/compilers/mpixlcxx-trace-bgp-V1R4.in index 1d0a7ba04d8b0bcea19175a948f4aadcfb31d68a..7aebf82e0db1a9f28032434b34cb75bd0a8677bc 100755 --- a/compilers/mpixlcxx-trace-bgp-V1R4.in +++ b/compilers/mpixlcxx-trace-bgp-V1R4.in @@ -251,7 +251,19 @@ if [ "$linking" = yes ] ; then # Prepend the path for the shared libraries to the library list shllibpath="$CXX_LINKPATH_SHL$libdir" fi - $Show $CXX "${allargs[@]}" -I$includedir $CXXFLAGS $LDFLAGS -L$libdir -L$opalibdir $shllibpath $cxxlibs $mpilibs $MPI_OTHERLIBS + # 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 + $Show $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 + else + # it looks like the user wants to use another tool with PMPI; don't + # link in Darshan PMPI wrappers (disables Darshan) + $Show $CXX "${allargs[@]}" -I$includedir $CXXFLAGS $LDFLAGS -L$libdir -L$opalibdir $shllibpath $cxxlibs $mpilibs $MPI_OTHERLIBS + fi rc=$? else $Show $CXX "${allargs[@]}" -I$includedir $CXXFLAGS diff --git a/compilers/mpixlcxx_r-trace-bgp-V1R4.in b/compilers/mpixlcxx_r-trace-bgp-V1R4.in index 319d7e21f1bcf81044933f1e563614de69e58bd2..5ea0b2d17ac3aa7656f038747116eb8e052cbdf7 100755 --- a/compilers/mpixlcxx_r-trace-bgp-V1R4.in +++ b/compilers/mpixlcxx_r-trace-bgp-V1R4.in @@ -251,7 +251,19 @@ if [ "$linking" = yes ] ; then # Prepend the path for the shared libraries to the library list shllibpath="$CXX_LINKPATH_SHL$libdir" fi - $Show $CXX "${allargs[@]}" -I$includedir $CXXFLAGS $LDFLAGS -L$libdir -L$opalibdir $shllibpath $cxxlibs $mpilibs $MPI_OTHERLIBS + # 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 + $Show $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 + else + # it looks like the user wants to use another tool with PMPI; don't + # link in Darshan PMPI wrappers (disables Darshan) + $Show $CXX "${allargs[@]}" -I$includedir $CXXFLAGS $LDFLAGS -L$libdir -L$opalibdir $shllibpath $cxxlibs $mpilibs $MPI_OTHERLIBS + fi rc=$? else $Show $CXX "${allargs[@]}" -I$includedir $CXXFLAGS