7.0 (revision 7784de1c)
Score-P Compiler Wrapper Usage


scorep-wrapper --create COMPILER [BINDIR]
scorep-<compiler> [COMPILER_FLAGS...]


The scorep-wrapper script instances (like scorep-gcc, see below for a list of provided instances) are intended to simplify configuration and instrumentation of applications where the usual means of instrumentation, i.e., prefixing the compilation command with scorep, does not work out of the box. This applies, e.g., to applications that use autotools or CMake.

The intended usage of the wrapper instances is to replace the application's compiler and linker with the corresponding wrapper at configuration time so that they will be used at build time. As compiler and linker commands are usually assigned to build variables like CC, CXX, or F77 (e.g., CC=gcc), using the corresponding wrapper is as simple as prefixing the value with scorep- (e.g., CC=scorep-gcc).

E.g., say the original compile command is


Using the wrapper instead

$ scorep-gcc COMPILER_FLAGS...

will expand to the following call:


Used at build time, this expansion performs the desired Score-P instrumentation.

The variables SCOREP_WRAPPER_INSTRUMENTER_FLAGS and SCOREP_WRAPPER_COMPILER_FLAGS can be used to pass extra arguments to scorep and to the compiler, respectively. Please see the Examples section below for details.

If the application's build system includes a configuration step (like it is the case for autotools and CMake based projects) the expansion needs to be prevented at this stage (the configuration step compiles and runs lots of small test programs; instrumenting these would in almost all cases result in failure of the configuration). To do so, one needs to set the variable SCOREP_WRAPPER to off when invoking the configuration command. The wrapper command from above will than expand to the original compile command:


See also the EXAMPLES section below.

Wrapper Instances

The installation provides wrapper instances based on the compilers used to build Score-P. Run scorep-wrapper --help to see a listing of all default instances of the used Score-P installation.

Additional wrapper instances can be created with scorep-wrapper --create.