-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Description
I apologize in advance that this issue seems to be beaten to death, but I believe building Julia with MKL is still rather broken, at least on MacOS.
My am running MacOS Catalina, although it also didn't work on Mavericks.
How to reproduce
Install the latest MKL from Intel - then clone Julia - then checkout v1.2.0
git clone git://github.com/JuliaLang/julia.git
cd julia
git checkout v1.2.0As per the MKL instructions, I source the environment variables from MKL. On macOS, this install is in the following location.
source /opt/intel/bin/compilervars.sh intel64Finally, I make the Make.user file and build
echo "USE_INTEL_MKL = 1" >> Make.user
make -j4So, the build gets reasonably far, but quits here
Got SONAMES of
PERL base/pcre_h.jl
CC usr/lib/libccalltest.dylib
CC usr/lib/libllvmcalltest.dylib
PERL base/errno_h.jl
PERL base/build_h.jl.phony
PERL base/file_constants.jl
PERL base/uv_constants.jl
CC src/support/hashing.o
make[1]: *** [/Users/kiranshila/Desktop/Projects.nosync/Julia/julia/usr/lib/julia/libmkl_rt.dylib] Error 1
make[1]: *** Waiting for unfinished jobs....It seems there is a problem with usr/lib/julia/libmkl_rt.dylib
I look at that directory and it is completely empty
ls usr/lib/juliaHow I got it to build
I read in another issue that I need to source a different file, so I tried repeating the above steps with this modification to the call to source
source /opt/intel/mkl/bin/mklvars.sh intel64But I get the exact same issue
I then tried just symlinking the missing libs directly into usr/lib/julia from a fresh clone using the source command from the instructions
cd ..
rm -rd julia
git clone git://github.com/JuliaLang/julia.git
cd julia
git checkout v1.2.0
source /opt/intel/bin/compilervars.sh intel64
echo "USE_INTEL_MKL = 1" >> Make.user
mkdir -p usr/lib/julia # This didn't exist yet in fresh clone
ln -s /opt/intel/mkl/lib/libmkl_rt.dylib usr/lib/julia/libmkl_rt.dylib
make -j4This gets past the first roadblock as now that library is visible. Now, after the build steps get to building with Julia, I get this error during Generating precompile statements...
error during bootstrap:
LoadError("sysimg.jl", 16, LoadError("/Users/kiranshila/Desktop/Projects.nosync/Julia/julia/usr/share/julia/stdlib/v1.2/SuiteSparse/src/SuiteSparse.jl", 24, LoadError("/Users/kiranshila/Desktop/Projects.nosync/Julia/julia/usr/share/julia/stdlib/v1.2/SuiteSparse/src/umfpack.jl", 66, ErrorException("error compiling top-level scope: could not load library \"libsuitesparse_wrapper\"\ndlopen(libsuitesparse_wrapper.dylib, 1): Library not loaded: @rpath/libirc.dylib\n Referenced from: /Users/kiranshila/Desktop/Projects.nosync/Julia/julia/usr/lib/libcholmod.3.0.13.dylib\n Reason: image not found"))))Which to me reads that libirc.dylib isn't found. I found it and symlinked it in as before
ln -s /opt/intel/compilers_and_libraries_2019.5.281/mac/compiler/lib/libirc.dylib usr/lib/julia/libirc.dylibFinally Julia built! Checking the build
julia> versioninfo()
Julia Version 1.2.0
Commit c6da87ff4b (2019-08-20 00:03 UTC)
Platform Info:
OS: macOS (x86_64-apple-darwin19.0.0)
CPU: Intel(R) Core(TM) i7-4750HQ CPU @ 2.00GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-6.0.1 (ORCJIT, haswell)
julia> LinearAlgebra.versioninfo()
BLAS: libmkl_rt
LAPACK: libmkl_rtSo, it looks like it worked, but that was many hoops to jump through. The issue then is how can we fix the build scripts such that the symlinking isn't broken so others on MacOS don't have to spend a few days digging and troubleshooting.