-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile-v1.4.1
44 lines (39 loc) · 1.27 KB
/
Dockerfile-v1.4.1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Build Julia binary for arm32-bit devices e.g. RaspberryPi Zero(W/WH)
FROM balenalib/raspberry-pi:buster-20200518
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 && \
apt-get clean && rm -rf /var/cache/apt/archives/* /var/lib/apt/lists/*
# build julia from source
ARG JL_VERSION="v1.4.1"
ARG WDIR=/home/pi/work
ARG JL_BUILD_DIR=$WDIR/build
WORKDIR $WDIR
RUN echo "\
prefix=/home/pi/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 16 OPENBLAS_USE_THREAD=0 && make install && \
rm -r $JL_BUILD_DIR && \
echo "Done"
# add path of Julia
ENV PATH=/home/pi/julia-$JL_VERSION/bin:$PATH
# runtime test
RUN julia -e "using InteractiveUtils; versioninfo()"
CMD ["julia"]