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

CMake Config for oneMKL example cannot find MKL_C

Peter0000
New Contributor I
871 Views

 

I am trying to use  MKLConfig.cmake (wind64) via example cmakelist.txt

 

https://www.intel.com/content/www/us/en/develop/documentation/onemkl-windows-developer-guide/top/getting-started/cmake-config-for-onemkl.html

 

using:

 

cmake -G"Visual Studio 17 2022" -A x64

 

It a happily finds and uses MKLConfig.cmake, until it fails to find MKL_C (.lib?)

 

etc etc

-- Found MKL: C:/Program Files (x86)/Intel/oneAPI/compiler/latest/windows/compiler/lib/intel64/libiomp5md.lib

-- Configuring done

CMake Error at CMakeLists.txt:8 (target_compile_options):

  Error evaluating generator expression:

    $<TARGET_PROPERTY:MKL::MKL_C,INTERFACE_COMPILE_OPTIONS>

  Target "MKL::MKL_C" not found.

 

(When working, I will add Fortran as well)

0 Kudos
1 Solution
VidyalathaB_Intel
Moderator
842 Views

Hi Peter,

 

Thanks for reaching out to us.

 

>>...until it fails to find MKL_C (.lib?)

The issue is reproducible with the CMakeLists.txt provided in the documentation

https://www.intel.com/content/www/us/en/develop/documentation/onemkl-windows-developer-guide/top/getting-started/cmake-config-for-onemkl.html

Thanks for letting us know. we will check on that and will let you know about the same.

 

Here's how we can resolve the error that we are getting during cmake step.

So while checking for the target MKL::MKL_C (which we see in error)in MKLConfig.cmake file, I didn't find it and it is mentioned as follows from line 88 to 91

 

MKL::MKL
# Link line for C and Fortran API
# MKL::MKL_DPCPP
# Link line for DPC++ API

 

which tells that MKL::MKL would suffice to work with both C and Fortran API's

and after replacing

>> MKL::MKL_C

with

<< MKL::MKL

in your CMakeLists.txt it worked without generating any such errors.

Also we suggest you to refer to the CMakeLists.txt file which is present under this location "C:\Program Files (x86)\Intel\oneAPI\mkl\2022.1.0\examples\examples_core_c.zip\c" where you can see only MKL::MKL used as target.

Here is the screenshot for your reference

VidyalathaB_Intel_0-1662104874087.png

Please do let us know if you still face any issues.

 

Regards,

Vidya.

 

View solution in original post

0 Kudos
2 Replies
VidyalathaB_Intel
Moderator
843 Views

Hi Peter,

 

Thanks for reaching out to us.

 

>>...until it fails to find MKL_C (.lib?)

The issue is reproducible with the CMakeLists.txt provided in the documentation

https://www.intel.com/content/www/us/en/develop/documentation/onemkl-windows-developer-guide/top/getting-started/cmake-config-for-onemkl.html

Thanks for letting us know. we will check on that and will let you know about the same.

 

Here's how we can resolve the error that we are getting during cmake step.

So while checking for the target MKL::MKL_C (which we see in error)in MKLConfig.cmake file, I didn't find it and it is mentioned as follows from line 88 to 91

 

MKL::MKL
# Link line for C and Fortran API
# MKL::MKL_DPCPP
# Link line for DPC++ API

 

which tells that MKL::MKL would suffice to work with both C and Fortran API's

and after replacing

>> MKL::MKL_C

with

<< MKL::MKL

in your CMakeLists.txt it worked without generating any such errors.

Also we suggest you to refer to the CMakeLists.txt file which is present under this location "C:\Program Files (x86)\Intel\oneAPI\mkl\2022.1.0\examples\examples_core_c.zip\c" where you can see only MKL::MKL used as target.

Here is the screenshot for your reference

VidyalathaB_Intel_0-1662104874087.png

Please do let us know if you still face any issues.

 

Regards,

Vidya.

 

0 Kudos
VidyalathaB_Intel
Moderator
804 Views

Hi Peter,


Thanks for accepting the solution.

Please post a new question if you need any additional assistance from Intel as this thread will no longer be monitored.


Have a Great Day!


Regards,

Vidya.


0 Kudos
Reply