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

oneAPI MKL 2024.0 fails to fully integrate into Visual Studio 2022

venetis
Beginner
11,379 Views

Hello,

I tried installing MKL from the standalone version and from the oneAPI full installation package on a Windows 10 machine, but got the same problem, as described below.

After installing MKL, I create a simple hello world C++ console application in VS 2022, from the templates available in VS. I open the properties of the project and select to use the parallel version of oneMKL (see attached 01.png). After hitting Apply, the directories for oneMKL are included in the VC++ Directories (see 02.png).

If I try to compile I get warnings (03.png). Clicking on any of these warning opens a XML file (see 04.png). The file compiles and I can run the simple hello world program. But if I add anything related to MKL (for example #include "mkl.h") compilation fails (see 05.png).

Any help on how to correctly install MKL and make it work in VS 2022?

0 Kudos
14 Replies
venetis
Beginner
11,321 Views

Anything regarding this issue? Maybe it is also related to this message, posted a few days earlier (but regarding Visual Studio 2019)?

https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Registry-amp-Environment-not-set-properly-for-MSVS-oneMKL-2024-0/td-p/1551877

There is certainly something going wrong during installation of MKL and integration with Visual Studio.

Maybe there is a link to download a previous version of MKL and try in the meantime?

0 Kudos
ShanmukhS_Intel
Moderator
11,294 Views

Hi Ioannis,

 

Thanks for posting in Intel Communities. 

 

We have tried creating s sample and could see mkl.h headers getting included without any issues.

Could you please check if the necessary configuration setting were made under the

Project properies page -> Intel libraries for oneAPI -> Intel oneAPI Math Kernel Library (oneMKL) -> Use oneMKL to the correct value as per your requirement.

 

Could you please try reinstalling the oneAPI 2024.0 and let us know if the issue persists?

 

Best Regards,

Shanmukh.SS

 

0 Kudos
venetis
Beginner
11,268 Views

Dear Shanmukh,

Thank you for looking into this. As I mentioned in my original message, the configuration settings for the project are (as far as I understand) correct. Please have a look at the screenshots I have included in my original message (01.png and 02.png).

I also tried to uninstall/reinstall the MKL library 2 more times after the original installation, but nothing changes. As soon as I try to include mkl.h I get the error: "cannot open source file "mkl.h" (see also screenshot 05.png from my original message).

If I can provide any further information that can help you pinpoint the problem please let me know.

Best regards,

Ioannis

0 Kudos
ShanmukhS_Intel
Moderator
11,149 Views

Hi Ioannis,

We have tried compiling a sample console Hello World application with oneMKL 2024.0 and we could see the compilation getting successful without any errors. Please find the below screenshot for your reference.

 

You could refer to the below link for more details regarding the configuration settings needed to be configured. 

https://www.intel.com/content/www/us/en/developer/articles/technical/intel-math-kernel-library-intel-mkl-compiling-and-linking-with-microsoft-visual-cc.html#:~:text=Step%201%3A%20Right%20click%20solution,the%20screenshot%20of%20this%20step.&text=Step%202%3A%20Change%20the%20Use,this%20change%20to%20your%20project.

 

 

Best Regards,

Shanmukh.SS

 

0 Kudos
venetis
Beginner
11,125 Views

Dear Shanmukh,

Thank you again for looking into this. In the meantime, I still haven't figured out how to correct the problem and resorted to using MKL on Linux.

Best regards,

Ioannis

0 Kudos
ShanmukhS_Intel
Moderator
10,747 Views

Hi Ioannis,


Could you please get back to us with a compressed project file so that we could cross-verify the project settings and help you accordingly?


Regrets for the delay in response.


Best Regards,

Shanmukh.SS


0 Kudos
SergeyKorkin
Beginner
10,668 Views

Hi,

Literally a minute ago, I was having the same problem with " Can not open source file "mkl.h" " under MS Windows 11, Microsoft Visual Studio Community 2022 (64-bit), Version 17.7.5. Re-installation (today: 1/9/2024) of oneAPI did not help. I've tried both Empty C Project and "Hello World" sample console application (as mentioned above) - none recognized "mkl.h". I made sure that:

Project Properties >> Configuration Properties >> Intel Libraries for oneAPI >> Use oneMKL = Parallel (i've checked/double checked/triple checked that) for my Active Configuration & Platform (Debug\x86).

As Shanmukh requested, I decided to upload my project here. For that, I've applied Use oneMKL = Parallel for *All platforms* and *All configurations*.

 

Now my VS project does see #include <mkl.h> and compiles normally... It is possible, that I had set "Use oneMKL = Parallel" for one configuration, but tried to compile using another configuration many times in a row, but I can hardly believe that...

 

--

Hope it helps,

SergeyK

0 Kudos
ShanmukhS_Intel
Moderator
10,611 Views

Hi Ioannis,

 

Yeah, As mentioned earlier MKL settings are to be configured so that the project fetches the corresponding headers and libraries.  Could you please update the configuration settings and let us know if the issue persists?

 

Best Regards,

Shanmukh.SS

 

0 Kudos
venetis
Beginner
10,580 Views

Dear Sergey and Shanmukh,

I am afraid that the solution proposed by Sergey (applying the option Use oneMKL = Parallel for *All platforms* and *All configurations* in the project properties) did not work for me. I am attaching the project file you requested.

I am not certain, however, that this is a problem with the project. I think it has to do with the installation of MKL. If you look at the attached file 05.png in my original post, several variables cannot be expanded (for example oneMKLProductDir, oneMKLMajorVersion, oneMKLMinorVersion, etc). The error messages indicate that these should be somewhere in the registry, but for some reason cannot be found there.

Best regards,

Ioannis

0 Kudos
ShanmukhS_Intel
Moderator
10,456 Views

Hi Ioannis,

 

Generally, the headers of mkl were available in the below-mentioned path. You could try adding the same or cross verify if those files were available.

 

C:\Program Files (x86)\Intel\oneAPI\mkl\2024.0\include

 

In addition, You could cross-verify the settings mentioned in the below url and get back if the issue persists.

 

https://www.intel.com/content/www/us/en/developer/articles/technical/intel-math-kernel-library-intel-mkl-compiling-and-linking-with-microsoft-visual-cc.html#:~:text=Step%201%3A%20Right%20click%20solution,the%20screenshot%20of%20this%20step.&text=Step%202%3A%20Change%20the%20Use,this%20change%20to%20your%20project.

 

We have tried running the shared project file and we could see it running fine without any errors.

Compiled code.png

 

Best Regards,

Shanmukh.SS

 

0 Kudos
Mark_L_Intel
Employee
9,886 Views

Hello @venetis ,

 

   was the last coomunication helpful?

0 Kudos
venetis
Beginner
9,859 Views

Hello,

Unfortunately automatic inclusion of paths and other required configuration is still not working for me. I would like to avoid including paths manually for every project I create. As mentioned previously, I have opted for now to work on Linux. I hope that the issue on Windows/Visual Studio will be resolved in future releases.

Best regards,

Ioannis

0 Kudos
SergeyKorkin
Beginner
9,805 Views

Maybe a silly idea, but what if Shanmukh sends the Hello, World project, with mkl.h included, to Ioannis?

Sergey

0 Kudos
Mark_L_Intel
Employee
9,656 Views

We cannot reproduce the issue on our side.  The issue will no longer be monitored by Intel. Thank you for posting at oneMKL community Forum.

0 Kudos
Reply