diff --git a/darshan-runtime/darshan-gen-cc.pl.in b/darshan-runtime/darshan-gen-cc.pl.in index 9b298eeb09419800fe2e6b77eb8adf308d82b680..3bf34dfb64f4880fa0839db6dda3b2200cb0c258 100644 --- a/darshan-runtime/darshan-gen-cc.pl.in +++ b/darshan-runtime/darshan-gen-cc.pl.in @@ -10,9 +10,7 @@ use Getopt::Long; use English; -$CP_WRAPPERS="@CP_WRAPPERS@"; -$DARSHAN_LIB_PATH="@darshan_lib_path@"; -$DARSHAN_LD_FLAGS="@LDFLAGS@"; +my $PREFIX="@prefix@"; my $input_file = ""; my $output_file = ""; @@ -83,7 +81,7 @@ if(!($link_cmd =~ /(.+)\s+(foo.o -o foo)\s+(.*)/)) } $CC_from_link=$1; $base_link_cmd_suffix="\"\$\{allargs\[\@\]\}\" $3"; -$link_cmd_suffix="\"\$\{newallargs\[\@\]\}\" -L$DARSHAN_LIB_PATH $DARSHAN_LD_FLAGS -ldarshan-mpi-io -lz $CP_WRAPPERS $3 -L$DARSHAN_LIB_PATH -ldarshan-posix"; +$link_cmd_suffix="\"\$\{newallargs\[\@\]\}\" `$PREFIX/bin/darshan-config --pre-ld-flags` $3 `$PREFIX/bin/darshan-config --post-ld-flags`"; # repeat the above step for the compilation command line if(!($compile_cmd =~ /(.+)\s+(-c foo.c)\s+(.*)/)) diff --git a/darshan-runtime/darshan-gen-cxx.pl.in b/darshan-runtime/darshan-gen-cxx.pl.in index 5da6d714a19e918aeb5f9841a3a83e6a2f184092..fdd8c13199babd15e986bbac2e32be2db73ecf88 100644 --- a/darshan-runtime/darshan-gen-cxx.pl.in +++ b/darshan-runtime/darshan-gen-cxx.pl.in @@ -10,9 +10,7 @@ use Getopt::Long; use English; -$CP_WRAPPERS="@CP_WRAPPERS@"; -$DARSHAN_LIB_PATH="@darshan_lib_path@"; -$DARSHAN_LD_FLAGS="@LDFLAGS@"; +my $PREFIX="@prefix@"; my $input_file = ""; my $output_file = ""; @@ -83,7 +81,7 @@ if(!($link_cmd =~ /(.+)\s+(foo.o -o foo)\s+(.*)/)) } $CXX_from_link=$1; $base_link_cmd_suffix="\"\$\{allargs\[\@\]\}\" $3"; -$link_cmd_suffix="\"\$\{newallargs\[\@\]\}\" -L$DARSHAN_LIB_PATH $DARSHAN_LD_FLAGS \$CXXMPICH -ldarshan-mpi-io -lz $CP_WRAPPERS $3 -L$DARSHAN_LIB_PATH -ldarshan-posix"; +$link_cmd_suffix="\"\$\{newallargs\[\@\]\}\" \$CXXMPICH `$PREFIX/bin/darshan-config --pre-ld-flags` $3 `$PREFIX/bin/darshan-config --post-ld-flags`"; # repeat the above step for the compilation command line if(!($compile_cmd =~ /(.+)\s+(-c foo.c)\s+(.*)/)) diff --git a/darshan-runtime/darshan-gen-fortran.pl.in b/darshan-runtime/darshan-gen-fortran.pl.in index a1ba71b1e923e14e786343f25af00b13abab167e..d52537650ef0015453471b209fe3d15b172e9a71 100644 --- a/darshan-runtime/darshan-gen-fortran.pl.in +++ b/darshan-runtime/darshan-gen-fortran.pl.in @@ -10,9 +10,7 @@ use Getopt::Long; use English; -$CP_WRAPPERS="@CP_WRAPPERS@"; -$DARSHAN_LIB_PATH="@darshan_lib_path@"; -$DARSHAN_LD_FLAGS="@LDFLAGS@"; +my $PREFIX="@prefix@"; my $input_file = ""; my $output_file = ""; @@ -83,7 +81,7 @@ if(!($link_cmd =~ /(.+)\s+(foo.o -o foo)\s+(.*)/)) } $FC_from_link=$1; $base_link_cmd_suffix="\"\$\{allargs\[\@\]\}\" $3"; -$link_cmd_suffix="\"\$\{newallargs\[\@\]\}\" -L$DARSHAN_LIB_PATH $DARSHAN_LD_FLAGS \$FMPICH -ldarshan-mpi-io -lz $CP_WRAPPERS $3 -L$DARSHAN_LIB_PATH -ldarshan-posix"; +$link_cmd_suffix="\"\$\{newallargs\[\@\]\}\" \$FMPICH `$PREFIX/bin/darshan-config --pre-ld-flags` $3 `$PREFIX/bin/darshan-config --post-ld-flags`"; # repeat the above step for the compilation command line if(!($compile_cmd =~ /(.+)\s+(-c foo.c)\s+(.*)/))