Performance Tools for Software Developers - Using the Intel® Compilers with Intel® Thread Checker

When you compile threaded applications to be analyzed by the Intel® Thread Checker with the Intel® C++ or Fortran Compilers, you must use the /Qtcheck (Windows*) or -tcheck (Linux*) options. You must have Intel® Thread Checker installed on the system you are compiling on, as the compilation will fail with {/Qtcheck,-tcheck} if Intel® Thread Checker cannot be found. The {/Qtcheck,-tcheck} option takes a mode argument which indicates the method of analysis to be performed for threaded applications. The possible values are:

tciEnables emulate-and-predicate analysis. It causes the Intel® Thread Checker to emulate OpenMP* threads (without creating real OpenMP* threads) and to predict errors that may occur if the program runs as a real OpenMP* program. This mode only has an effect on OpenMP* programs.
tcdEnables run-and-detect analysis. It causes the Intel® Thread Checker to detect errors while the program is running. This mode has an effect on OpenMP* and non-OpenMP* programs. This is the default if mode is not specified.
apiInstruments system APIs for OpenMP* and non-OpenMP* programs.

If you then execute your application after compiling with {/Qtcheck,-tcheck}, it will generate a threadchecker.thr file which can be opened with Intel® Thread Checker. Alternatively, you can execute your application from within Intel® Thread Checker.

Using {/Qtcheck,-tcheck} will enable debug information automatically ( /Zi on Windows*, -g on Linux*). Make sure that this information is not stripped by your build. Also, on Windows* you must specify the Linker option /fixed:no, which can be done in the Microsoft Visual Studio* IDE by setting Linker->Advanced->Fixed Base Address to "Generate a Relocation Section".

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