Python build - does not find installed MKL


I downloaded & installed Intel’s MKL, but it is NOT FOUND while compiling PyTorch from source under Linux, i.e. via ‘python build’.


export LD_LIBRARY_PATH="/opt/intel/compilers_and_libraries_2017.4.196/linux/mkl/lib/intel64:$LD_LIBRARY_PATH"

does not help.

How should one “let know” where to find the installed MKL library ?

P.S. except the failure of finding MKL, all other parts of the compilation (e.g. detecting installed CUDA & CUDNN) goes perfectly well !

I found some workaround myself: modified file torch/lib/TH/cmake/FindMKL.cmake

  1. corrected line 42 to become: SET(mklvers “intel64”)

  2. added following after line 66: SET(INTEL_COMPILER_DIR “/opt/intel”)

Still do not know how to properly pass variable ‘INTEL_COMPILER_DIR’ to script ‘FindMKL.cmake’, in order to avoid modification 2).

1 Like

Thanks for sharing that! I had the same problem. I didnt want to use anaconda to install. That solved it!

1 Like