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
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,
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?
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.