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

mkl.h no such file or directory

eddywu
Beginner
1,715 Views

Hello,
I'm interested in compiling some code to be compatible with intel MKL. 
The code I'm compiling is Trilinos.

I've set my variables with vars.sh

I'm using cmake with the following options related to the MKL tool. 


-DPardiso_MKL_LIBRARY_DIRS="/opt/intel/oneapi/mkl/2024.0/lib" \
-DTPL_ENABLE_MKL=ON \
-DTPL_MKL_LIBRARIES="-qmkl=parallel;-static-intel" \
-DTPL_MKL_INCLUDE_DIRS="$MKLROOT/include" \
-DTPL_ENABLE_PARDISO_MKL=ON \
-DTPL_PARDISO_MKL_LIBRARIES="-qmkl=parallel;-static-intel" \
-DTPL_PARDISO_MKL_INCLUDE_DIRS="$MKLROOT/include" \
-DAmesos_ENABLE_PARDISO_MKL=ON \
-DTPL_BLAS_LIBRARIES="-qmkl=parallel;-static-intel" \
-DTPL_BLAS_INCLUDE_DIRS="$MKLROOT/include" \
-DTPL_LAPACK_LIBRARIES="-qmkl=parallel;-static-intel" \
-DTPL_LAPACK_INCLUDE_DIRS="$MKLROOT/include" \
-m64 -Wl,--start-group ${MKLROOT}/lib/intel64/libmkl_intel_ilp64.a ${MKLROOT}/lib/intel64/libmkl_intel_thread.a ${MKLROOT}/lib/intel64/libmkl_core.a ${MKLROOT}/lib/intel64/libmkl_blacs_openmpi_ilp64.a -Wl,--end-group -liomp5 -lpthread -lm -ldl \

The last line is generated from the Intel® oneAPI Math Kernel Library (oneMKL) Link Line Advisor v6.23 .

When I try to make the program I get this error in one of the .cpp files. 
fatal error: mkl.h: No such file or directory
# include <mkl.h>


Any help would be greatly appreciated.

Thanks,
Eddy

0 Kudos
1 Solution
Mahan
Moderator
1,572 Views

Thanks for the update.


View solution in original post

0 Kudos
3 Replies
Mahan
Moderator
1,639 Views

Hi,


  1. Could you please try once with oneAPI setvarsh.sh instead of the varsh.sh just to make sure all the necessary dependencies are in the path.
  2. Also, could you please also set the following compiler option:

 -DMKL_ILP64 -I"${MKLROOT}/include"


0 Kudos
eddywu
Beginner
1,613 Views

Hi,
Thanks for getting back to me. I figured out the issue. My program required some library files, which were not downloaded. I needed to do 
yum install -y intel-oneapi-mkl-devel

Afterwards, I no longer ran into this issue.

0 Kudos
Mahan
Moderator
1,573 Views

Thanks for the update.


0 Kudos
Reply