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

Windows: libguide40 and libiomp5 co-existence possible or impossible...?

AndrewC
New Contributor III
397 Views

We create DLL's ( called MEX files) for Matlab. One of the big issues we have is trying to avoid DLL-hell issues when our DLLs are loaded into Matlab ( they just load the DLL/Mex file using LoadLibrary). We managed to get this all working for most Matlab versions


Up until Matlab 2009b, Matlab binaries has been compiled with older Intel compilers and linked against libguide40.dll, so we have had to follow suit. However, the 2009b version of Matlab has switched to libiomp5.dll and so now all our MEX files (linked against libguide40) throw an acess violation inside libguide40 in kmp_set_default when they load.

Setting KMP_DUPLICATE_LIB_OK=TRUE does not help

This shows that

If libiomp5.DLL is loaded, then a Mex DLL cannot depend on libguide40.dll

My question is if ...

libguide40.DLL is already loaded, can a DLL load libiomp5.DLL without an access violation?

The motivation is that if we switch to building with "compatibility" libiomp5 lib, to get compatibility with Matlab >2009b, will this break compatibility with Matlabs <2009b

Thanks

Andrew

0 Kudos
2 Replies
Quoc-An_L_Intel
Moderator
397 Views
Libguide and libiomp5 are not compatible and were never meant to be used together. They have many of the same entry points and it is not surprising that a program that uses both would get an access violation.
0 Kudos
TimP
Honored Contributor III
397 Views
It seems likely that libiomp5 will work as a replacement (not supplement) for recent years versions of libguide. It's specifically supported that way for software built with Intel 10.1 or later compilers. No doubt, matlab themselves haven't tested backward compatibility and would suggest consistent upgrades.
0 Kudos
Reply