diff --git a/darshan-runtime/share/mpi-profile/darshan-bg-cxx.conf.in b/darshan-runtime/share/mpi-profile/darshan-bg-cxx.conf.in index ac56b4839bc56fc9b22d7af7390737fd05172de6..2e3b9a4076e57849674a3f5311e45209fb28386f 100644 --- a/darshan-runtime/share/mpi-profile/darshan-bg-cxx.conf.in +++ b/darshan-runtime/share/mpi-profile/darshan-bg-cxx.conf.in @@ -13,16 +13,16 @@ dyncheck2=$? echo "${allargs[@]}" | grep "\\-dynamic" >& /dev/null dyncheck3=$? -# try to detect name of libmpichcxx library needed for pmpi -# - these may be named with different suffixes to match the compiler version -D_MPI_PRELIB=`echo $LIBS |grep "\-lmpichcxx\-\\S\+" -o` - # Skip profiling if we know that dynamic linking is in use. See LD_PRELOAD # method instead. if [ "$dyncheck1" -ne 0 -a "$dyncheck2" -ne 0 -a "$dyncheck3" -ne 0 ]; then + # NOTE: there is something fragile here. We are relying on the BG mpicxx script to set a + # variable called $cxxlibs to the name of the libmpichcxx variant that we need in order + # to intercept pmpi calls + # Libraries (and paths) to include before the MPI library - export PROFILE_PRELIB="$D_MPI_PRELIB `$DARSHAN_PREFIX/bin/darshan-config --pre-ld-flags`" + export PROFILE_PRELIB="$cxxlibs `$DARSHAN_PREFIX/bin/darshan-config --pre-ld-flags`" # Libraries to include after the MPI library export PROFILE_POSTLIB=`$DARSHAN_PREFIX/bin/darshan-config --post-ld-flags`