Intel® oneAPI Base Toolkit
Support for core tools and libraries to build and deploy high-performance data-centric applications
274 Discussions

Compiled MKL example code won't run directly in cmd

vajoshi9800
Beginner
405 Views

I am new to mkl. I am trying to compile an example code for random number generation provided here. I compiled this code by first opening oneAPI command prompt for Intel 64 and then typing following command:

cl /EHsc main.cpp /DMKL_ILP64 -I"C:/Program Files (x86)/Intel/oneAPI/mkl/latest/include" "C:/Program Files (x86)/Intel/oneAPI/mkl/latest/lib/intel64/mkl_intel_ilp64.lib" "C:/Program Files (x86)/Intel/oneAPI/mkl/latest/lib/intel64/mkl_intel_thread.lib" "C:/Program Files (x86)/Intel/oneAPI/mkl/latest/lib/intel64/mkl_core.lib" "C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/compiler/lib/intel64_win/libiomp5md.lib

The code compiled fine and ran fine when executed inside oneAPI command prompt for Intel 64. However, it did not run when I executed the code from cmd or powershell. Assuming that this is normal behavior, My question is how can I compile this code so that oneAPI command prompt doen't need to be executed before running the executable?

0 Kudos
1 Solution
AbhishekD_Intel
Moderator
328 Views

Hi Vatsal,

 

The .dll which you are referring to is not in the MKL directory. You will get the libiomp5md.dll inside \Intel\oneAPI\compiler\latest\windows\redist\intel64_win\compiler directory.

And moving forward there could be the requirement of more such dependent .dll for your MKL project, which may not be in the same MKL directory. So in such cases, setvars will help to enable the proper environment depending on your executable.

 

Hope this will help you to resolve your issue.

 

Warm Regards,

Abhishek

 

View solution in original post

4 Replies
AbhishekD_Intel
Moderator
369 Views

Hi Vatsal,

 

Thanks for reaching out to us.

We can see that you are trying to use oneAPI command prompt for Intel 64 to compile and execute your sample and it's working in your case because all the environment is already been sourced at the start of compiling your sample.

So if you want to run the same sample from the different command prompt(instance) then you need to enable the environment first, please try execute]ing the "C:\Program Files (x86)\Intel\oneAPI\setvars.bat" script to enable the oneAPI environment and then you can run your sample directly in that particular instance of the command prompt.

You can run any oneAPI executables on any of the instances of the command prompt, but before that, you have to enable the oneAPI environment(setvars.bat).

 

Hope the provided details will help you to solve your issue. Do let us know if you face any problems while executing your executable.

 

 

Warm Regards,

Abhishek

 

vajoshi9800
Beginner
352 Views

@AbhishekD_Intel,

Thanks for the reply. I understand that the environment variables needs to be loaded before running the executable so that the program finds all the necessary information. However, I did some more digging to figure out what is causing the issue in the title. Apparently, the executable is looking for libiomp5md.dll. I looked for it in the whole MKL folder but I was not able to find it anywhere. I think if I put it with the executable then it should work fine. Could you please tell me where this library is located?

Thanks,

Vatsal Joshi

AbhishekD_Intel
Moderator
329 Views

Hi Vatsal,

 

The .dll which you are referring to is not in the MKL directory. You will get the libiomp5md.dll inside \Intel\oneAPI\compiler\latest\windows\redist\intel64_win\compiler directory.

And moving forward there could be the requirement of more such dependent .dll for your MKL project, which may not be in the same MKL directory. So in such cases, setvars will help to enable the proper environment depending on your executable.

 

Hope this will help you to resolve your issue.

 

Warm Regards,

Abhishek

 

AbhishekD_Intel
Moderator
288 Views

Hi Vatsal,


Thanks for the confirmation. As your issue is resolved we will no longer monitor this thread. Please post a new thread if you have any other issues.


Warm Regards,

Abhishek


Reply