Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Statically linking with OpenMP

tnn333
Beginner
1,450 Views
Is there a compiler option to specify OpenMP static libraries be used instead of DLL? My project uses the default /lib:static option (or at least I assume it is using the default since no /lib option is specified) and /Qopenmp option. The executable requires libguide40.dll. I couldn't find any documentation as to how I can have the executable statically linked to libguide40.lib.

Thanks for any info.
0 Kudos
2 Replies
TimP
Honored Contributor III
1,450 Views
On certain platforms, the link command
ifort -Qopenmp -i-static
will link just the required ifort libraries statically. On others, it may work the same as -static.
You may also try libguide.lib on the link line, or use the -# option to examine the command sent to the linker in case you want to modify it.
0 Kudos
Steven_L_Intel1
Employee
1,450 Views
On Windows, the switch that is relevant is /libs, which has a value of static or dll. I tried an example, and the static form of OpenMP was linked in by default - specifying /libs:dll caused the DLL form to be linked in.

Note that if you are creating a DLL in the VS.NET IDE, you will get /libs:dll set for you by default. You can change this in the Libraries property page of the project.
0 Kudos
Reply