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

Findind MKL with cmake

Bogdan_Cristea
Beginner
874 Views

Hi

I would like to compile my programs using cmake, but it seems that MKL (newer versions) is not detected by cmake modules (FindBLAS, FindLAPACK, etc.). Does Intel provide support for cmake ? Is there a way to detect MKL with cmake ?

regards

Bogdan

0 Kudos
7 Replies
mecej4
Honored Contributor III
874 Views

Since the directories in which MKL is installed have a definite and simple relationship to the directories in which the Intel compiler(s) are installed, if CMake knows where to find the compiler(s) already, it should be easy to inform CMake where to find the MKL files. In particular, using the -mkl switch of the compiler should suffice for projects that use MKL in a simple way.

0 Kudos
Bogdan_Cristea
Beginner
874 Views

The issue is that I need to detect only the MKL libraries. It seems to me that older library names are not the same anymore and the symbols inside each library have different names. This makes the update of FindBLAS.cmake and FindLAPACK.cmake scripts rather cumbersome. Some providers, like Digia, provide with their framework their own cmake scripts which makes library detection much easier.

I do not understand of which -mkl switch you are referring to. Is the one provided by Intel compilers ?

0 Kudos
mecej4
Honored Contributor III
874 Views

I am not familiar with the packages that you mention, and I use Cmake infrequently -- usually when someone provides a script for building their package.

The -mkl and -mkl=<lib> options are used to tell the Intel C and Fortran compilers to link in certain parts of MKL. These options are specific to the Intel compilers.

0 Kudos
Bogdan_Cristea
Beginner
874 Views

cmake comes with his own scripts for detecting MKL, the ones I have mentioned above, but they are outdated and new versions of MKL are no longer detected. I was hoping that someone has already addressed this issue, otherwise I need to update these scripts.

0 Kudos
Gennady_F_Intel
Moderator
874 Views

we don't support these cmake. you need to edit cmake accordingly the version of mkl you are using by yourself. please pay attention - there are no em64 directories with the latest versions as well as libguide40 libs.

0 Kudos
Bogdan_Cristea
Beginner
874 Views

Thank you for your replies. Is there a way to submit a feature request for MKL in order to support library detection with cmake ?

0 Kudos
Vadim_P_Intel
Employee
874 Views

Hi Bogdan,

To submit a feature request for MKL you can use Intel Premier Support.

Note, that it's CMAKE providing support for MKL and not vice versa. So the best course of action is submitting your issue directly to CMAKE bug tracking system.

0 Kudos
Reply