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

Crash in Link MKL DFTI library from VS C++ x64

LWang77
Beginner
1,177 Views
I would like to use MKL FFT functions in C++ of VS 2013 on Windows x64 system. What I have done are: 1. Run test example C program, MKL FFT functions work OK 2. Run my x64 program without calls to MKL FFT functions, it works also OK 3. Add call to MKL FFT functions in my C++ classes which are built into a dll called Utility, my whole program compiles OK 4. Run my program which links the Utility.dll that calls to MKL FFT functions, it crashed with "System.DllNotFoundExeption" 5. The “DllNotFound” didn’t refer to Utility.dll that calls the MKL FFT functions. It complaints about APICreatedBySWIG.dll not found. APICreatedBySWIG.dll is a dll generated by the SWIG that converts my selected C++ functions to C# and Python interfaces wrapper. 6. To simplify the case, I exclude, in the SWIG conversions, all of those functions that call MKL FFT. In other words, APICreatedBySWIG.dll doesn’t contain any of those functions that call MKL FFT. 7. Comment out the calls to MKL FFT functions, my program starts working again 8. Replace the calls to MKL FFT functions with MKL Convolve functions in VSL, my program run beautifully without any issue 9. To investigate the dependency of the MKL FFT functions, I have load the the Utility.dll on “Dependency Walker”, which shows some MKL functions in red and an error: At least one module has an unresolved import ...... (please see attachement) To resolve this issue I need your help urgently. It would be greatly appreciated if you can shed some light on searching the answer for 1. which dll actually missing during run time and which dll the MKL function MKL DftiComputeForward actually depends on? 2. why loading APICreatedBySWIG.dll crashes when is doesn’t contain the function that calls MKL DftiComputeForward in C++ class? 3. are there some special requirements for linking those MKL libraries tjhat are in red on “Dependency Walker”? 4. Is crash due to my x64 system conflicts with some MKL library which are 32bit? My system: 1. Xeon E5-2650 v3 2. Windows 7 Professional 64-bit 3. Visual Studio 2013 5. VS C++ 6. boost_1_68_0 7. SWIG to convert selected C++ functions to C# or Python interface wrappers 8. Intel® Parallel Studio installed (compilers_and_libraries_2019.1.144 & Intel C++ Compiler 19.0) 9. Use Intel MKL = Parallel Please let me know if any additional information is needed.
0 Kudos
4 Replies
Gennady_F_Intel
Moderator
1,177 Views

 Then try explicitly linking with mkl libs instead of automatically ( mkl=parallel). Check here how to do that and here how to chose the list of needed mkl libs for linking. 

0 Kudos
LWang77
Beginner
1,177 Views

Will try it. 

At the same time, I have looked at the the linker I have and found mkl_intel_thread.dll.lib, mkl_cdft_core_dll.lib, mkl_core_dll.lib, etc.  Could you please tell:

  1. which dlls the MKL function - mkl_dft_compute_forward? (DftiComputeForward) actually depends on?
  2. which dlls the MKL function - mkl_serv_vml_cpu_detect actually depends on?
  3. which dlls the MKL function - mkl_serv_load_vml actually depends on?
  4. If automatically link has the issue, why replacing the calls to MKL FFT functions with MKL Convolve functions makes the program running properly without any issue?

Thanks

0 Kudos
Gennady_F_Intel
Moderator
1,177 Views

We had some problem with MKL integration to VS. When you set use MKL=parallel ( which is equivalent of /Qmkl:parallel from command line) , then you will link with: mkl_intel_lp64.lib mkl_intel_thread.lib mkl_core.lib libiomp5md.lib libraries (or their dynamic counterparts. see mkl user guide for more details.... 

0 Kudos
Gennady_F_Intel
Moderator
1,177 Views

regard to dependencies - in the case of proper linking - all of them will be resolve sucessfully - see again user guide.

0 Kudos
Reply