I see quite a few people were successful building Julia 0.7 using the Intel MKL on Linux. I have tried the same on macOS many times with many variations and pursued many threads, but never managed to do it. I suspect there is a mistake in some make file, or in the julialang instructions page somewhere, though it can also be that I’m doing something really stupid or that my installation is somehow screwed. Since I’ve run out of things to try I resort to the community. Let me explain the problems I have.
I’m using the latest High Sierra 10.13.4, and installed the latest version (2018.2.164) of the free Intel MKL library. I ran xcode-select --install
, made a make.user
on a fresh clone of julia master containing
USE_INTEL_MKL = 1
USE_INTEL_LIBM = 1
I installed gfortran
and cmake
with brew
(brew install cmake
and brew install gcc
). I added source /opt/intel/bin/compilervars.sh intel64 -platform mac
to my .bash_profile
. The script is included with the MKL libraries.
After doing that the environment variable DYLD_LIBRARY_PATH
is populated with the following:
/opt/intel/compilers_and_libraries_2018.2.164/mac/compiler/lib:/opt/intel/compilers_and_libraries_2018.2.164/mac/compiler/lib/intel64:/opt/intel/compilers_and_libraries_2018.2.164/mac/tbb/lib:/opt/intel/compilers_and_libraries_2018.2.164/mac/compiler/lib:/opt/intel/compilers_and_libraries_2018.2.164/mac/mkl/lib
The julialang build instructions for macOS indicates that it should be empty, but the build error I get happens also if I reset it to and empty string.
Now, when I do make
I first run into the following error
make[1]: *** [/Users/pablo/build/juliamkl/usr/lib/julia/libimf.dylib] Error 1
So, it seems MKL does not include the Intel LIBM. Hence I comment out USE_INTEL_LIBM = 1
in make.user
. Then make
runs into
make[1]: *** [/Users/pablo/build/juliamkl/usr/lib/julia/libmkl_rt.dylib] Error 1
This file does exist in /opt/intel/mkl/lib
, so I suspect something is broken with my path somehow. Since resetting DYLD_LIBRARY_PATH
does not help (I get the same error), I try copying by hand /opt/intel/mkl/lib
into /Users/pablo/build/juliamkl/usr/lib/julia/
. Desperate, I know. That gets me a bit further, but eventually the build fails right at the end with
LINK usr/lib/julia/sys.dylib
Intel MKL FATAL ERROR: Cannot load libmkl_intel_thread.dylib.
make: *** [julia-base-cache] Error 2
That file is actually in /Users/pablo/build/juliamkl/usr/lib/julia/
, but linking to it must be failing for some reason.
That is as far as I got. Any pointers would be immensely appreciated!