# Can't build Julia on Raspberry Pi zero locally on Raspbian buster

**URL:** <https://discourse.julialang.org/t/cant-build-julia-on-raspberry-pi-zero-locally-on-raspbian-buster/31378>\
**Category:** New to Julia\
**Tags:** build\
**Created:** [November 22, 2019, 8:17am UTC](https://discourse.julialang.org/t/cant-build-julia-on-raspberry-pi-zero-locally-on-raspbian-buster/31378 "2019-11-22T08:17:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![terasakisatoshi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/terasakisatoshi/32/9187_2.png) [@terasakisatoshi](https://discourse.julialang.org/u/terasakisatoshi)\
**Post date:** [November 22, 2019, 8:17am UTC](https://discourse.julialang.org/t/cant-build-julia-on-raspberry-pi-zero-locally-on-raspbian-buster/31378/1 "2019-11-22T08:17:33Z")

</div>

I try to build Julia on Raspberry Pi(with Raspbian buster) zero without using Docker, but fails.  
For Julia v1.0.5, v1.1.1 and v1.2.0, I get error with the following message:

```julia
In file included from /usr/include/c++/8/utility:70,
                 from /home/pi/build/julia/usr/include/llvm/Support/type_traits.h:19,
                 from /home/pi/build/julia/usr/include/llvm/ADT/SmallPtrSet.h:21,
                 from /home/pi/build/julia/usr/include/llvm/ADT/SmallSet.h:18,
                 from /home/pi/build/julia/src/llvm-alloc-opt.cpp:7:
/usr/include/c++/8/bits/stl_pair.h:208:12: note: 'struct std::pair<const llvm::DomTreeNodeBase<llvm::BasicBlock>*, __gnu_cxx::__ normal_iterator<llvm::DomTreeNodeBase<llvm::BasicBlock>* const*, std::vector<llvm::DomTreeNodeBase<llvm::BasicBlock>*, std::allocator<llvm::DomTreeNodeBase<llvm::BasicBlock>*> > > >' declared here
     struct pair
            ^~~~
    CC src/cgmemmgr.o
    CC src/llvm-api.o
    LINK usr/lib/libjulia.so.1.0
    CC ui/repl.o
    LINK usr/bin/julia
  % Total % Received % Xferd Average Speed Time Time Time Current
                                 Dload Upload Total Spent Left Speed
100 497 100 497 0 0 460 0 0:00:01 0:00:01 --:--:-- 461
100 1321k 100 1321k 0 0 424k 0 0:00:03 0:00:03 --:--:-- 1188k
/home/pi/build/julia/contrib/install.sh 755 /home/pi/build/julia/contrib/julia-config.jl /home/pi/build/julia/usr/share/julia/
PATH=/home/pi/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games:/home/pi/build/julia/usr/tools /home/pi/build/julia/contrib/fixup-libgfortran.sh --verbose /home/pi/build/julia/usr/lib
Discovered traces of libgfortran within 
Got SONAMES of 
    PERL base/build_h.jl.phony
    PERL base/uv_constants.jl
    PERL base/version_git.jl.phony
make[1]: *** [Makefile:168: /home/pi/build/julia/usr/lib/julia/libopenlibm.so] Error 1
make: *** [Makefile:63: julia-base] Error 2

```

Especially I often see building procedure stops around message with respect to `libgfortran` something like:

```julia
/home/pi/build/julia/contrib/install.sh 755 /home/pi/build/julia/contrib/julia-config.jl /home/pi/build/julia/usr/share/julia/
PATH=/home/pi/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games:/home/pi/build/julia/usr/tools /home/pi/build/julia/contrib/fixup-libgfortran.sh --verbose /home/pi/build/julia/usr/lib
Discovered traces of libgfortran within 
Got SONAMES of 

```

Does anyone know to solve the problem?  
Anything is appreciated.

Thank You.

---

<div class="post-metadata">

**Author:** ![Gunter\_Faes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunter_faes/32/12580_2.png) [@Gunter\_Faes](https://discourse.julialang.org/u/Gunter_Faes)\
**Post date:** [November 22, 2019, 8:40am UTC](https://discourse.julialang.org/t/cant-build-julia-on-raspberry-pi-zero-locally-on-raspbian-buster/31378/2 "2019-11-22T08:40:29Z")

</div>

That’s interesting! And sorry, I can’t help you, because I am as helpless as you are!

I’m trying to do something similar, namely run Julia on the nVIDIA Jetson Nano ([here](https://discourse.julialang.org/t/statsplots-precompiling-error/31354)). I’m not the expert, but if I halfway understand the problem, it’s also about a Fortran lib. But the Julia base is [running](https://discourse.julialang.org/t/nvidia-jetson-nano/22053/26) and I could already run some numerical analyses, but without graphics (because of my problem)! I hope you get a helpful answer! 👍

---

<div class="post-metadata">

**Author:** ![terasakisatoshi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/terasakisatoshi/32/9187_2.png) [@terasakisatoshi](https://discourse.julialang.org/u/terasakisatoshi)\
**Post date:** [November 23, 2019, 1:35pm UTC](https://discourse.julialang.org/t/cant-build-julia-on-raspberry-pi-zero-locally-on-raspbian-buster/31378/3 "2019-11-23T13:35:29Z")

</div>

Hi @Gunter_Faes Thank you for your cheering.

[https://github.com/Julia-Embedded/jlcross/blob/master/jetson/multiarch/Dockerfile](https://github.com/Julia-Embedded/jlcross/blob/master/jetson/multiarch/Dockerfile)

will help to support problem. You can simulate Arch device on your host device.

---

<div class="post-metadata">

**Author:** ![Gunter\_Faes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gunter_faes/32/12580_2.png) [@Gunter\_Faes](https://discourse.julialang.org/u/Gunter_Faes)\
**Post date:** [November 23, 2019, 7:48pm UTC](https://discourse.julialang.org/t/cant-build-julia-on-raspberry-pi-zero-locally-on-raspbian-buster/31378/4 "2019-11-23T19:48:26Z")

</div>

Thanks for the tip, I’ll take a look! 😀

---

<div class="post-metadata">

**Author:** ![terasakisatoshi](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/terasakisatoshi/32/9187_2.png) [@terasakisatoshi](https://discourse.julialang.org/u/terasakisatoshi)\
**Post date:** [December 11, 2019, 11:47pm UTC](https://discourse.julialang.org/t/cant-build-julia-on-raspberry-pi-zero-locally-on-raspbian-buster/31378/5 "2019-12-11T23:47:10Z")

</div>

- I will drop it to build julia for 1.2 since Julia Team has been released binary its version = 1.3
- Building Julia works fine for version 1.3 and yesterdays master.

```nohighlight
# Build Julia binary for arm32-bit devices e.g. RaspberryPi Zero(W/WH)
FROM balenalib/raspberry-pi:buster-20191030

MAINTAINER SATOSHI TERASAKI

# install dependencies
RUN apt-get update && \
    apt-get install -y build-essential libatomic1 python gfortran perl wget m4 cmake pkg-config \
    libopenblas-dev \
    liblapack-dev \
    libgmp3-dev \
    libmpfr-dev \
    git

# build julia from source
ARG JL_VERSION="v1.3.0"
ARG WDIR=/home/pi/work
ARG JL_BUILD_DIR=$WDIR/build
WORKDIR $WDIR
RUN echo "\
prefix=$WDIR/julia-$JL_VERSION\n\
JULIA_CPU_TARGET=arm1176jzf-s\n\
LDFLAGS=-latomic\n\
USE_BINARYBUILDER=0\n\
override USE_SYSTEM_BLAS=1\n\
override USE_SYSTEM_LAPACK=1\n\
override USE_SYSTEM_LIBM=1\n\
override USE_SYSTEM_GMP=1\n\
override USE_SYSTEM_MPFR=1\n\
" > Make.user && \
    cat Make.user && \
    git clone --depth=1 -b $JL_VERSION https://github.com/JuliaLang/julia.git $JL_BUILD_DIR &&\
    cp Make.user $JL_BUILD_DIR && \
    cd $JL_BUILD_DIR && make -j $(nproc) OPENBLAS_USE_THREAD=0 && make install

# add path of Julia
ENV PATH=$WDIR/julia-$JL_VERSION/bin:$PATH

# clean up
RUN rm -r $JL_BUILD_DIR $WDIR/Make.user
RUN apt-get clean && rm -rf /var/cache/apt/archives/* /var/lib/apt/lists/*

```
