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

How to make a custom DLL of MKL routines

Brian_Murphy
New Contributor II
923 Views

Does anyone know how to modify the following two commands to work for Visual Studio 2022 and IVF 2023.2?  ipsxe-comp-vars.bat is not among the files installed with IVF 2023.2.  These commands worked great for VS 2019 and IVF 19.1, but not with today's VS & IVF.

C:\Windows\System32\cmd.exe /E:ON /V:ON /K ""C:\Program Files (x86)\IntelSWTools\compilers_and_libraries_2020.2.254\windows\bin\ipsxe-comp-vars.bat" intel64 vs2019"

nmake libintel64 interface=lp64 threading=sequential cluster=no export=subs.txt name=myMKL_x64

 

0 Kudos
5 Replies
VarshaS_Intel
Moderator
877 Views

Hi,

 

Thanks for posting in Intel Communities.

 

>>ipsxe-comp-vars.bat is not among the files installed with IVF 2023.2.

As ipsxe-comp-vars.bat is present in Intel Parallel Studio but when it comes to Intel oneAPI we need to use the below command:

 

Linux:

To initialize the Intel oneAPI Environment:

source /opt/intel/oneapi/setvars.sh

Windows:

You can use the Intel oneAPI Command Prompt (or) You can also use the command prompt and run the command "C:\Program Files (x86)\Intel\oneAPI\setvars.bat" to initialize the Intel oneAPI Environment.

 

Also, the Intel Fortran compiler comes from the Intel HPC Toolkit you can download from this link

 

In order to use Custom DLL with Intel MKL routine for linking, could you please find the below link for more details:

https://www.intel.com/content/www/us/en/docs/onemkl/developer-guide-windows/2023-2/using-the-custom-dll-builder-in-command-line-mode.html

 

Thanks & Regards,

Varsha

 

0 Kudos
Brian_Murphy
New Contributor II
865 Views

Thank you for the reply, but I get an error that "source" is not a recognized program.

Anyhow, I got commands from the Start menu items for launching the command window.  One item is for 32 bit and one is for 64 bit.

For 64 bit it is this:

 

 

%ComSpec% /E:ON /K ""C:\Program Files (x86)\Intel\oneAPI\setvars.bat" intel64 vs2022"

 

 

After this, the following nmake command successfully made myMKL_x64.dll

 

 

nmake libintel64 interface=lp64 threading=sequential cluster=no export=subs.txt name=myMKL_x64

 

 

However, this approach did not work for 32 bit.  setvars seemed to work ok, but not the nmake command.

 

 

%ComSpec% /E:ON /K ""C:\Program Files (x86)\Intel\oneAPI\setvars.bat" ia32 vs2022"
nmake libia32 interface=cdecl threading=sequential cluster=no export=subs.txt name=myMKL

 

 

The nmake command generates the following linker error:

LINK : fatal error LNK1181: cannot open input file 'mkl_intel_c.lib'

This file is not on my system.  Evidently installing the default HPC base toolkit only installs 64 bit support.  I got 32 bit to work after I installed Intel oneAPI Base Toolkit for Windows (32 bit)

 

0 Kudos
VarshaS_Intel
Moderator
824 Views

Hi,


Thanks for your reply.


It's great to know that you are able to create and use DLLs without any error on 64-bit.


>>I got 32 bit to work after I installed

Could you please confirm if you are able to run successfully on 32-bit or not?

If not, could you please provide us with the complete files and steps you are following to reproduce the issue at our end?


Thanks & Regards,

Varsha



0 Kudos
Brian_Murphy
New Contributor II
796 Views

Yes, after installing 32 bit support for MKL, I can build and run 32-bit as well as 64-bit.

 

0 Kudos
VarshaS_Intel
Moderator
782 Views

Hi,


Thanks for the confirmation.


It’s great to know that the issue has been resolved, in case you run into any other issues please feel free to create a new thread.


Have a Good Day!


Thanks & Regards,

Varsha


0 Kudos
Reply