User Guide

  • 2020
  • 09/09/2020
  • Public Content
Contents

Building Applications

Follow these guidelines to build applications that produce the most accurate and complete
Intel Inspector
analysis results:

About Using Optimal Compiler/Linker Settings

You can use the
Intel® Inspector
to analyze memory and threading errors in both debug and release modes of C++ and Fortran binaries; however, applications compiled/linked in debug mode using the following settings produce the most accurate and complete analysis results.
Compiler/Linker Property
Correct C/C++ Setting
Impact If Not Set Correctly
Debug information
Enabled (
/Zi
or
/ZI
)
Missing file/line information
Optimization
Disabled (
/Od
)
Incorrect file/line information
Dynamic runtime library
Selected (
/MD
or
/MDd
)
False positives or missing code locations
Basic runtime error checks
Disabled (do not use
/RTC
;
Default
option in Visual Studio* IDE)
False positives
Compiler/Linker Property
Correct Fortran Setting
Impact If Not Set Correctly
Debug information
Enabled (
/debug:full
)
Missing file/line information
Optimization
Disabled (
/Od
)
Incorrect file/line information
Dynamic runtime library
Selected (
/libs:dll/threads
or
libs:dll/threads/dbglibs
)
False positives or missing code locations
Basic runtime error checks
None (
/check:none
)
False positives
To learn more about options necessary to produce the most accurate and complete analysis results, see the following resources:

About Ensuring Applications Contain More Than One Thread

If you plan to run threading error analyses on systems with only one processor, you may need to take special steps to ensure applications create more than one thread:
Programming Model
Possible Strategies
Intel® Threading Building Blocks
When initializing an object of class
tbb::task_scheduler_init
, use the following function to force the creation of two or more threads:
initialize (int)
, where
int
=
2
or higher.
For more information, see http://www.threadingbuildingblocks.org/
Windows* API (Win32)
Use the following function to create as many threads as you need:
CreateThread
- Creates a thread to execute within the virtual address space of the calling process.
For more information, see http://msdn.microsoft.com/en-us/library/
OpenMP* API
Use the following to force the creation of two or more threads:
  • OMP_NUM_THREADS
    runtime environment variable - Sets the maximum number of threads in the parallel region, unless overridden by an
    omp_set_num_threads
    function or
    num_threads
    clause.
  • omp_set_num_threads
    function - Sets the number of threads in subsequent parallel regions, unless overridden by a
    num_threads
    clause.
  • num_threads
    clause - Sets the number of threads in a thread team.
For more information, see http://openmp.org/wp/openmp-specifications/

Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804