# Build trouble on Ubuntu 17.10

**URL:** https://discourse.julialang.org/t/build-trouble-on-ubuntu-17-10/9076
**Category:** Internals & Design
**Tags:** build
**Created:** [February 15, 2018, 4:23am UTC](https://discourse.julialang.org/t/build-trouble-on-ubuntu-17-10/9076 "2018-02-15T04:23:02Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![preda](https://avatars.discourse-cdn.com/v4/letter/p/f4b2a3/32.png) [@preda](https://discourse.julialang.org/u/preda)
#### Post date: [February 15, 2018, 4:23am UTC](https://discourse.julialang.org/t/build-trouble-on-ubuntu-17-10/9076/1 "2018-02-15T04:23:02Z")

</div>

From fresh checked-out master source, “make” produces:

test\_potrs.o: In function `__ctest_potrf_bug_695_run': test_potrs.c:(.text+0xc4): undefined reference to `zpotrs\_’  
collect2: error: ld returned 1 exit status  
Makefile:21: recipe for target ‘openblas\_utest’ failed  
make[3]: \*\*\* [openblas\_utest] Error 1  
Makefile:116: recipe for target ‘tests’ failed  
make[2]: \*\*\* [tests] 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. \*\*\*  
/home/preda/julia/deps/blas.mk:88: recipe for target ‘scratch/openblas-5dde4e65d321076582a2fafe16949d2160551e81/build-compiled’ failed  
make[1]: \*\*\* [scratch/openblas-5dde4e65d321076582a2fafe16949d2160551e81/build-compiled] Error 1  
Makefile:83: recipe for target ‘julia-deps’ failed  
make: \*\*\* [julia-deps] Error 2

---

<div class="post-metadata">

### Author: ![jkbest2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jkbest2/32/7350_2.png) [@jkbest2](https://discourse.julialang.org/u/jkbest2)
#### Post date: [February 15, 2018, 5:30am UTC](https://discourse.julialang.org/t/build-trouble-on-ubuntu-17-10/9076/2 "2018-02-15T05:30:58Z")

</div>

I just ran into this. Check the [Required Build Tools and External Libraries](https://github.com/julialang/julia#required-build-tools-and-external-libraries) to make sure they’re all installed (via `apt-get` or equivalent). There were still a couple missing after I installed `build-essential`, including `gfortran`.

Otherwise, try doing what the error says, though it didn’t seem to help me:

```nohighlight
*** 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. ***

```

---

<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: [February 15, 2018, 10:41am UTC](https://discourse.julialang.org/t/build-trouble-on-ubuntu-17-10/9076/3 "2018-02-15T10:41:00Z")

</div>

I had OpenBLAS-related build trouble a few days ago. While the errors were different, I did finally resolve it via simply installing OpenBLAS separately and then using system BLAS.  
Just create a `Make.user` with lines like:

```julia
USE_SYSTEM_BLAS=1
USE_SYSTEM_LAPACK=1
LIBBLAS=-lopenblas
LIBBLASNAME=libopenblas
LIBLAPACK=-lopenblas
LIBLAPACKNAME=libopenblas

```

The easiest way to get openblas of course is just `sudo apt-get install libopenblas-dev`.  
But I’ve also found that checking out OpenBLAS and building from source: [https://github.com/xianyi/OpenBLAS](https://github.com/xianyi/OpenBLAS)  
is a lot less prone to throwing errors and easier to debug than letting Julia build it.  
If you’d like “inspiration” on what flags to use, you can look at:  
[https://github.com/JuliaLang/julia/blob/master/deps/blas.mk](https://github.com/JuliaLang/julia/blob/master/deps/blas.mk)

---

<div class="post-metadata">

### Author: ![preda](https://avatars.discourse-cdn.com/v4/letter/p/f4b2a3/32.png) [@preda](https://discourse.julialang.org/u/preda)
#### Post date: [February 15, 2018, 1:15pm UTC](https://discourse.julialang.org/t/build-trouble-on-ubuntu-17-10/9076/4 "2018-02-15T13:15:48Z")

</div>

So, were you able to fix this problem?

---

<div class="post-metadata">

### Author: ![preda](https://avatars.discourse-cdn.com/v4/letter/p/f4b2a3/32.png) [@preda](https://discourse.julialang.org/u/preda)
#### Post date: [February 15, 2018, 1:15pm UTC](https://discourse.julialang.org/t/build-trouble-on-ubuntu-17-10/9076/5 "2018-02-15T13:15:51Z")

</div>

OK, just doing a clean of OpenBLAS as instructed fixes it:  
make -C deps clean-openblas

---

<div class="post-metadata">

### Author: ![jkbest2](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jkbest2/32/7350_2.png) [@jkbest2](https://discourse.julialang.org/u/jkbest2)
#### Post date: [February 15, 2018, 3:19pm UTC](https://discourse.julialang.org/t/build-trouble-on-ubuntu-17-10/9076/6 "2018-02-15T15:19:54Z")

</div>

Yes. In my case I was on a new Ubuntu install and was missing a couple of the required programs. It compiled fine once I installed them. I think I ran ‘make clean‘ to be safe.
