Intel® C++ Compiler 16.0 User and Reference Guide
The Intel® C++ Compiler includes OpenMP* libraries that are object-level compatible with OpenMP* support provided by certain versions of the following compilers:
Microsoft* Visual C++* compiler on Windows*
GCC* on Linux*
Intel® C++ Compiler version 10.x (and later)
The term "object-level interoperability" refers to the ability to link object files and libraries generated by one compiler with object files and libraries generated by the second compiler, such that the resulting executable runs successfully. In contrast, "source compatibility" means that the entire application is compiled and linked by one compiler, and you do not need to modify the sources to get the resulting executable to run successfully.
Different compilers support different versions of the OpenMP*specification. Based on the OpenMP*features your application uses, determine what version of the OpenMP* specification your application requires. If your application uses an OpenMP* specification level equal or less than the OpenMP* specification level supported by all the compilers, your application should have source compatibility with all compilers, but you need to link all object files and libraries with the same compiler's OpenMP* libraries.
The Intel OpenMP* run-time libraries provide source compatibility and object-level interoperability with the OpenMP* support provided by:
Certain versions of Microsoft* Visual C++* libraries that support OpenMP*, starting with Microsoft* Visual C++* 2010.
Certain versions of GCC* that support OpenMP*, starting with GCC* version 4.42.
The Intel® C++ Compiler versions 10.0 and later and their supplied OpenMP* compatibility libraries.
Guidelines for Using Different Intel® Compiler Versions
To avoid possible linking or run-time problems, follow these guidelines:
Object modules produced by current Intel compilers are not compatible with object modules compiled by the Intel® C++ Compiler prior to version 10.0.
Object modules produced by current versions of the Intel® C++ Compiler are compatible with object modules produced by the compatibility libraries, for the Intel® C++ Compiler versions 10.0 and later.
Use dynamic instead of static OpenMP* libraries to avoid linking multiple copies of the libraries into a single program.
Guidelines for Using the Intel® C++ Compiler with non-Intel Compilers
To avoid possible linking or run-time problems, follow these guidelines:
Always link using the Intel® C++ Compiler OpenMP* libraries. This avoids linking multiple copies of the OpenMP* runtime libraries from different compilers. It is easiest if you use the Intel compiler command (driver) to link the application, but it is possible to link with the Intel® C++ Compiler OpenMP* libraries when linking the application using GCC* or the Visual C++* compiler (or linker) commands.
If possible, compile all the OpenMP* sources with the same compiler. If you compile (not link) using multiple compilers such as the Microsoft* Visual C++* or GNU* compilers that provide object-level interoperability with the libraries, see the instructions in Using the OpenMP* Libraries.
Use dynamic instead of static OpenMP* libraries to avoid linking multiple copies of the libraries into a single program.
Limitations When Using OpenMP* Libraries with Other Compilers
Limitations of threadprivate objects on object-level interoperability:
On Windows* systems, the Intel® C++ Compiler by default (/Qopenmp-threadprivate:legacy) use a different mechanism to reference threadprivate data than does the Microsoft* Visual C++* compiler. If you declare a variable as threadprivate in your code and you compile the code with both the Intel® C++ Compiler and the Visual C++* Compiler, the code compiled by the Intel® C++ Compiler and the code compiled by the Visual C++* compiler reference different locations for the variable even when referenced by the same thread. Use the /Qopenmp-threadprivate:compat compiler option when compiling with the Intel® C++ Compiler to enable the code that they compile to reference the same threadprivate locations as code compiled by Microsoft* Visual C++*.
On Linux* systems, the Intel® C++ Compiler by default (-openmp-threadprivate:legacy) use a different mechanism to reference threadprivate data than GCC*. If you declare a variable as threadprivate in your code and you compile the code with both the Intel® C++ Compiler and GCC* compiler, the code compiled by the Intel® C++ Compiler and the code compiled by the gcc reference different locations for the variable even when referenced by the same thread. Use the –openmp-threadprivate:compat compiler option when compiling with the Intel® C++ Compiler to enable the code that they compile to reference the same threadprivate locations as code compiled by GCC.