Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

When to link to "libiomp5md.lib"

lkeene
Beginner
1,899 Views
Hello,
we've been using Intel C++ v11 in combination with OpenMP for a while now. Recently I rebuilt my project (a dll) and tested it on another computer we have lying around. I was surprised to get an error claiming that libiomp5md.dll was missing (on the test machine, not the development machine). We are statically linking everything into the dll so I addressed the problem by statically linking to "libiomp5md.lib". What I don't understand is why I would need to link to this file all of a sudden? We've tested on the other computer many times and never had that error. When do I need to link to this particular file and why? Thank you in advance.
0 Kudos
3 Replies
JenniferJ
Moderator
1,899 Views
It's because that we do not recommend to use static OpenMP runtime in common cases. But if you understand your whole program and can control the whole program, you can use it safely.

So to enable the static openmp runtime, you need this specific option "/Qopenmp-link:static".

More info at here: http://software.intel.com/en-us/articles/how-to-use-intelr-compiler-openmp-compatibility-libraries-on-windows/

Jennifer
0 Kudos
lkeene
Beginner
1,899 Views
Hmmm...so if I'm linking to "libiomp5md.lib" but using the "/Qopenmp" option, what openMP runtime is being used?
0 Kudos
JenniferJ
Moderator
1,899 Views

Without /Qopenmp-link option, the default omp lib is "libiomp5md.lib" (libiomp5md.dll) no matter if you used /MD or /MT.

So to link the static libiomp5mt.lib, you need the /Qopenmp-link:static.

Or you can redistribute the libiomp5md.dll.

Jennifer

0 Kudos
Reply