# Building julia on MacOS 10.12.2

**URL:** https://discourse.julialang.org/t/building-julia-on-macos-10-12-2/1065
**Category:** New to Julia
**Created:** [December 20, 2016, 6:02pm UTC](https://discourse.julialang.org/t/building-julia-on-macos-10-12-2/1065 "2016-12-20T18:02:44Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![ecx2093](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ecx2093/32/5623_2.png) [@ecx2093](https://discourse.julialang.org/u/ecx2093)
#### Post date: [December 20, 2016, 6:02pm UTC](https://discourse.julialang.org/t/building-julia-on-macos-10-12-2/1065/1 "2016-12-20T18:02:44Z")

</div>

I have been trying to build julia from source on my mac so that I can use Clang.jl but i have been running into the following error message:

> gfortran: error trying to exec ‘f951’: execvp: No such file or directory  
> make[4]: \*\*\* [slamch.o] Error 1  
> make[3]: \*\*\* [lapack\_install] Error 2  
> make[2]: \*\*\* [netlib] Error 2  
> \*\*\* Clean the OpenBLAS build with ‘make -C deps clean-openblas’. Rebuild with ‘make OPENBLAS\_USE\_THREAD=0’ if OpenBLAS had trouble linking libpthread.so, and with ‘make OPENBLAS\_TARGET\_ARCH=NEHALEM’ if there were errors building SandyBridge support. Both these options can also be used simultaneously. \*\*\*  
> make[1]: \*\*\* [build/openblas-12ab1804b6ebcd38b26960d65d254314d8bc33d6/libopenblas64\_.dylib] Error 1  
> make: \*\*\* [julia-deps] Error 2

I made sure all the dependencies were installed and I had gcc/gfortran installed with homebrew. Thanks for your help!

---

<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: [December 20, 2016, 11:32pm UTC](https://discourse.julialang.org/t/building-julia-on-macos-10-12-2/1065/2 "2016-12-20T23:32:11Z")

</div>

Possibly a corrupted homebrew install. See if `brew doctor` turns anything up, and potentially re-run the gcc/gfortran installation.

> <https://stackoverflow.com/questions/28198444/why-cant-i-compile-with-gfortran-after-upgrading-to-osx-yosemite-gfortran-erro>

---

<div class="post-metadata">

### Author: ![ecx2093](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ecx2093/32/5623_2.png) [@ecx2093](https://discourse.julialang.org/u/ecx2093)
#### Post date: [December 28, 2016, 5:41pm UTC](https://discourse.julialang.org/t/building-julia-on-macos-10-12-2/1065/3 "2016-12-28T17:41:15Z")

</div>

Thanks `brew doctor` turned up so many problems I ended up doing a fresh install of macOS 10.12.2 . Then I did an `xcode-select --install`, and used brew to install gcc (for gfortran), pkg-config, and cmake. All other required build tools were already installed. At this point, `brew doctor` didn’t show any problems.

I then followed the instructions in the Julia readme for building from source, and used `git checkout release-0.5` and put BUILD\_LLVM\_CLANG=1 in Make.user inside the julia source folder. I get the following error when running `make`:  
`llvm[6]: Copying runtime library darwin/eprintf to build dir cp: /Users/ecx2093/julia/deps/build/llvm-3.7.1/build_Release/tools/clang/runtime/compiler-rt/clang_darwin/eprintf/libcompiler_rt.a: No such file or directory make[6]: ***[/Users/ecx2093/julia/deps/build/llvm-3.7.1/build_Release/Release/lib/clang/3.7.1/lib/darwin/libclang_rt.eprintf.a] Error 1 make[5]:*** [compiler-rt/.makeinstall] Error 2 make[4]: ***[install] Error 1 make[3]:*** [clang/.makeinstall] Error 2 make[2]: ***[install] Error 1 make[1]:*** [/Users/ecx2093/julia/usr/lib/libLLVMCodeGen.a] Error 2 make: *** [julia-deps] Error 2`  
Julia builds fine if i set BUILD\_LLVM\_CLANG=0. Any thoughts?

---

<div class="post-metadata">

### Author: ![ecx2093](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ecx2093/32/5623_2.png) [@ecx2093](https://discourse.julialang.org/u/ecx2093)
#### Post date: [December 28, 2016, 9:58pm UTC](https://discourse.julialang.org/t/building-julia-on-macos-10-12-2/1065/4 "2016-12-28T21:58:01Z")

</div>

Looks like this issue may be related:

[https://github.com/Keno/Cxx.jl/issues/300](https://github.com/Keno/Cxx.jl/issues/300)

---

<div class="post-metadata">

### Author: ![smores](https://avatars.discourse-cdn.com/v4/letter/s/c6cbf5/32.png) [@smores](https://discourse.julialang.org/u/smores)
#### Post date: [February 2, 2017, 1:47pm UTC](https://discourse.julialang.org/t/building-julia-on-macos-10-12-2/1065/5 "2017-02-02T13:47:56Z")

</div>

Im running into the same issue of building from source

what are the minimun versions of compilers and cmake required  
Ive tried using latest gcc 6.3 and gcc that come as default on the system  
for example  
export CC=/usr/bin/clang  
export CXX=/usr/bin/clang++  
export CPP=/usr/bin/cpp  
export LD=/usr/bin/ld  
alias c++=/usr/bin/c++  
alias g++=/usr/bin/g++  
alias gcc=/usr/bin/clang  
alias cpp=/usr/bin/clang++  
alias cc=/usr/bin/gcc  
alias ld=/usr/bin/ld

I smylink gcc to usr/local/bin  
for the latest packages of the compiler  
neither seems to work  
anything I should be trying

tks  
M

---

<div class="post-metadata">

### Author: ![smores](https://avatars.discourse-cdn.com/v4/letter/s/c6cbf5/32.png) [@smores](https://discourse.julialang.org/u/smores)
#### Post date: [February 2, 2017, 8:23pm UTC](https://discourse.julialang.org/t/building-julia-on-macos-10-12-2/1065/6 "2017-02-02T20:23:15Z")

</div>

make OPENBLAS\_USE\_THREAD=0 OPENBLAS\_TARGET\_ARCH=NEHALEM

seems to have done the trick using a homebrew install of gcc g++ and gfortran  
gcc version 6.3.0 (Homebrew GCC 6.3.0\_1)
