# Cannot build Julia v0.6.1 on OSX 10.12.6

**URL:** <https://discourse.julialang.org/t/cannot-build-julia-v0-6-1-on-osx-10-12-6/6679>\
**Category:** Internals & Design\
**Tags:** build, compilation\
**Created:** [October 25, 2017, 2:43pm UTC](https://discourse.julialang.org/t/cannot-build-julia-v0-6-1-on-osx-10-12-6/6679 "2017-10-25T14:43:12Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Federico\_Calboli](https://avatars.discourse-cdn.com/v4/letter/f/c0e974/32.png) [@Federico\_Calboli](https://discourse.julialang.org/u/Federico_Calboli)\
**Post date:** [October 25, 2017, 2:43pm UTC](https://discourse.julialang.org/t/cannot-build-julia-v0-6-1-on-osx-10-12-6/6679/1 "2017-10-25T14:43:12Z")

</div>

Hi All,

today I tried a fresh install with

git clone git://github.com/JuliaLang/julia.git  
cd julia  
git checkout v0.6.1  
make

…  
ld: library not found for -lSystem  
collect2: error: ld returned 1 exit status  
make[4]: \*\*\* [testlsame] 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]: \*\*\* [scratch/openblas-85636ff1a015d04d3a8f960bc644b85ee5157135/build-compiled] Error 1  
make: \*\*\* [julia-deps] Error 2

which cannot be solved (I tried the suggestions). I have MacOS 10.12.3, XCode 9.01 with all bits and bobs, gfortran is GNU Fortran 7.2.0 form homebrew.

I fail to understand what is going on

---

<div class="post-metadata">

**Author:** ![Elrod](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/elrod/32/22461_2.png) [@Elrod](https://discourse.julialang.org/u/Elrod)\
**Post date:** [October 25, 2017, 6:01pm UTC](https://discourse.julialang.org/t/cannot-build-julia-v0-6-1-on-osx-10-12-6/6679/2 "2017-10-25T18:01:18Z")

</div>

I was trying to build from source last night on Linux, and didn’t realize there was now a v0.6.1. But I had the same error.  
I got around it by cloning, building, and installing [OpenBLAS](https://github.com/xianyi/OpenBLAS). Then returning to Julia, creatrf the file Make.user with the following lines:

```julia
USE_SYSTEM_BLAS=1
LIBBLAS=-lopenblas
LIBBLASNAME=libopenblas

```

as described in Linux troubleshooting. Even though you’re on a Mac, given that your error is in building OpenBLAS, if you can just get it on your system and then use system BLAS you should be fine.

---

<div class="post-metadata">

**Author:** ![Federico\_Calboli](https://avatars.discourse-cdn.com/v4/letter/f/c0e974/32.png) [@Federico\_Calboli](https://discourse.julialang.org/u/Federico_Calboli)\
**Post date:** [October 25, 2017, 7:06pm UTC](https://discourse.julialang.org/t/cannot-build-julia-v0-6-1-on-osx-10-12-6/6679/3 "2017-10-25T19:06:21Z")

</div>

> [@Elrod](#):
>
> I got around it by cloning, building, and installing OpenBLAS. Then returning to Julia, creatrf the file Make.user with the following lines:
> 
> USE\_SYSTEM\_BLAS=1  
> LIBBLAS=-lopenblas  
> LIBBLASNAME=libopenblas
> 
> as described in Linux troubleshooting. Even though you’re on a Mac, given that your error is in building OpenBLAS, if you can just get it on your system and then use system BLAS you should be fine.

because I am lazy, and I do mean it, I was wondering whether there is an option that does not require me to install my own OpenBLAS (or use OSX supplied one, assuming it supplies one), mostly because I would have to baby the darn thing forevermore rather than just clone the latest stable release and `make`. Do not get me wrong, I think you are suggesting a good fix, but let’s see if a less work approach comes up.

---

<div class="post-metadata">

**Author:** ![schmrlng](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/schmrlng/32/2325_2.png) [@schmrlng](https://discourse.julialang.org/u/schmrlng)\
**Post date:** [October 25, 2017, 10:50pm UTC](https://discourse.julialang.org/t/cannot-build-julia-v0-6-1-on-osx-10-12-6/6679/4 "2017-10-25T22:50:33Z")

</div>

Try adding a `Make.user` file in the your julia directory after `git checkout v0.6.1` and before running `make` containing just:

```julia
OPENBLAS_TARGET_ARCH=HASWELL

```

or if your Mac is super old, maybe:

```julia
OPENBLAS_TARGET_ARCH=NEHALEM

```

instead. Presumably putting those options in the command line as suggested is equivalent, but maybe not?

---

<div class="post-metadata">

**Author:** ![Federico\_Calboli](https://avatars.discourse-cdn.com/v4/letter/f/c0e974/32.png) [@Federico\_Calboli](https://discourse.julialang.org/u/Federico_Calboli)\
**Post date:** [October 26, 2017, 9:33am UTC](https://discourse.julialang.org/t/cannot-build-julia-v0-6-1-on-osx-10-12-6/6679/5 "2017-10-26T09:33:39Z")

</div>

> [@schmrlng](#):
>
> Try adding a Make.user file in the your julia directory after git checkout v0.6.1 and before running make containing just:
> 
> OPENBLAS\_TARGET\_ARCH=HASWELL

I tried this (the other option has been already tried and does not work) and it did not work.

---

<div class="post-metadata">

**Author:** ![Federico\_Calboli](https://avatars.discourse-cdn.com/v4/letter/f/c0e974/32.png) [@Federico\_Calboli](https://discourse.julialang.org/u/Federico_Calboli)\
**Post date:** [October 26, 2017, 11:58am UTC](https://discourse.julialang.org/t/cannot-build-julia-v0-6-1-on-osx-10-12-6/6679/6 "2017-10-26T11:58:04Z")

</div>

I gave up and went with the brew cast approach – life is too short for this kind of malarky.
