Commit 7e8fa01c authored by Kevin Harms's avatar Kevin Harms

Add a check to turn off darshan if a compiler is using an option that causes

the -wrap linker option to break.


git-svn-id: https://svn.mcs.anl.gov/repos/darshan/trunk@384 3b7491f3-a168-0410-bf4b-c445ed680a29
parent 63336aa9
...@@ -17,6 +17,7 @@ $CP_ZLIB_LINK_FLAGS="@__CP_ZLIB_LINK_FLAGS@"; ...@@ -17,6 +17,7 @@ $CP_ZLIB_LINK_FLAGS="@__CP_ZLIB_LINK_FLAGS@";
my $input_file = ""; my $input_file = "";
my $output_file = ""; my $output_file = "";
my $trim_exe_path = 0; my $trim_exe_path = 0;
my $xl_check=0;
process_args(); process_args();
...@@ -82,7 +83,38 @@ print OUTPUT<<'EOF'; ...@@ -82,7 +83,38 @@ print OUTPUT<<'EOF';
# Show is set to echo to cause the compilation command to be echoed instead # Show is set to echo to cause the compilation command to be echoed instead
# of executed. # of executed.
Show= Show=
EOF
if ($xl_check == 1)
{
print OUTPUT<<'EOF';
#
# Check for IBM XL Linker Parameters
#
# If IPA linker is used, we must disable darshan
# because the IPA linker doesn't support -wrap.
#
function check_XL()
{
arg=$1;
ipa_enabled=0;
if [ "$arg" = "-O5" ]; then
ipa_enabled=1;
fi
if [ "$arg" = "-O4" ]; then
ipa_enabled=1;
fi
if [ "$arg" = "-qipa" ]; then
ipa_enabled=1;
fi
return $ipa_enabled;
}
EOF
}
print OUTPUT<<'EOF';
linking=yes linking=yes
allargs=("$@") allargs=("$@")
argno=0 argno=0
...@@ -126,6 +158,7 @@ print OUTPUT<<"EOF"; ...@@ -126,6 +158,7 @@ print OUTPUT<<"EOF";
# -ldarshan-mpi-io in there first # -ldarshan-mpi-io in there first
argno=0; argno=0;
once=0; once=0;
compiler_check=0;
newallargs=\("\$\{allargs\[\@\]\}"\); newallargs=\("\$\{allargs\[\@\]\}"\);
for arg in "\$\{newallargs\[\@\]\}"; do for arg in "\$\{newallargs\[\@\]\}"; do
res=`expr match "\$arg" "-l"`; res=`expr match "\$arg" "-l"`;
...@@ -137,6 +170,22 @@ print OUTPUT<<"EOF"; ...@@ -137,6 +170,22 @@ print OUTPUT<<"EOF";
else else
newallargs[\$argno]=\$arg; newallargs[\$argno]=\$arg;
fi fi
EOF
#
# Add any functional tests for linker parameters
#
if ($xl_check)
{
print OUTPUT<<"EOF";
check_XL "\$arg";
if [ \$? -ne 0 ]; then
compiler_check=1;
fi
EOF
}
print OUTPUT<<"EOF";
argno=`expr \$argno + 1` argno=`expr \$argno + 1`
done done
...@@ -169,7 +218,7 @@ print OUTPUT<<"EOF"; ...@@ -169,7 +218,7 @@ print OUTPUT<<"EOF";
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 ] ; then if [ \$rc_pmpi -ne 0 ] && [ \$compiler_check -eq 0 ]; then
\$Show $link_cmd \$Show $link_cmd
used_darshan=1 used_darshan=1
fi fi
...@@ -196,12 +245,13 @@ exit(0); ...@@ -196,12 +245,13 @@ exit(0);
sub process_args sub process_args
{ {
use vars qw( $opt_help $opt_output $opt_trim); use vars qw( $opt_help $opt_output $opt_trim $opt_xl );
Getopt::Long::Configure("no_ignore_case", "bundling"); Getopt::Long::Configure("no_ignore_case", "bundling");
GetOptions( "help", GetOptions( "help",
"output=s", "output=s",
"trim"); "trim",
"xl");
if($opt_help) if($opt_help)
{ {
...@@ -214,6 +264,11 @@ sub process_args ...@@ -214,6 +264,11 @@ sub process_args
$trim_exe_path=1; $trim_exe_path=1;
} }
if($opt_xl)
{
$xl_check=1;
}
if($opt_output) if($opt_output)
{ {
$output_file = $opt_output; $output_file = $opt_output;
...@@ -245,6 +300,8 @@ Usage: $PROGRAM_NAME <stock mpicc> --output <modified mpicc> ...@@ -245,6 +300,8 @@ Usage: $PROGRAM_NAME <stock mpicc> --output <modified mpicc>
--help Prints this help message --help Prints this help message
--output Specifies name of output script --output Specifies name of output script
--trim Trim the compilers path --trim Trim the compilers path
--xl Disables darshan if certain linker parameters are used
(Intended for IBM XL Compilers)
Purpose: Purpose:
......
...@@ -16,6 +16,8 @@ $CP_ZLIB_LINK_FLAGS="@__CP_ZLIB_LINK_FLAGS@"; ...@@ -16,6 +16,8 @@ $CP_ZLIB_LINK_FLAGS="@__CP_ZLIB_LINK_FLAGS@";
my $input_file = ""; my $input_file = "";
my $output_file = ""; my $output_file = "";
my $trim_exe_path = 0;
my $xl_check = 0;
process_args(); process_args();
...@@ -81,7 +83,38 @@ print OUTPUT<<'EOF'; ...@@ -81,7 +83,38 @@ print OUTPUT<<'EOF';
# Show is set to echo to cause the compilation command to be echoed instead # Show is set to echo to cause the compilation command to be echoed instead
# of executed. # of executed.
Show= Show=
EOF
if ($xl_check == 1)
{
print OUTPUT<<'EOF';
#
# Check for IBM XL Linker Parameters
#
# If IPA linker is used, we must disable darshan
# because the IPA linker doesn't support -wrap.
#
function check_XL()
{
arg=$1;
ipa_enabled=0;
if [ "$arg" = "-O5" ]; then
ipa_enabled=1;
fi
if [ "$arg" = "-O4" ]; then
ipa_enabled=1;
fi
if [ "$arg" = "-qipa" ]; then
ipa_enabled=1;
fi
return $ipa_enabled;
}
EOF
}
print OUTPUT<<'EOF';
linking=yes linking=yes
allargs=("$@") allargs=("$@")
argno=0 argno=0
...@@ -125,6 +158,7 @@ print OUTPUT<<"EOF"; ...@@ -125,6 +158,7 @@ print OUTPUT<<"EOF";
# -ldarshan-mpi-io in there first # -ldarshan-mpi-io in there first
argno=0; argno=0;
once=0; once=0;
compiler_check=0;
newallargs=\("\$\{allargs\[\@\]\}"\); newallargs=\("\$\{allargs\[\@\]\}"\);
for arg in "\$\{newallargs\[\@\]\}"; do for arg in "\$\{newallargs\[\@\]\}"; do
res=`expr match "\$arg" "-l"`; res=`expr match "\$arg" "-l"`;
...@@ -136,6 +170,23 @@ print OUTPUT<<"EOF"; ...@@ -136,6 +170,23 @@ print OUTPUT<<"EOF";
else else
newallargs[\$argno]=\$arg; newallargs[\$argno]=\$arg;
fi fi
EOF
#
# Add any functional tests for linker parameters
#
if ($xl_check)
{
print OUTPUT<<"EOF";
check_XL "\$arg";
if [ \$? -ne 0 ]; then
compiler_check=1;
fi
EOF
}
print OUTPUT<<"EOF";
argno=`expr \$argno + 1` argno=`expr \$argno + 1`
done done
...@@ -179,7 +230,7 @@ print OUTPUT<<"EOF"; ...@@ -179,7 +230,7 @@ print OUTPUT<<"EOF";
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 ] ; then if [ \$rc_pmpi -ne 0 ] && [ \$compiler_check -eq 0 ]; then
\$Show $link_cmd \$Show $link_cmd
used_darshan=1 used_darshan=1
fi fi
...@@ -206,12 +257,13 @@ exit(0); ...@@ -206,12 +257,13 @@ exit(0);
sub process_args sub process_args
{ {
use vars qw( $opt_help $opt_output $opt_trim ); use vars qw( $opt_help $opt_output $opt_trim $opt_xl );
Getopt::Long::Configure("no_ignore_case", "bundling"); Getopt::Long::Configure("no_ignore_case", "bundling");
GetOptions( "help", GetOptions( "help",
"output=s", "output=s",
"trim"); "trim",
"xl");
if($opt_help) if($opt_help)
{ {
...@@ -224,6 +276,11 @@ sub process_args ...@@ -224,6 +276,11 @@ sub process_args
$trim_exe_path=1; $trim_exe_path=1;
} }
if($opt_xl)
{
$xl_check=1;
}
if($opt_output) if($opt_output)
{ {
$output_file = $opt_output; $output_file = $opt_output;
...@@ -255,6 +312,8 @@ Usage: $PROGRAM_NAME <stock mpicxx> --output <modified mpicc> ...@@ -255,6 +312,8 @@ Usage: $PROGRAM_NAME <stock mpicxx> --output <modified mpicc>
--help Prints this help message --help Prints this help message
--output Specifies name of output script --output Specifies name of output script
--trim Trim the compilers path --trim Trim the compilers path
--xl Disables darshan if certain linker parameters are used
(Intended for IBM XL Compilers)
Purpose: Purpose:
......
...@@ -17,6 +17,7 @@ $CP_ZLIB_LINK_FLAGS="@__CP_ZLIB_LINK_FLAGS@"; ...@@ -17,6 +17,7 @@ $CP_ZLIB_LINK_FLAGS="@__CP_ZLIB_LINK_FLAGS@";
my $input_file = ""; my $input_file = "";
my $output_file = ""; my $output_file = "";
my $trim_exe_path=0; my $trim_exe_path=0;
my $xl_check = 0;
process_args(); process_args();
...@@ -82,7 +83,38 @@ print OUTPUT<<'EOF'; ...@@ -82,7 +83,38 @@ print OUTPUT<<'EOF';
# Show is set to echo to cause the compilation command to be echoed instead # Show is set to echo to cause the compilation command to be echoed instead
# of executed. # of executed.
Show= Show=
EOF
if ($xl_check == 1)
{
print OUTPUT<<'EOF';
#
# Check for IBM XL Linker Parameters
#
# If IPA linker is used, we must disable darshan
# because the IPA linker doesn't support -wrap.
#
function check_XL()
{
arg=$1;
ipa_enabled=0;
if [ "$arg" = "-O5" ]; then
ipa_enabled=1;
fi
if [ "$arg" = "-O4" ]; then
ipa_enabled=1;
fi
if [ "$arg" = "-qipa" ]; then
ipa_enabled=1;
fi
return $ipa_enabled;
}
EOF
}
print OUTPUT<<'EOF';
linking=yes linking=yes
allargs=("$@") allargs=("$@")
argno=0 argno=0
...@@ -126,6 +158,7 @@ print OUTPUT<<"EOF"; ...@@ -126,6 +158,7 @@ print OUTPUT<<"EOF";
# -ldarshan-mpi-io in there first # -ldarshan-mpi-io in there first
argno=0; argno=0;
once=0; once=0;
compiler_check=0;
newallargs=\("\$\{allargs\[\@\]\}"\); newallargs=\("\$\{allargs\[\@\]\}"\);
for arg in "\$\{newallargs\[\@\]\}"; do for arg in "\$\{newallargs\[\@\]\}"; do
res=`expr match "\$arg" "-l"`; res=`expr match "\$arg" "-l"`;
...@@ -137,6 +170,23 @@ print OUTPUT<<"EOF"; ...@@ -137,6 +170,23 @@ print OUTPUT<<"EOF";
else else
newallargs[\$argno]=\$arg; newallargs[\$argno]=\$arg;
fi fi
EOF
#
# Add any functional tests for linker parameters
#
if ($xl_check)
{
print OUTPUT<<"EOF";
check_XL "\$arg";
if [ \$? -ne 0 ]; then
compiler_check=1;
fi
EOF
}
print OUTPUT<<"EOF";
argno=`expr \$argno + 1` argno=`expr \$argno + 1`
done done
...@@ -180,7 +230,7 @@ print OUTPUT<<"EOF"; ...@@ -180,7 +230,7 @@ print OUTPUT<<"EOF";
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 ] ; then if [ \$rc_pmpi -ne 0 ] && [ \$compiler_check -eq 0 ]; then
\$Show $link_cmd \$Show $link_cmd
used_darshan=1 used_darshan=1
fi fi
...@@ -207,12 +257,13 @@ exit(0); ...@@ -207,12 +257,13 @@ exit(0);
sub process_args sub process_args
{ {
use vars qw( $opt_help $opt_output $opt_trim ); use vars qw( $opt_help $opt_output $opt_trim $opt_xl );
Getopt::Long::Configure("no_ignore_case", "bundling"); Getopt::Long::Configure("no_ignore_case", "bundling");
GetOptions( "help", GetOptions( "help",
"output=s", "output=s",
"trim"); "trim",
"xl");
if($opt_help) if($opt_help)
{ {
...@@ -225,6 +276,11 @@ sub process_args ...@@ -225,6 +276,11 @@ sub process_args
$trim_exe_path=1; $trim_exe_path=1;
} }
if($opt_xl)
{
$xl_check=1;
}
if($opt_output) if($opt_output)
{ {
$output_file = $opt_output; $output_file = $opt_output;
...@@ -256,6 +312,8 @@ Usage: $PROGRAM_NAME <stock mpi fortran script> --output <modified mpi fortran s ...@@ -256,6 +312,8 @@ Usage: $PROGRAM_NAME <stock mpi fortran script> --output <modified mpi fortran s
--help Prints this help message --help Prints this help message
--output Specifies name of output script --output Specifies name of output script
--trim Trim the compilers path --trim Trim the compilers path
--xl Disables darshan if certain linker parameters are used
(Intended for IBM XL Compilers)
Purpose: Purpose:
......
...@@ -18,7 +18,7 @@ do ...@@ -18,7 +18,7 @@ do
if [ $(expr match $compiler ".*xl.*") -gt 0 -o \ if [ $(expr match $compiler ".*xl.*") -gt 0 -o \
$compiler_type = "fast" -o \ $compiler_type = "fast" -o \
$compiler_type = "xl" ]; then $compiler_type = "xl" ]; then
compiler_opt="--trim"; compiler_opt="--trim --xl";
fi fi
if [ $(expr match $compiler ".*cxx") -gt 0 ]; then if [ $(expr match $compiler ".*cxx") -gt 0 ]; then
$PREFIX/bin/darshan-gen-cxx.pl $compiler_opt --output=$PREFIX/bin/$compiler_type/$compiler $compiler_path/$compiler $PREFIX/bin/darshan-gen-cxx.pl $compiler_opt --output=$PREFIX/bin/$compiler_type/$compiler $compiler_path/$compiler
......
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