I'm having trouble linking the Intel MKL libraries to use in building Julia with MKL support. I've had this problem with other projects as well, but here I'll focus on Julia. I have MKL installed in /opt/intel. I've tried:

  • Running /opt/intel/bin/compilervars.sh intel64
  • Running /opt/intel/mkl/bin/mklvars.sh intel64
  • Adding the library (libmkl_rt.so) to LD_LIBRARY_PATH: export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/intel/mkl/lib/intel64_lin
  • Adding a file called "mkl.conf" within /etc/ld.so.conf.d with the contents /opt/intel/compilers_and_libraries_2019/linux/mkl/lib/intel64_lin

After the last two I ran sudo ldconfig, but there hasn't been any change. How can I get Make to recognize this library?


LD_LIBRARY_PATH and files in /etc/ld.so.conf.d configure the runtime linker, not the linker used during builds.

To build Julia with MKL, you should

  • add


    to Make.user

  • run

    source /opt/intel/bin/compilervars.sh intel64
  • and build Julia from the same shell (so that the variables set by compilervars are taken into account).

  • Thank you, it was the source part that I was missing. Once I ran source /opt/intel/bin/compilervars.sh intel64 rather than just /opt/intel/bin/compilervars.sh intel64 I was able to compile successfully. – mark2 Dec 10 '19 at 16:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.