# Problems Installing Julia and MKL OSX

**URL:** <https://discourse.julialang.org/t/problems-installing-julia-and-mkl-osx/17102>\
**Category:** Performance\
**Tags:** mkl\
**Created:** [November 2, 2018, 8:43pm UTC](https://discourse.julialang.org/t/problems-installing-julia-and-mkl-osx/17102 "2018-11-02T20:43:12Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![davidbp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidbp/32/463_2.png) [@davidbp](https://discourse.julialang.org/u/davidbp)\
**Post date:** [November 2, 2018, 8:43pm UTC](https://discourse.julialang.org/t/problems-installing-julia-and-mkl-osx/17102/1 "2018-11-02T20:43:13Z")

</div>

Hello guys,

I tried to install julia with MKL but I got an error when compiling the code.  
I pretty much followed what is explained here:

> <https://stackoverflow.com/questions/45024338/how-to-use-intel-mkl-instead-of-libopenblas-in-julia>

Do you have any hints on what to do? Here I list the steps I took:

##### My steps

- Download MKL from intel website (m\_mkl\_2019.0.117.dmg)

- Open `m_mkl_2019.0.117.dmg` and follow the installation instructions

- Create a folder:

```julia-auto
    mkdir julia_from_source

```

- Tell the path of MKL

```julia-auto
source /opt/intel/mkl/bin/mklvars.sh intel64

```

- donwload the julia git repo

```julia-auto
    git clone https://github.com/JuliaLang/julia

```

- Checkout to a stable julia version:

```julia-auto
    cd julia
    git checkout v1.0.1

```

- Change the code in `Make.inc` to specify to use MKL

Chage this

```julia-auto
	## Settings for various Intel tools
	# Set to 1 to use MKL
	USE_INTEL_MKL ?= 0

```

to this

```julia-auto
## Settings for various Intel tools
# Set to 1 to use MKL
USE_INTEL_MKL = 1

```

- install cmake

```julia-auto
brew install cmake

```

- Compile the code

```julia-auto
     make

```

Prints, after 30 min of compiling…

```julia-auto
		.
		.
		.
    CC src/cgmemmgr.o
    CC src/llvm-api.o
    LINK usr/lib/libjulia.1.0.dylib
    CC ui/repl.o
    LINK usr/bin/julia
Creating usr/etc/julia/startup.jl
Copying in usr/share/man/man1/julia.1
/Applications/julia_from_source/julia/contrib/install.sh 755 /Applications/julia_from_source/julia/contrib/julia-config.jl /Applications/julia_from_source/julia/usr/share/julia/
    PERL base/pcre_h.jl
    PERL base/errno_h.jl
    PERL base/build_h.jl.phony
    PERL base/file_constants.jl
    PERL base/uv_constants.jl
    PERL base/version_git.jl.phony
make[1]: *** [/Applications/julia_from_source/julia/usr/lib/julia/libmkl_rt.dylib] Error 1
make: *** [julia-base] Error 2

```

---

<div class="post-metadata">

**Author:** ![amrods](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/amrods/32/2543_2.png) [@amrods](https://discourse.julialang.org/u/amrods)\
**Post date:** [November 10, 2018, 12:43am UTC](https://discourse.julialang.org/t/problems-installing-julia-and-mkl-osx/17102/2 "2018-11-10T00:43:19Z")

</div>

Could you finally build it successfully?

---

<div class="post-metadata">

**Author:** ![davidbp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidbp/32/463_2.png) [@davidbp](https://discourse.julialang.org/u/davidbp)\
**Post date:** [November 10, 2018, 12:54am UTC](https://discourse.julialang.org/t/problems-installing-julia-and-mkl-osx/17102/3 "2018-11-10T00:54:54Z")

</div>

No…  
I am thinking about trying to do this in a docker so that, If I end up beeing able to do it, anyone can use the same Dockerfile.

---

<div class="post-metadata">

**Author:** ![tkoolen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkoolen/32/1603_2.png) [@tkoolen](https://discourse.julialang.org/u/tkoolen)\
**Post date:** [November 10, 2018, 12:39pm UTC](https://discourse.julialang.org/t/problems-installing-julia-and-mkl-osx/17102/4 "2018-11-10T12:39:32Z")

</div>

I’ve only done this on Linux, but I’d follow the ‘official’ steps here: [https://github.com/JuliaLang/julia#intel-mkl](https://github.com/JuliaLang/julia#intel-mkl) (while not very detailed) rather than the ones in the StackOverflow answer. `compilervars.sh` vs. `mklvars.sh` is one of the differences between those two. No need to edit `Make.inc`, that’s what `Make.user` is for (create if it doesn’t exist). Also, use `make -j 6` e.g. to compile using 6 threads (adjust to your system), to reduce compilation time.

---

<div class="post-metadata">

**Author:** ![tkoolen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkoolen/32/1603_2.png) [@tkoolen](https://discourse.julialang.org/u/tkoolen)\
**Post date:** [November 10, 2018, 12:42pm UTC](https://discourse.julialang.org/t/problems-installing-julia-and-mkl-osx/17102/5 "2018-11-10T12:42:53Z")

</div>

Oh, see also [https://github.com/JuliaLang/julia/issues/15133](https://github.com/JuliaLang/julia/issues/15133).

---

<div class="post-metadata">

**Author:** ![Juan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juan/32/7657_2.png) [@Juan](https://discourse.julialang.org/u/Juan)\
**Post date:** [November 19, 2018, 7:13pm UTC](https://discourse.julialang.org/t/problems-installing-julia-and-mkl-osx/17102/6 "2018-11-19T19:13:17Z")

</div>

This post was temporarily hidden by the community for possibly being off-topic, unfocused, inappropriate, or spammy.

---

<div class="post-metadata">

**Author:** ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Post date:** [November 19, 2018, 7:25pm UTC](https://discourse.julialang.org/t/problems-installing-julia-and-mkl-osx/17102/7 "2018-11-19T19:25:21Z")

</div>

The thread title makes it clear that this thread is about OSX. I suggest you start a new thread if you want to know how to build Julia from source and link it against MKL on Windows 10.
