Linking to a Measurement System

For startup initialization all initialization functions that can be found in the object files and libraries of the application are called. This is done by creating an additional compilation unit that contains calls to a number of function. For OpenMP these are the following POMP2 functions:

- POMP2_Init_regions(),
- POMP2_Get_num_regions(), and
- POMP2_Get_opari2_version().

The resulting object file is linked to the application. During startup of the measurement system the only thing to be done is to call POMP2_Init_regions() which then calls all POMP2_Init_reg_XXX_YY functions.

In order to create the additional compilation unit (for example `pomp2_init_file.c`) the following command sequence can be used:

    % `opari2-config --nm` <objs_and_libs> |            \
      `opari2-config --region-initialization` > pomp2_init_file.c

Here, <objs_and_libs> denotes the entire set of object files and libraries that were instrumented by OPARI2.

Due to portability reasons `nm`, and the `awk` script to create the additional file are not called directly but via the provided `opari2-config` tool.

A call to the `opari2-config` tool has the following syntax:

    Usage: opari2-config [OPTION] ... <command>

    with the following commands:

       --nm                       Prints the nm command.

       --region-initialization    Prints the script used to create the
                                  pomp2_init_regions.c file.

       --create-pomp2-regions     Prints the whole command necessary
                <object files>    for creating the initialization file.

       --awk-cmd                  [Deprecated, use --region-initialization instead.]
                                  Prints the awk command.

       --awk-script               [Deprecated, use --region-initialization instead.]
                                  Prints the awk script.

       --egrep                    [Deprecated, use --region-initialization instead.]
                                  Prints the egrep command.

       --cflags[=(gnu|intel|sun|  Prints compiler options to include
           pgi|ibm|cray|fujitsu|  installed headers and adds compiler
           clang)]                specific flags to prevent warnings
                                  for unused variables which can occur
                                  during the instrumentation.

       --fortran                  Indicates that the target language is fortran.
                                  Sometimes for fortran different compile flags
                                  are provided, in most of the cases there is
                                  no difference.

       --version                  Prints the OPARI2 version number.

       --interface-version        Prints the pomp2 API version that
                                  instrumented files conform too.

       --revision                 Prints the revision number of the
                                  OPARI2 package.

       --help                     Prints this help text.

    and the following options:

       [--build-check]           Tells opari2-config to use build paths
                                 instead of install paths. Used for build
                                 testing.

       [--config=<config file>]  Reads in a configuration from the given
                                 file.

    Report bugs to <support@score-p.org>.