Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
7196 Discussions

OMP: error #15: Initializing libiomp5md.dll, but found libguide.lib already initialized

moandor
Beginner
9,926 Views
Hello.
I'am building a DLL, using MKL 10.1.2.026, MS Visual Studio Team System 2008 with C++.

DLL was builded perfectly, but when i tried to lauch it with target application i got the error message:
"OMP: error #15: Initializing libiomp5md.dll, but found libguide.lib already initialized".

I tried to find solution in the Net, and found some links here (reference):
1. http://software.intel.com/en-us/articles/opm-abort-initializing-libguide40dll/
2. http://software.intel.com/en-us/forums/showthread.php?t=64046
3. http://software.intel.com/en-us/articles/performance-tools-for-software-developers-omp-abort-initializing-libguidelib-but-found-libguide40lib-already/
4. http://software.intel.com/en-us/forums/showthread.php?t=63103

First of all i tried to set KMP_DUPLICATE_LIB_OK=TRUE environment variable and it helps me [1]. Application launched, library loaded. But it isn't recommended due to possibly undefined behavior.

Then i tried to set /Qopenmp-link=dynamic or /Qopenmp-link=static keys in a command lines for both compiler and linker, but they are don't know such key [2].
Also i tried to change between static and dynamic linking [4]. The same error appears.

Then i tried to use /nodefaultlib key for linker with parameters libiomp5md.dll, libiomp5md.lib and libguide.lib. The same error appears [3].

And about IPP PATH in system environment variable or in runtime environment [1].
I used windows search to find libguide libs in my system and found 3 libguide.lib and 3 libduide.dll in MKL directories (ia32, ia64, em64t), 3 libguide40.lib and 3 libduide40.dll in MKL directories (ia32, ia64, em64t), and some libguide40.dll in third-parties software directories (not target application) - all directories are in %PATH%.

So. Are there any another solutions of the problem except the KMP_DUPLICATE_LIB_OK=TRUE and probably without rebuilding any libraries and applications? Or may be i'am doing somthing wrong.

Thank you.
0 Kudos
8 Replies
moandor
Beginner
9,926 Views

I've found a solution in a static linking.
But it is another story :)

I've found usefull for me this discussion:
http://software.intel.com/en-us/forums/showthread.php?t=61803http://software.intel.com/en-us/forums/showthread.php?t=61803
0 Kudos
Gennady_F_Intel
Moderator
9,926 Views
Quoting - moandor

I've found a solution in a static linking.
But it is another story :)

I've found usefull for me this discussion:
http://software.intel.com/en-us/forums/showthread.php?t=61803http://software.intel.com/en-us/forums/showthread.php?t=61803





please look at the following KB article as well.
--Gennady
0 Kudos
moandor
Beginner
9,926 Views


please look at the following KB article as well.
--Gennady
Page Not Found :(

Static linking isn't solution. Application crashes after run :(.

right now i had
OMP: error #15: Initializing libguide.lib, but found libguide.lib already initialized

, .

0 Kudos
Gennady_F_Intel
Moderator
9,926 Views

Please see below the direct lint to this KB article

http://software.intel.com/en-us/articles/omp-error-15-initializing-libguide40dll-but-found-libiomp5mddll-already-initialized/

you can find there several related links about that problem

:)

--GF


0 Kudos
Ryan2
Beginner
9,926 Views
I'm having this exact same problem.
I set this:KMP_DUPLICATE_LIB_OK=TRUE and the application will load my dll; however, the threading doesn't seem to be working. I'm only getting output on part of the image and it is very crashable.
Furthermore, setting environment variables is not a viable option for me.
All the links above are broken. Can someone help me find a permament solution.
This is the error which led me to tryKMP_DUPLICATE_LIB_OK=TRUE:
OMP: Error #15: Initializing libiomp5md.dll, but found libguide40.dll alreadyinitialized.
0 Kudos
TimP
Honored Contributor III
9,926 Views
It comes down to arranging to have just one copy of OpenMP library linked in, and rebuilding any objects and libraries which were built for the no longer supported libguide. I don't think the DUPLICATE_LIB environment variable can help you with compatibility between compilers issued several years apart.
0 Kudos
Ryan2
Beginner
9,926 Views
I'm writing plugins so Idon't have control over what OpenMP librabry is linked in the host program.
The host program that is loading our plugins is obviously using the unsupported libguide. They are behind the times and won't be changing just for us.
How do I rebuild my code to use libguide rather than libiomp5.dll??
0 Kudos
TimP
Honored Contributor III
9,926 Views
I think 10.1 compiler was the last one to provide a libguide option. The compiler docs told how to use one or the other. Unfortunately, I think it means dropping back to that compiler version and its companion MKL. I'd welcome any opinion from the MKL team experts. At the top of the Fortran or C++ forum there's a posted link to advice about downloading an old compiler, it works the same for either Fortran or C++.
0 Kudos
Reply