# Building Julia 0.6.0 with MKL on OSX 10.12.5

**URL:** <https://discourse.julialang.org/t/building-julia-0-6-0-with-mkl-on-osx-10-12-5/5073>\
**Category:** General Usage\
**Tags:** mkl\
**Created:** [July 26, 2017, 12:30pm UTC](https://discourse.julialang.org/t/building-julia-0-6-0-with-mkl-on-osx-10-12-5/5073 "2017-07-26T12:30:01Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![tross](https://avatars.discourse-cdn.com/v4/letter/t/97f17d/32.png) [@tross](https://discourse.julialang.org/u/tross)\
**Post date:** [July 26, 2017, 12:30pm UTC](https://discourse.julialang.org/t/building-julia-0-6-0-with-mkl-on-osx-10-12-5/5073/1 "2017-07-26T12:30:01Z")

</div>

Hello,

I am new to this so please forgive my naive approach.

I have been trying to build Julia using the intel MKL in addition to the intel c++ and fortran compilers on OS X 10.12.5. However, I have been running into a bunch of errors, which I suspect is a result of me digging myself into a deeper hole rather than solving the underlying problem(s).

Since I am new, I did a sanity check and built Julia from the most recent stable source, which appears to have worked fine (I can launch julia and use it to confirm that 1+1 indeed equals 2).

To then build with the intel math library and compilers, in the command line I entered:  
` source /opt/intel/mkl/bin/mklvars.sh intel64 ilp64`

Then I made a Make.user file containing the following:

> USEICC = 1  
> USEIFC = 1  
> USE\_INTEL\_MKL = 1  
> USE\_INTEL\_LIBM = 1

When I enter the `make` command I immediately get the error:  
`julia/Make.inc:431: *** USE_LIBCPP only supported with clang. Try setting USE_LIBCPP=0. Stop.`

However, adding in ` USE_LIBCPP=0` into the Make.user file does not resolve this error.

In an attempt to get around this problem, I added in the line  
`override USE_LIBCPP=0`  
into my Make.user file.

While this indeed gets the building to start moving, I see a very large number of warning messages while building CXX objects where the following warning numbers appear to be repeated over an over again:

> warning #1292: unknown attribute “returns\_nonnull”  
> warning #2026: Effective C++ Item 14 Make sure base classes FoldingSetImpl have virtual destructors

and eventually it terminates on the following error:

> configure: error: compiler does not halt on function prototype mismatch.  
> make[1]: \*\*\* [scratch/curl-7.53.1/build-configured] Error 1  
> make: \*\*\* [julia-deps] Error 2

If anyone can provide some advice on how to get around this problem, I would greatly appreciate it!

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [July 26, 2017, 1:16pm UTC](https://discourse.julialang.org/t/building-julia-0-6-0-with-mkl-on-osx-10-12-5/5073/2 "2017-07-26T13:16:06Z")

</div>

Do you really need to built with the intel compilers? You can use MKL anyway.

---

<div class="post-metadata">

**Author:** ![tross](https://avatars.discourse-cdn.com/v4/letter/t/97f17d/32.png) [@tross](https://discourse.julialang.org/u/tross)\
**Post date:** [July 27, 2017, 2:59am UTC](https://discourse.julialang.org/t/building-julia-0-6-0-with-mkl-on-osx-10-12-5/5073/3 "2017-07-27T02:59:44Z")

</div>

I was under the impression that the intel compilers would improve performance, is that not true?

Assuming that these compilers are not needed, I changed the Make.user file to just the following

> USE\_INTEL\_MKL = 1  
> USE\_INTEL\_LIBM = 1

However I now get the following error

> Undefined symbols for architecture x86\_64:  
> “\_\_intel\_fast\_memcpy”, referenced from:  
> \_amd\_2 in libamd.a(amd\_i\_2.o)  
> \_amd\_l2 in libamd.a(amd\_l\_2.o)  
> “\_\_intel\_fast\_memset”, referenced from:  
> \_amd\_aat in libamd.a(amd\_i\_aat.o)  
> \_amd\_postorder in libamd.a(amd\_i\_postorder.o)  
> \_amd\_l\_aat in libamd.a(amd\_l\_aat.o)  
> ld: symbol(s) not found for architecture x86\_64  
> clang: error: linker command failed with exit code 1 (use -v to see invocation)  
> make[1]: \*\*\* [/Applications/julia/usr/manifest/suitesparse] Error 1  
> make: \*\*\* [julia-deps] Error 2

---

<div class="post-metadata">

**Author:** ![ihnorton](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ihnorton/32/26_2.png) [@ihnorton](https://discourse.julialang.org/u/ihnorton)\
**Post date:** [July 27, 2017, 3:01am UTC](https://discourse.julialang.org/t/building-julia-0-6-0-with-mkl-on-osx-10-12-5/5073/4 "2017-07-27T03:01:40Z")

</div>

If you are working in the same directory where you started, it is probably necessary to run `make distclean-suitesparse` (and quite likely `make distcleanall`) to clean the existing (partial?) builds started with ICC.

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [July 27, 2017, 5:39am UTC](https://discourse.julialang.org/t/building-julia-0-6-0-with-mkl-on-osx-10-12-5/5073/5 "2017-07-27T05:39:53Z")

</div>

Code generation is doen by LLVM so runtime performance AFAIU, run time performance should not depend on what you use to compile LLVM / Julia with.

---

<div class="post-metadata">

**Author:** ![tross](https://avatars.discourse-cdn.com/v4/letter/t/97f17d/32.png) [@tross](https://discourse.julialang.org/u/tross)\
**Post date:** [July 27, 2017, 5:40am UTC](https://discourse.julialang.org/t/building-julia-0-6-0-with-mkl-on-osx-10-12-5/5073/6 "2017-07-27T05:40:12Z")

</div>

Indeed that was the problem there! I now have a new bug:

> LoadError(“sysimg.jl”, 362, LoadError(“sparse/sparse.jl”, 41, LoadError(“sparse/umfpack.jl”, 61, ErrorException(“error compiling anonymous: could not load library "libsuitesparse\_wrapper"\ndlopen(libsuitesparse\_wrapper.dylib, 1): Library not loaded: @rpath/libmkl\_rt.dylib\n Referenced from: /Applications/julia/usr/lib/libcholmod.dylib\n Reason: image not found”))))  
> \*\*\* This error is usually fixed by running `make clean`. If the error persists, try `make cleanall`. \*\*\*  
> make[1]: \*\*\* [/Applications/julia/usr/lib/julia/sys.o] Error 1  
> make: \*\*\* [julia-sysimg-release] Error 2

I have run both `make clean` and `make cleanall` but the error message persists. I thought that perhaps there was something still lingering from my previous build attempts, so I deleted everything and started with a fresh directory. However, I still get this error.

---

<div class="post-metadata">

**Author:** ![tross](https://avatars.discourse-cdn.com/v4/letter/t/97f17d/32.png) [@tross](https://discourse.julialang.org/u/tross)\
**Post date:** [July 29, 2017, 11:30pm UTC](https://discourse.julialang.org/t/building-julia-0-6-0-with-mkl-on-osx-10-12-5/5073/7 "2017-07-29T23:30:59Z")

</div>

Just an update. I tried building with the intel compilers on Ubuntu 16.04.2 LTS and also ran into some problems there, although the errors were unrelated to what I saw in OSX. However, unlike in OSX, I was able to build and install with a Make.user file that just contained `USE_INTEL_MKL = 1`

I am wondering then, are the directions listed in the readme file for building with the intel compilers and MKL no longer valid due to changes in 0.6? Or have I just had a run of bad luck?  
[https://github.com/JuliaLang/julia#intel-compilers-and-math-kernel-library-mkl](https://github.com/JuliaLang/julia#intel-compilers-and-math-kernel-library-mkl)

---

<div class="post-metadata">

**Author:** ![tkelman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkelman/32/692_2.png) [@tkelman](https://discourse.julialang.org/u/tkelman)\
**Post date:** [July 30, 2017, 1:14am UTC](https://discourse.julialang.org/t/building-julia-0-6-0-with-mkl-on-osx-10-12-5/5073/8 "2017-07-30T01:14:49Z")

</div>

Building with Intel compilers is not something we have the infrastructure to test automatically, so it tends to be easy to break by accident.

---

<div class="post-metadata">

**Author:** ![RoyiAvital](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/royiavital/32/571_2.png) [@RoyiAvital](https://discourse.julialang.org/u/RoyiAvital)\
**Post date:** [July 30, 2017, 4:41pm UTC](https://discourse.julialang.org/t/building-julia-0-6-0-with-mkl-on-osx-10-12-5/5073/9 "2017-07-30T16:41:50Z")

</div>

Is it going to change according to this - [ANN: The JuliaPro distribution by Julia Computing - #48 by RoyiAvital](https://discourse.julialang.org/t/ann-the-juliapro-distribution-by-julia-computing/1736/48)?

I know chances are slim and most chances it was about the Pro Version which costs money.  
But better be optimistic :-).
