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

Custom MKL DLL generating unwanted dependencies

carsou
Beginner
299 Views

I am trying to create a custom MKL DLL via Visual Studio using the builder found in the "C:\Program Files (x86)\Intel\oneAPI\mkl\latest\tools\builder\MSVS_Projects\VS2022\libintel64" directory.  I am also following the instructions found here: Building a Custom Dynamic-link Library in the Visual Studio*... (intel.com). I am simply trying to export the "cblas_dgemm" function. However, the generated DLL has the following dependencies:

 

Dump of file libmkl.dll

File Type: DLL

Image has the following dependencies:

mkl_intel_thread.2.dll
VCRUNTIME140.dll
api-ms-win-crt-heap-l1-1-0.dll
api-ms-win-crt-runtime-l1-1-0.dll
KERNEL32.dll
api-ms-win-crt-stdio-l1-1-0.dll

 

 

The problem is the "mkl_intel_thread.2.dll", which in turn has the following dependencies (and so on):

 

Dump of file mkl_intel_thread.2.dll

File Type: DLL

  Image has the following dependencies:

    KERNEL32.dll

  Image has the following delay load dependencies:

    mkl_core.2.dll
    libiomp5md.dll

 

 

In past experiences in building custom DLLs for MKL, I was expecting the custom DLL to only be dependent on the "libiomp5md.dll", and not on the "mkl_intel_thread.2.dll". According to Distributing Your Custom Dynamic-link Library (intel.com), this should indeed be the case.

 

Any help would be greatly appreciated.

 

0 Kudos
5 Replies
ShanmukhS_Intel
Moderator
272 Views

Hi,


Thank you for posting on Intel Communities.


We would like to request you to try creating oneMKL custom dll using command prompt.


>>In past experiences in building custom DLLs for MKL, I was expecting the custom DLL to only be dependent on the "libiomp5md.dll", and not on the "mkl_intel_thread.2.dll". 


Could you please let us know the previous version you used which was only dependent on libiomp5md.dll and current oneAPI version as well.


Best Regards,

Shanmukh.SS


carsou
Beginner
266 Views

Thank you for you suggestion.

If I build using the command prompt, as shown here: Using the Custom Dynamic-link Library Builder in the Command-line... (intel.com), it works fine (in the sense that the custom DLL is only dependent on "libiomp5md.dll", and not on other MKL libraries):

Dump of file mkl_custom.dll

File Type: DLL

  Image has the following dependencies:

    KERNEL32.dll
    VCRUNTIME140.dll
    api-ms-win-crt-heap-l1-1-0.dll
    api-ms-win-crt-string-l1-1-0.dll
    api-ms-win-crt-convert-l1-1-0.dll
    api-ms-win-crt-stdio-l1-1-0.dll
    api-ms-win-crt-environment-l1-1-0.dll
    api-ms-win-crt-runtime-l1-1-0.dll
    libiomp5md.dll
    api-ms-win-crt-time-l1-1-0.dll

And the size of the custom DLL is now much larger (7 600 KB vs 18 KB).

So it appears that the problem is within the provided Visual Studio projects (I am using VS 2022).

 

>> Could you please let us know the previous version you used which was only dependent on libiomp5md.dll and current oneAPI version as well.

The previous version I used (where I ran into no problems regarding the DLL dependencies) was via one of latest Intel Parallel Studio XE 2020 distributions (can't recall exact version). Currently, I am using MKL via the latest oneAPI distribution (2022.1.0).

 

ShanmukhS_Intel
Moderator
212 Views

Hi,


Since your initial query is resolved, Could you please let us know if we could close the thread at our end.


If this resolves your issue, make sure to accept this as a solution. This would help others with similar issue.


Thank you!


Best Regards,

Shanmukh.SS


ShanmukhS_Intel
Moderator
188 Views

Hi,


Reminder:

Has the solution provided helped? Is your issue resolved? Kindly let us know if we could close this thread at our end.


Best Regards,

Shanmukh.SS


ShanmukhS_Intel
Moderator
172 Views

Hi,


We assume that your issue is resolved, If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.


Best Regards,

Shanmukh.SS


Reply