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

MKLConfig.cmake absent

mkatliar
Novice
2,223 Views

I want to link to MKL from a CMake project (https://www.intel.com/content/www/us/en/docs/onemkl/developer-guide-linux/2023-0/cmake-config-for-onemkl.html). My CMakeLists.txt says

find_package(MKL CONFIG REQUIRED)
 
CMake says:
 
[cmake] CMake Error at CMakeLists.txt:11 (find_package):
[cmake] Could not find a package configuration file provided by "MKL" with any of
[cmake] the following names:
[cmake]
[cmake] MKLConfig.cmake
[cmake] mkl-config.cmake
[cmake]
[cmake] Add the installation prefix of "MKL" to CMAKE_PREFIX_PATH or set "MKL_DIR"
[cmake] to a directory containing one of the above files. If "MKL" provides a
[cmake] separate development package or SDK, be sure it has been installed.
 
I have Intel MKL 2022.1.0 and 2023.1.0 installed on my Ubuntu Linux system. I installed them with apt, as described here: 
However, there is no MKLConfig.cmake file on my system.  It says here https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Where-can-I-find-MKLConfig-cmake/m-p/1412107/highlight/true#M33596 that the file should be in /opt/intel/oneapi/mkl/<version>/lib/cmake/mkl, but there is no "cmake" dir in "lib":
 
$ ls /opt/intel/oneapi/mkl/2022.1.0/lib
intel64
 
$ ls /opt/intel/oneapi/mkl/2023.1.0/lib
intel64
 
What is wrong and how to fix it?
 
0 Kudos
1 Solution
mkatliar
Novice
2,163 Views

I have figured it out. The most specific package that installs MKLConfig.cmake is intel-oneapi-mkl-common-devel-<version>. It is also installed by intel-oneapi-mkl-devel.

View solution in original post

0 Kudos
4 Replies
VarshaS_Intel
Moderator
2,177 Views

Hi,

 

Thanks for posting in Intel Communities.

 

If possible, could you please try installing the complete Intel Base Toolkit  as we could see the file MKLConfig.cmake is available in the path /opt/intel/oneapi/mkl/2023.0.0/lib/cmake/mkl

VarshaS_Intel_0-1680851009578.png

 

Could you get back to us if you still have any issues?

 

Thanks & Regards,

Varsha

 

0 Kudos
mkatliar
Novice
2,165 Views

Hello Varsha,

installing intel-basekit does indeed install the required files. However it also installs 12Gb of unnecessary stuff. This is too much overhead, especially in the context of continuous integration. Do you know which specific package installs MKLConfig.cmake? 

0 Kudos
mkatliar
Novice
2,164 Views

I have figured it out. The most specific package that installs MKLConfig.cmake is intel-oneapi-mkl-common-devel-<version>. It is also installed by intel-oneapi-mkl-devel.

0 Kudos
VarshaS_Intel
Moderator
2,114 Views

Hi,


Glad to know that your issue is resolved. Thanks for sharing the solution with us. This thread will no longer be monitored by Intel. If you need additional information, please start a new thread.


Thanks & Regards,

Varsha


0 Kudos
Reply