We are developing a plugin for a 3rd party application in a Windows environment (each plugin is a DLL file stored in a predesignated folder). The application uses Intel MKL 10.3.9.1 internally, and ships with MKL DLLs in its installation folder.
Our plugin DLL also depends on MKL, but we must use a later version (11.1.3.1) because we use VS2012 (older versions of MKL do not support it). We place the MKL DLLs in the plugin folder, alongside our own DLL which is built against the said version of MKL. This is how our code links with MKL (in the x64 configuration):
#pragma comment(lib, "mkl_intel_lp64_dll")
#pragma comment(lib, "mkl_intel_thread_dll")
When the application runs, it loads the MKL 10.3 DLLs from its folder. When the plugin DLL is loaded it seems as though the MKL 11.1 DLLs are loaded (at least the files are accessed), but then the application freezes (if a debugger is attached, I see access violation exceptions). If the MKL-dependent portions of our code are replaced by stubs, effectively removing the dependency on MKL, the application runs and uses the plugin just fine.
My guess is that these problems arise because our DLL expects to work with MKL 11.1 but is actually getting the previously loaded MKL 10.3 (note that the DLLs of the different MKL versions have the same names).
Does anyone know if it is possible to load two different versions of MKL into the same process?