1.2. TAU scripted compilation

For more detailed profiles TAU provides two means to compile your application with TAU: Through your compiler or through source transformation using PDT. If you choose PDT instrumentation and for some reason it fails on a particular file the compiler scripts will revert back to compiler based instrumentation for that file. This is to better insure that the program is successfully compiled even if not all the instrumentation options could be applied.

1.2.1. Compiler Based Instrumentation

TAU provides these scripts: tau_f90.sh, tau_cc.sh, and tau_cxx.sh to instrument and compile Fortran, C, and C++ programs respectively. You might use tau_cc.sh to compile a C program by typing:

%> module load tau
%> tau_cc.sh -tau_options=-optCompInst samplecprogram.c
    

On machines where a TAU module is not available you will need to set the tau makefile and/or options. The makefile and options controls how will TAU will compile you application. Use

%>tau_cc.sh -tau_makefile=[path to makefile] \
            -tau_options=[option] samplecprogram.c
    

The Makefile can be found in the /[arch]/lib directory of your TAU distribution, for example /x86_64/lib/Makefile.tau-mpi-pdt.

You can also use a Makefile specified in an environment variable. To run tau_cc.sh so it uses the Makefile specified by environment variable TAU_MAKEFILE, type:

%>export TAU_MAKEFILE=[path to tau]/[arch]/lib/[makefile]
%>export TAU_OPTIONS=-optCompInst
%>tau_cc.sh sampleCprogram.c
    

Similarly, if you want to set compile time options like selective instrumentation you can use the TAU_OPTIONS environment variable.

1.2.2. Source Based Instrumentation

TAU provides these scripts: tau_f90.sh, tau_cc.sh, and tau_cxx.sh to instrument and compile Fortran, C, and C++ programs respectively. You might use tau_cc.sh to compile a C program by typing:

%> module load tau
%> tau_cc.sh samplecprogram.c
    

When setting the TAU_MAKEFILE make sure the Makefile name contains pdt because you will need a version of TAU built with PDT.

A list of options for the TAU compiler scripts can be found by typing man tau_compiler.sh or in this chapter of the reference guide.

1.2.3. Option to TAU compiler scripts

These are some commonly used options available to the TAU compiler scripts. Either set them via the TAU_OPTIONS environment variable or the -tau_options= option to tau_f90.sh, tau_cc.sh, or tau_cxx.sh

-optVerbose
Enable verbose output (default: on)
-optKeepFiles
Do not remove intermediate files
-optShared
Use shared library of TAU