-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile-master
40 lines (36 loc) · 1.17 KB
/
Dockerfile-master
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
# 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
# build julia from source
ARG JL_VERSION="master"
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 16 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/*