1

I've used the same code provided in this link How to setup MKL on linux with CMake

But i'm getting this error Could NOT find MKL (missing: MKL_LIBRARIES MKL_INCLUDE_DIRS

I've tried to set MKLROOT to the following SET(ENV{MKLROOT} "/home/usr/intel/mkl:$ENV{MKLROOT}")

This is how findmkl.cmake module looks like without the line of code to set the environment for mklroot (i've used the same code in the link below)

https://gist.github.com/scivision/5108cf6ab1515f581a84cd9ad1ef72aa

i suspect the issue is setting the mklroot but not sure, any help is appreciated.

zizou
  • 67
  • 1
  • 5

1 Answers1

0

If MKLROOT is initially unset, the statement SET(ENV{MKLROOT} "/home/usr/intel/mkl:$ENV{MKLROOT}") sets MKLROOT equal to /home/usr/intel/mkl:, which is an incorrect format for the path. Instead, you could use

set(ENV{MKLROOT} "/home/usr/intel/mkl")

Alternatively, you can set the value of that environment variable externally, e.g.,

source /home/usr/intel/bin/compilervars.sh intel64

and then run CMake. In that case, there is no need for the CMake set statement, which is a more portable solution.

UPDATE: As of 20th Feb 2021 compilervars.sh is not provided within Intel MKL and the environment should be set with the following command:

source /opt/intel/oneapi/setvars.sh intel64

or wherever oneAPI is installed.

Raul Laasner
  • 1,475
  • 1
  • 17
  • 30
  • As it is 20th february 2021 ```compilervars.sh``` isn't provided within Intel MKL (one api) anymore. And mkl is stored in ```/opt/intel/oneapi```. Instead of ```/home/usr/intel/bin/compilervars.sh``` one should use ```source /opt/intel/oneapi/setvars.sh intel64``` – Jubick Feb 20 '21 at 18:59
  • @Jubick Thank you! I made the edit. Also keeping the original answer because that corresponds to the original question and is still relevant for older versions. – Raul Laasner Feb 20 '21 at 22:10