Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.
7942 Discussions

Intel C++ 19.2, MKL and Visual Studio 2019

geerits
New Contributor I
858 Views

Dear reader,

I'm encountering the weirdest problems when using the Intel MKL libraries. To isolate the problem I have written a very simple console application in the VS 2019 IDE using Intel C++ 19.2 as my compiler. The project contains two files: main_Spline.cpp and sub_MKL_C_SPLINE.cpp, both attached. The name of the project (and executable) is "Sorting_and_Searching" and is written to output directory: 

"C:\Users\geertimw\Documents\Visual Studio 2015\Projects\WAVEDAMA_OpenMP_Solution\x64\Release"

 

PS: this old VS2015 project was imported in VS2019!

 

The project compiles and links without any problems. It also runs without any problems when running it from within VS2019 via the commands: Debug,   Start Without Debugging, i.e., a cmd window pops up which prints the result and shows me the path to the executable:

 

"0 0.00143084 0.00285822 0.00428215 0.00570264

C:\Users\geertimw\Documents\Visual Studio 2015\Projects\WAVEDAMA_OpenMP_Solution\x64\Release\Sorting_and_Searching.exe"

 

However, if I double click on "Sorting_and_Searching.exe" in this (executable) directory, I get the following error message

 

Sorting_and_Searching.PNG

 

To use the MKL libraries (called in "sub_MKL_C_SPLINE.cpp") I have put "Use oneMKL" on "Sequential" in the "Intel Libraries for oneAPI" property page of VS2019. This same message keeps on appearing irrespective of which directory I put the executable in. To me as a layman it looks as if the executable itself does not have knowledge of where to look for mkl_sequential.2.dll.

If I replace "sub_MKL_C_SPLINE.cpp" by my own spline routine I can call the resulting executable from any directory. It always works. Please advise on how to solve this problem.

 

With kind regards,

Tim.

Labels (1)
0 Kudos
3 Replies
VidyalathaB_Intel
Moderator
835 Views

Hi Tim,

 

Thanks for reaching out to us.

>>Please advise on how to solve this problem.

I could reproduce the issue from my end.

Could you please try entering the below command 

xcopy /y /d "C:\Program Files (x86)\Intel\oneAPI\mkl\2022.0.2\redist\intel64\mkl_sequential.2.dll" "$(OutDir)"

(you can enter the location of that .dll in your system)

under VS project properties >> Build Events >> Post-Build Event >> Command Line and see if it helps in resolving the issue.

 

Additionally, Could you please try running your code from Intel oneAPI command prompt and see if you still see the same issue after giving a double click directly on the executable which is generated from the Intel oneAPI command prompt?

 

Regards,

Vidya.

 

 

 

0 Kudos
VidyalathaB_Intel
Moderator
810 Views

Hi Tim,


Reminder:

As we haven't heard back from you, could you please provide us with an update regarding the issue?


Regards,

Vidya.


0 Kudos
VidyalathaB_Intel
Moderator
785 Views

Hi Tim,

 

As we haven't heard back from you, we are closing this thread. Please post a new question if you need any additional assistance from Intel as this thread will no longer be monitored.

 

Regards,

Vidya.

 

0 Kudos
Reply