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

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:

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:

/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.

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). 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 and I could already run some numerical analyses, but without graphics (because of my problem)! I hope you get a helpful answer! :+1:

Hi @Gunter_Faes Thank you for your cheering.

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.

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

1 Like
  • 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.
# 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/*