Commit 48c45903 authored by Philip Carns's avatar Philip Carns

Fix bug reported by Rob Latham: the darshan-gen*.pl scripts should detect

the -v output of the input script and produce the same -v output in the
output script.

fixes #33


git-svn-id: https://svn.mcs.anl.gov/repos/darshan/trunk@427 3b7491f3-a168-0410-bf4b-c445ed680a29
parent 1d184b81
......@@ -37,6 +37,15 @@ if (!($link_cmd))
exit(1);
}
# we just want the first line of output from the mpi script's -v argument;
# the rest we assume will be generated by the underlying compiler
my $version_out = `$input_file -v 2>/dev/null |head -n 1`;
if (!($version_out))
{
printf STDERR "Error: failed to invoke $input_file with -v\n";
exit(1);
}
# check command lines for accuracy
if(!($compile_cmd =~ /-c foo.c/) || !($link_cmd =~ /foo.o -o foo/))
{
......@@ -45,6 +54,7 @@ if(!($compile_cmd =~ /-c foo.c/) || !($link_cmd =~ /foo.o -o foo/))
}
chomp($compile_cmd);
chomp($link_cmd);
chomp($version_out);
#
# Incomprehensible re to eat the leading path of the compiler command
......@@ -128,6 +138,18 @@ for arg in "$@" ; do
# The compiler links by default
linking=no
;;
-v)
# Pass this argument to the compiler as well.
EOF
print OUTPUT<<"EOF";
echo "$version_out"
EOF
print OUTPUT<<'EOF';
# if there is only 1 argument, it must be -v.
if [ "$#" -eq "1" ] ; then
linking=no
fi
;;
-show)
addarg=no
Show=echo
......
......@@ -37,6 +37,15 @@ if (!($link_cmd))
exit(1);
}
# we just want the first line of output from the mpi script's -v argument;
# the rest we assume will be generated by the underlying compiler
my $version_out = `$input_file -v 2>/dev/null |head -n 1`;
if (!($version_out))
{
printf STDERR "Error: failed to invoke $input_file with -v\n";
exit(1);
}
# check command lines for accuracy
if(!($compile_cmd =~ /-c foo.c/) || !($link_cmd =~ /foo.o -o foo/))
{
......@@ -45,6 +54,7 @@ if(!($compile_cmd =~ /-c foo.c/) || !($link_cmd =~ /foo.o -o foo/))
}
chomp($compile_cmd);
chomp($link_cmd);
chomp($version_out);
#
# Incomprehensible re to eat the leading path of the compiler command
......@@ -128,6 +138,18 @@ for arg in "$@" ; do
# The compiler links by default
linking=no
;;
-v)
# Pass this argument to the compiler as well.
EOF
print OUTPUT<<"EOF";
echo "$version_out"
EOF
print OUTPUT<<'EOF';
# if there is only 1 argument, it must be -v.
if [ "$#" -eq "1" ] ; then
linking=no
fi
;;
-show)
addarg=no
Show=echo
......
......@@ -37,6 +37,15 @@ if (!($link_cmd))
exit(1);
}
# we just want the first line of output from the mpi script's -v argument;
# the rest we assume will be generated by the underlying compiler
my $version_out = `$input_file -v 2>/dev/null |head -n 1`;
if (!($version_out))
{
printf STDERR "Error: failed to invoke $input_file with -v\n";
exit(1);
}
# check command lines for accuracy
if(!($compile_cmd =~ /-c foo.c/) || !($link_cmd =~ /foo.o -o foo/))
{
......@@ -45,6 +54,7 @@ if(!($compile_cmd =~ /-c foo.c/) || !($link_cmd =~ /foo.o -o foo/))
}
chomp($compile_cmd);
chomp($link_cmd);
chomp($version_out);
#
# Incomprehensible re to eat the leading path of the compiler command
......@@ -128,6 +138,18 @@ for arg in "$@" ; do
# The compiler links by default
linking=no
;;
-v)
# Pass this argument to the compiler as well.
EOF
print OUTPUT<<"EOF";
echo "$version_out"
EOF
print OUTPUT<<'EOF';
# if there is only 1 argument, it must be -v.
if [ "$#" -eq "1" ] ; then
linking=no
fi
;;
-show)
addarg=no
Show=echo
......
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