Compiler 11.0 now defaults to linking dynamic OpenMP runtime


Change

In the 10.1 and earlier C++ and Fortran Windows compilers, the default for OpenMP programs was to link with the static OpenMP runtime libraries.  The default has changed in the 11.0 compilers to link with the dynamic (using DLLs) OpenMP runtime. 


Effect

As a side effect of this change, the Microsoft linker-related switches, /MT[d], /MD[d], and /ML[d] (latter VS2003 only) have been decoupled from having any effect on which OpenMP runtime is linked.

New compiler switches have been introduced to specify which OpenMP runtime is linked:

/Qopenmp-link:static -- links with the static OpenMP runtime

/Qopenmp-link:dynamic -- links with the dynamic OpenMP runtime

Therefore, if you want to create a purely static (standalone) executable, you need to specify:

/Qopenmp /Qopenmp-link:static /MT


Recommendation

However, we strongly recommend you use the default setting, /Qopenmp-link:dynamic. The use of static OpenMP libraries is not recommended, because they might cause multiple libraries to be linked in an application. The condition is not supported and could lead to unpredictable results.

 

 

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