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

How do I link oneMKL with Visual Studio 2019

Nikhil_T
Novice
4,543 Views

I have started to used oneMKL in VS 2019. I changed the setting in solution properties of  Use oneMKL to Parallel. However when I #include "mkl_sycl.hpp", it says cannot open source file "mkl_sycl.hpp".

 

0 Kudos
1 Solution
RahulV_intel
Moderator
4,456 Views

Hi @Nikhil_T ,

 

Do you have any updates?

Let us know if your query is resolved.

 

Thanks,

Rahul

View solution in original post

0 Kudos
8 Replies
RahulV_intel
Moderator
4,501 Views

Hi,


Kindly specify your oneAPI toolkit version, OS, and VS19 version. Please note that some of the header files have been moved (to a different directory) or renamed in the latest oneAPI release.


Give it a try with the latest MKL code samples located under:

oneAPI_root/mkl/latest/examples/examples_sycl.zip


You may rely on the Intel MKL link line advisor tool to check what all libraries are recommended for your application:

https://software.intel.com/content/www/us/en/develop/tools/oneapi/components/onemkl/link-line-advisor.html



Thanks,

Rahul


0 Kudos
Nikhil_T
Novice
4,494 Views

How do I use the link line? Is it for the CLI execution?

 

Also, how do I use the oneMKL in parallel mode in VS 2019?  My Version for VS 2019 is 16.8.3.

 

0 Kudos
RahulV_intel
Moderator
4,480 Views

Hi,

 

To set MKL mode to parallel:

  • Open the property pages of your project.
  • Select Intel libraries for oneAPI on the left column and double click on use oneMKL under the Intel oneMKL tab to change the MKL mode to parallel/sequential/cluster.

RahulV_intel_1-1611826310093.png

 

oneMKL may also require additional library dependencies for your application to run. Kindly include these additional dependencies as suggested by the link line advisor tool.

 
 

To include additional dependencies:

  • Open the property pages of your project.
  • Select the Linker tab on your left column and click on Input.
  • Type in the additional dependency libraries. (mkl_core_dll.lib, mkl_tbb_thread_dll.lib)
 

RahulV_intel_0-1611826589523.png

 

 

Thanks,

Rahul

0 Kudos
RahulV_intel
Moderator
4,457 Views

Hi @Nikhil_T ,

 

Do you have any updates?

Let us know if your query is resolved.

 

Thanks,

Rahul

0 Kudos
RahulV_intel
Moderator
4,443 Views

Hi,


Thanks for the confirmation. Intel will no longer monitor this thread. Further discussions on this thread will be considered community only.


Regards,

Rahul


0 Kudos
Nikhil_T
Novice
4,242 Views

Hello @RahulV_intel 

 

I am trying to link oneMKL using the above mentioned process. Also trying to include the additional libraries. However, while building, the process seems to get stuck and does not compile. 

 

I am using oneAPI 2021.1.0 and VS 2019.

 

Even when I use a simple "hello world" code and try to link oneMKL (even though there is no use of MKL in the code), the simple hello world code does not compile. The same code however compiles and prints hello world when i set use mkl  to no

 

Also, while compiling, the task manager shows SYCL post link tool using almost the whole CPU.

 

Any suggestions?

0 Kudos
RahulV_intel
Moderator
4,218 Views

Hi @Nikhil_T,

 

The issue has been fixed in the latest release of oneAPI 2021.2. Could you try it out with the latest version and let us know if you face any issues?

 

--Rahul

0 Kudos
Nikhil_T
Novice
4,170 Views

Hi @RahulV_intel 

 

I tried using the above mentioned process. I am getting several errors like this::


Error LNK2038 mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in TestingOneMkl-272333.obj TestingOneMkl D:\Camb research\Multigrid Code\TEMP\TestingOneMkl\mkl_tbb_thread.lib(vml_tbb_threading_templates.obj) : 1

 

and the one as :

Severity Code Description Project File Line Suppression State
Error linker command failed with exit code 1319 (use -v to see invocation) TestingOneMkl D:\Camb research\Multigrid Code\TEMP\TestingOneMkl\dpcpp: 1

 

I have set use MKL to Parallel mode. and rest settings as default. I am now using oneapi 2021.2.0 and VS 2019. Still getting the errors 

0 Kudos
Reply