Intel® Fortran Compiler 16.0 User and Reference Guide
The Intel® Fortran 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*
Intel® Fortran 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.
The Intel® Fortran Compiler 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 the Intel® Fortran Compiler prior to version 10.0.
Object modules produced by current versions of the Intel® Fortran Compiler are compatible with object modules produced by the compatibility libraries, for the Intel® Fortran 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® Fortran Compiler with non-Intel Compilers
To avoid possible linking or run-time problems, follow these guidelines:
Always link using the Intel® Fortran 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® Fortran 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® Fortran 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® Fortran Compiler and the Visual C++* Compiler, the code compiled by the Intel® Fortran 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® Fortran 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® Fortran 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® Fortran Compiler and GCC* compiler, the code compiled by the Intel® Fortran 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® Fortran Compiler to enable the code that they compile to reference the same threadprivate locations as code compiled by GCC.