/usr/bin/tau_cc is in tau 2.16.4-1.5.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | #!/bin/sh
# Define variables
makefile_specified=no
options_specified=no
# depending on the options, we might invoke the regular compiler, TAU_COMPILER, or both
invoke_without_tau=no
invoke_with_tau=yes
if [ $# = 0 ] ; then
echo "Usage $0 [-tau_makefile=<tau_stub_makefile>] [-tau_options=<tau_compiler_opts>] <opts> <file>"
echo "If -tau_makefile option is not used, "
echo "TAU uses the file specified in the TAU_MAKEFILE environment variable"
echo "e.g., "
echo "% tau_cc.sh -tau_makefile=/usr/local/tau-2.x/ia64/lib/Makefile.tau-mpi-pdt -tau_options=-optVerbose -c foo.c"
echo " or"
echo "% setenv TAU_MAKEFILE /usr/local/tau-2.x/include/Makefile"
echo "% setenv TAU_OPTIONS -optVerbose -optTauSelectFile=select.tau"
echo "% tau_cc.sh -c foo.c"
exit 1
fi
TAUARGS=
NON_TAUARGS=
for arg in "$@" ; do
# Thanks to Bernd Mohr for the following that handles quotes and spaces (see configure for explanation)
modarg=`echo "x$arg" | sed -e 's/^x//' -e 's/"/\\\"/g' -e s,\',%@%\',g -e 's/%@%/\\\/g' -e 's/ /\\\ /g'`
case $arg in
-tau_makefile=*)
MAKEFILE=`echo $arg | sed -e 's/-tau_makefile=//'`
makefile_specified=yes
;;
-tau_options=*)
TAUCOMPILER_OPTIONS=`echo $arg | sed -e 's/-tau_options=//'`
options_specified=yes
;;
-E)
invoke_without_tau=yes
invoke_with_tau=no
NON_TAUARGS="$NON_TAUARGS $modarg"
;;
-MD | -MMD)
# if either of these are specified, we invoke the regular compiler
# and TAU_COMPILER, unless -E or another disabling option is specified
invoke_without_tau=yes
NON_TAUARGS="$NON_TAUARGS $modarg"
;;
-MF* | -MT* | -MQ* | -MP | -MG)
# these arguments should only go to the non-tau invocation
NON_TAUARGS="$NON_TAUARGS $modarg"
;;
-M | -MM | -V | -v | --version | -print-prog-name=ld | -print-search-dirs | -dumpversion)
# if any of these are specified, we invoke the regular compiler only
invoke_without_tau=yes
invoke_with_tau=no
NON_TAUARGS="$NON_TAUARGS $modarg"
;;
*)
TAUARGS="$TAUARGS $modarg"
NON_TAUARGS="$NON_TAUARGS $modarg"
;;
esac
done
if [ $makefile_specified = no ] ; then
MAKEFILE=$TAU_MAKEFILE
if [ "x$MAKEFILE" != "x" ] ; then
if [ ! -r $MAKEFILE ] ; then
echo "ERROR: environment variable TAU_MAKEFILE is set but the file is not readable"
exit 1
fi
else
echo $0: "ERROR: please set the environment variable TAU_MAKEFILE"
exit 1
fi
fi
if [ $options_specified = no ] ; then
TAUCOMPILER_OPTIONS=$TAU_OPTIONS
if [ "x$TAUCOMPILER_OPTIONS" = "x" ] ; then
TAUCOMPILER_OPTIONS=-optVerbose
fi
fi
if [ $invoke_without_tau = yes ] ; then
tmpmakefile=$( mktemp /tmp/makefile.tau.$USER.$$-XXXXXX )
cat <<EOF > $tmpmakefile
include $MAKEFILE
all:
@\$(TAU_CC) $NON_TAUARGS
EOF
make -s -f $tmpmakefile
/bin/rm -f $tmpmakefile
fi
if [ $invoke_with_tau = yes ] ; then
tmpmakefile=$( mktemp /tmp/makefile.tau.$USER.$$-XXXXXX )
cat <<EOF > $tmpmakefile
include $MAKEFILE
all:
@\$(TAU_COMPILER) $TAUCOMPILER_OPTIONS \$(TAU_CC) $TAUARGS
EOF
make -s -f $tmpmakefile
/bin/rm -f $tmpmakefile
fi
|