Skip to content

Instantly share code, notes, and snippets.

@terasakisatoshi

terasakisatoshi/Make.user

Last active Aug 6, 2020
Embed
What would you like to do?
Build Julia for RaspberryPi Zero
apt-get update
apt-get install build-essential libatomic1 python gfortran perl wget m4 cmake pkg-config git
apt install libopenblas-base libopenblas-dev
apt install libatlas3-base libatlas-base-dev
apt install liblapack-dev
apt install libmpfr-dev libgmp3-dev
apt install libgfortran3
git clone --depth=1 -b v1.1.0 https://github.com/JuliaLang/julia.git julia
cp Make.user julia
cd julia && make OPENBLAS_USE_THREAD=0 -j 40
sudo rm -rf julia
sudo docker run --rm -it -v $PWD:/home/pi/work -w /home/pi/work balenalib/raspberry-pi:stretch bash build.sh
JULIA_CPU_TARGET=arm1176jzf-s
prefix=/home/pi/work/julia-1.1.0
override USE_SYSTEM_BLAS=1
override USE_SYSTEM_LAPACK=1
override USE_SYSTEM_LIBM=1
override USE_SYSTEM_GMP=1
override USE_SYSTEM_MPFR=1
@terasakisatoshi

This comment has been minimized.

Copy link
Owner Author

@terasakisatoshi terasakisatoshi commented Apr 19, 2019

Usage

build Julia from source

  • install docker and docker-machine

  • pull base image of PiZero series

$ docker pull balenalib/raspberry-pi:stretch
  • just do it:
$ ls
build.sh doit.sh Make.user
$ bash doit.sh

It will generate julia-1.1.0 that contains Julia binary or runtime as same as you can get from https://julialang.org/downloads/

install julia on your RaspberryPi

copy julia-1.1.0 into your RaspberryPi e.g. using scp

# your main machine other than RaspberryPi
scp -r julia-1.1.0 pi@raspberrypi.local/home/pi

On your RaspberryPi, Install packages as same as that written in build.sh

$ sudo su (or you can type sudo apt install ....)
# apt-get update
# apt-get install build-essential libatomic1 python gfortran perl wget m4 cmake pkg-config git 

# apt install libopenblas-base libopenblas-dev
# apt install libatlas3-base libatlas-base-dev
# apt install liblapack-dev
# apt install libmpfr-dev libgmp3-dev
# apt install libgfortran3

Finally, add Julia's path at .bashrc. That's all.

Reference

Binary

here is my google drive link that provides julia (v1.1.0) binary (NOT OFFICIAL) for Raspberry Pi series.

@terasakisatoshi

This comment has been minimized.

Copy link
Owner Author

@terasakisatoshi terasakisatoshi commented May 1, 2019

License

This instruction how to build julia is licensed under the terms of MIT License.

@terasakisatoshi

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.