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

New to MKL - Open MP crash



we started using MKL library for add-ons to CAD software. We combine several MKL functions in separate dll that is subsequently used by our software.DLL is being coded in C++ and compiled using MS VS 2005.

Our dll is linked with the following MKL libraries (per Link Advisor output) mkl_intel_lp64.lib mkl_intel_thread.lib mkl_core.lib libiomp5md.lib. However during test run software crashed with message: "OMP: Error #15: Initializing libiomp5md.dll, but found libguide40.lib already initialized ...." Setting environment variable KMP_DUPLICATE_LIB_OK = TRUE seems to solve this issue, however we are not satisfied with this approach.

After searching this forum I found that Intel suggests to link libiomp5md dynamically to avoid the crash, but that is exactly what we are doing. At least we told the Link Advisor that we want to link dynamically and used the output. Am I missing something about  linking procedure?

Another problem that arrised after switching to MKL is that software crashed on our customer's machine (XEON 3-1245 with Windows 7 Pro SP1 64-bit) and runs fine on everything else we were able to test it with. No error message is available in this case. We are unable to actively debug this issue, because it is not repeatable on any of our machines. We would like to solve it nonetheless. Could you provide insight to this problem?


P.S. Is Intel Premier support functional? I was not able to log in there after multiple attempts and multiple password resets.

0 Kudos
4 Replies
Black Belt
The message about libguide40 means that somewhere in your build you are using the older OpenMP library. You would need to rebuild any objects which refer to an earlier OpenMP implementation. You might be able to think up debugging tests which arbitrarily use more than normal stack, so as to test whether you have sufficient margin (both with respect to KMP_STACKSIZE and the main stack). Needless to say, you must solve the multiple OpenMP instances problem first.
Hi Tim, thanks for quick response. We do not use libguide anywhere in our software.Our product is a workbench for CATIA CAD environment. CATIA itself is using libguide, while our plug-in uses libiomp. We have no control over what is used in CATIA. My understanding is that we need to link to libiomp dynamically in order to prevent multiple instance of OpenMP. That's what MKL user's guide is telling me - Quote "Dynamically link libiomp5, the compatibility OpenMP* run-time library, even if you link other libraries statically. Linking to the libiomp5 statically can be problematic because the more complex your operating environment or application, the more likely redundant copies of the library are included. This may result in performance issues (oversubscription of threads) and even incorrect results." Question is - how can I do that. Because I followed output of link adviser using all possible combinations as input and still have the same problem. A.
Tim, based on your ID, I assume that you are Intel employee. Disregard the following comment if I am wrong in this assumption. I apologize for snarky tone, but what is going on with premier support? I can not login there, no one responds to my emails. Is it the normal way for Intel to support commerical software?

Hi Badin,

I reviewed the issue and saw some problem were still open. So hope to clarify.

Regarding the problem you can't login into, could you please send a message to me about

your premier account and commerial software serial number?

Regarding the problem of OMP: Error #15: Initializing libiomp5md.dll, but found libguide40.lib already initialized ...."

The key of solution is to keep one OpenMP instance in Run-time environment. 

In most of case, if we have everything  (all dlls, plug-ins and application ) under control, then link dynamic library libiomp5* will avoid the conflict. 

But in some of case,  as yours,  the CATIA  used libguide40.dll, which we have no control over that. Frankly, there is not good solution except set environment variable KMP_DUPLICATE_LIB_OK=true. That is why we suggest  all developers to link dynamic OpenMP library.

And you may check CATIA if they have new release, which have used new libiomp5.dll.

If you have CATIA CAD installed, you can do quick search and see if libguide40.dll or libiomp5md.dll are used. 

 And last problem,  crashed on one special machine, we may need more information on. like when run which function, the crash happen? the multi-thread model etc.  If needed,you can submit the information by

Best Regards,