Intel® Advisor Help

Build Settings for C/C++ Applications

This topic describes the C/C++ native build settings (compiler and linker options) for Intel Advisor tools. The optimization options for the Survey and Suitability tools differ from the Dependencies tool (no optimization), thus separate build scripts and target executables are needed.

Tool

Build Settings

Amount of Data

Survey and Suitability

Specify a Release build with debug information and moderate (limited inlining) optimization.

Usually the same data set as typical customer program execution, unless you want to provide a data set that exercises a specific part of your program you are evaluating for parallelism.

Dependencies

Specify a Debug build with debug information and no optimization.

Much smaller subset of the data typically used. You need to select a data set that is small but representative (see Choosing a Small, Representative Data Set for the Dependencies Tool).

Build Settings for Modules with Annotations

In each source module that contains Intel Advisor annotations, specify the following build settings to reference the annotation definitions:

After you set up your command line environment, specify these build options in your Linux build command or makefile:

Option

Explanation

-I${ADVISOR_2016_DIR}/include

Compiler: Searches an additional include directory that contains the Intel Advisor annotation definitions.

-ldl

Linker: Enables dynamic loading.

With makefiles, you can use the $(varname) format instead of ${varname} shown above.

Survey and Suitability Tools: Debug and Optimization Build Options

In addition to the options listed above for source modules that contain annotations, use the following options. To build a target for the Survey or Suitability tools, use the following compiler and linker options to get full debug information and moderate optimization for your target.

Specify these build options in your Linux build command or makefile:

Tool

Option

Explanation

Survey and Suitability

-g

Compiler: Requests full debug information.

Survey and Suitability

-g

Linker: Requests full debug information (if linking in a separate command).

Survey and early stages of Suitability

-O2 or higher (-O3) and -fno-inline-functions

Compiler: Requests moderate optimization that limits function inlining.

Later stages of Suitability

user-specified-optimization

Compiler: Use your normal optimization level that typically does not limit function inlining.

If the Suitability Report provides an incorrect location for site, task, or lock annotations, determine whether your build specifies advanced compiler optimization options that - for example - eliminate duplicate code or merge call sites. If so, consider removing the advanced optimization option when you build the target to be analyzed by Suitability tool. Such advanced optimizations may also cause similar issues when using other tools.

If the Intel Advisor tools report that your sources, files, or line numbers are not available, make sure that your build options specify debug information (listed above).

Dependencies Tool: Debug, Optimization, and Run-time Build Options

In addition to the options listed above for source modules that contain annotations, use the following options. The Dependencies tool is much easier to use on optimization-disabled code because the relationship between the sources and the running program is much simpler. Use the following compiler and linker options to provide debug information and no optimization for the target:

Specify these build options in your Linux build command or makefile:

Tool

Option

Explanation

Dependencies

-g

Compiler: Requests full debug information.

Dependencies

-g

Linker: Requests full debug information (if linking in a separate command).

Dependencies

-O0

Compiler: Disables optimization.

Dependencies

Either -threads or -Bdynamic

Linker: search for unresolved references in a multithreaded, shared object run-time library.

If you do not enable debug information (-g), you might see missing file/line information during analysis. Similarly, if you do not disable optimization (by specifying -O0), you may see incorrect file/line information during analysis.

See Also