Intel compilers include OpenMP* libraries that are object-level compatible with OpenMP support provided by certain versions of the following compilers:
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:
On Windows* OS, certain versions of Microsoft Visual C++* that support OpenMP, starting with Microsoft Visual C++ 2005.
On Linux* OS and Mac OS* X, certain versions of GNU* gcc* that support OpenMP, starting with GNU* gcc* version 4.42.
Intel compilers versions 10.0 and later and their supplied OpenMP 'compatibility' libraries.
For Fortran applications on Linux systems, it is not possible to link objects compiled by the Intel® Fortran Compiler (ifort) with objects compiled by the GNU* Fortran compiler (gfortran). Thus, for mixed-language C++ and Fortran applications, you can do one of the following:
Combine objects created by gfortran and Intel® C++ objects.
Combine objects created by the Intel C++ compiler and the Intel Fortran Compiler.
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 Intel compilers prior to version 10.0.
Object modules produced by current Intel compilers are compatible with object modules produced by the compatibility libraries, for Intel 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. For details, see OpenMP Support Libraries.
Guidelines for Using Intel and Non-Intel Compilers
To avoid possible linking or run-time problems, follow these guidelines:
Always link using the Intel 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 compiler OpenMP libraries when linking the application using the GNU* or 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 Compatibility Libraries.
Use dynamic instead of static OpenMP libraries to avoid linking multiple copies of the libraries into a single program. For details, see OpenMP Support Libraries.
Limitations When Using OpenMP Libraries with Other Compilers
Limitations of threadprivate objects on object-level interoperability:
On Windows OS systems, the Intel compilers 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 Intel compilers and Visual C++ compilers, the code compiled by the Intel 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 compilers to enable the code that they compile to reference the same threadprivate locations as code compiled by Microsoft Visual C++*.
On Linux OS systems, the Intel compilers by default (-openmp-threadprivate:legacy) use a different mechanism to reference threadprivate data than does the GNU* compilers. If you declare a variable as threadprivate in your code and you compile the code with both Intel compilers and GNU compilers, the code compiled by the Intel compiler and the code compiled by the GNU compiler reference different locations for the variable even when referenced by the same thread. Use the –openmp-threadprivate:compat compiler option when compiling with Intel compilers to enable the code that they compile to reference the same threadprivate locations as code compiled by the GNU* compilers.
On Mac OS* X systems, the operating system does not currently support the mechanism used by the GNU* compiler to support threadprivate data. Threadprivate data objects are accessible only by name from object files compiled by the Intel compilers. The Intel compilers for Mac OS X do not accept the –openmp-threadprivate compiler option.
Copyright © 1996-2011, Intel Corporation. All rights reserved.