Build Settings for Fortran Applications

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

Tool

Configuration or Options

Amount of Data

Survey and Suitability

Release configuration. Specify 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.

Correctness

Debug configuration. Specify 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 Correctness Tool).

Build Options for Modules with Annotations

In each module that contains Intel Advisor annotations, add the following Fortran build options to reference the annotation definitions:

When using Microsoft Visual Studio, specify these project properties:

Option Property

Explanation

Fortran > General > Additional Include Directories as either: $(ADVISOR_XE_2013_DIR)\include\ia32 or $(ADVISOR_XE_2013_DIR)\include\intel64

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

Linker > General > Additional Library Directories as either: $(ADVISOR_XE_2013_DIR)\lib32 or $(ADVISOR_XE_2013_DIR)\lib64

Linker: Searches an additional library directory that contains the Intel Advisor annotation library. Specify the same (32 or 64) architecture as the previous option.

Linker > Input > Additional Dependencies > libadvisor.lib

Linker: Specifies the name of the Intel Advisor annotation library.

If you build your application using a Windows command line (not in Visual Studio), after you set up your command line environment, add these options to your build command:

Option

Explanation

Either: /I"%ADVISOR_XE_2013_DIR%"\include\ia32 or /I"%ADVISOR_XE_2013_DIR%"\include\intel64

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

Either: /L"%ADVISOR_XE_2013_DIR%"\lib32 or /L"%ADVISOR_XE_2013_DIR%"\lib64

Linker: Searches an additional library directory that contains the Intel Advisor annotation library. Specify the same (32 or 64) architecture as the previous option.

/ladvisor

Linker: Specifies the name of the Intel Advisor annotation library.

As shown above, you need to specify the Intel Advisor directory name and library name in your compiler commands. Similarly, when using a mixed-language Fortran and C/C++ application, either link using the Fortran compiler or if you link with the C/C++ compiler, specify the Fortran static library to avoid unresolved reference errors related to Fortran intrinsic functions. For example, if you get a linker error about a missing getenv_ function, consider adding following linker options: /L<Intel-Composer-path>\lib\intel64\ /lifport or in Visual Studio, add this library path to Linker > General > Additional Library Directories and add the library name libifport in Linker > Input > Additional Dependencies.

Survey and Suitability Tools: Debug and Optimization 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 Release configuration. Use the following compiler and linker options to get full debug information and moderate optimization for your target.

When using Microsoft Visual Studio, specify these project properties:

Tool

Option Property

Explanation

Survey and Suitability

Fortran > General > Debug Information Format > Full (/debug=full)

Compiler: Requests full debug information.

Survey and Suitability

Linker > Debugging > Generate Debug Info > Yes (/DEBUG)

Linker Requests full debug information.

Survey and early stages of Suitability

Fortran > Optimization > Inline Function Expansion > Only INLINE Directive (/Ob1)

Compiler: Requests moderate optimization that limits function inlining.

Later stages of Suitability

Fortran > Optimization > user-specified

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

Note

The default for a Fortran project's Release configuration may not provide debug information. To obtain source correlation in Intel Advisor tool reports, you need to explicitly modify both project properties listed above and rebuild your project.

If you build your application using a Windows command line (not in Visual Studio), add these options to your build command:

Tool

Option

Explanation

Survey and Suitability

/debug=full

Compiler: Requests full debug information.

Survey and Suitability

/DEBUG

Linker: Requests full debug information.

Survey and early stages of Suitability

/Ob1

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).

Correctness Tool: Debug, Optimization, and Run-time Options

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

When using Microsoft Visual Studio, specify these project properties:

Tool

Option Property

Explanation

Correctness

Fortran > General > Debug Information Format > Full (/debug=full)

Compiler: Requests full debug information.

Correctness

Linker > Debugging > Generate Debug Info > Yes (/DEBUG)

Linker: Requests full debug information.

Correctness

Fortran > Optimization > None

Compiler: Disables optimization.

Correctness

Fortran > Code Generation > Runtime Library > either Multi-threaded Debug DLL (/MDd) or Multi-threaded DLL (/MD)

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

If you build your application using a Windows command line (not in Visual Studio), add these options to your build command:

Tool

Option

Explanation

Correctness

/debug=full

Compiler: Requests full debug information.

Correctness

/DEBUG

Linker: Requests full debug information.

Correctness

/Od

Compiler: Disables optimization.

Correctness

Either /MDd or /MD

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

If you do not enable Debug Information Format (/Zi , /ZI, or /debug=full), you might see missing file/line information during analysis. Similarly, if you do not disable optimization (by specifying /Od), you may see incorrect file/line information during analysis.

For more complete information about compiler optimizations, see our Optimization Notice.