Usr/share/julia/stdlib is empty when building from source

I’m trying to build Julia from source using the Intel Math Kernel Library. I’ve done this successfully on Fedora, but I’m hitting a snag when building on Gentoo. Here’s what I’ve done:

  • git clone git://github.com/JuliaLang/julia.git

  • cd julia

  • git checkout v1.1.0

create a Make.user file containing:

USE_INTEL_MKL=1
MARCH=native
  • make

This results in:

find: ‘/home/zaen/repos/julia/usr/share/julia/stdlib/v1.1/*/src’: No such file or directory
/usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lmkl_rt
/usr/lib/gcc/x86_64-pc-linux-gnu/8.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: cannot find -lmkl_rt
collect2: error: ld returned 1 exit status
make[1]: *** [/home/zaen/repos/julia/deps/suitesparse.mk:52: /home/zaen/repos/julia/usr/manifest/suitesparse] Error 1
make: *** [Makefile:57: julia-deps] Error 2

When I check usr/share/julia/stdlib I can see that it’s empty. On my Fedora installation it’s not. What would cause this?

This directory is apparently not supposed to contain anything before Julia finishes the first build. Gentoo seems to ignore the LD_LIBRARY_PATH variable, but adding LDFLAGS="-L/opt/intel/compilers_and_libraries/linux/mkl/lib/intel64" to Make.user allowed me to build successfully.