Created
October 9, 2020 08:40
-
-
Save terasakisatoshi/8a95eb8b676a29ad3f5fe4a717ff3254 to your computer and use it in GitHub Desktop.
Script to Build Julia locally for RaspberryPi4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# Usage: | |
# 1. Copy this file to your raspberry pi e.g. /home/pi | |
# 2. Run this file `bash build_locally.sh` | |
# 3. Tested on Raspberry Pi4 with 4 or 8 GB | |
sudo apt-get update && sudo apt-get install -y \ | |
build-essential libatomic1 python gfortran perl wget m4 cmake pkg-config \ | |
nghttp2 libmbedtls-dev \ | |
git | |
JL_VERSION=master | |
JL_BUILD_DIR=build-julia-${JL_VERSION} | |
# get JL_COMMIT_HASH via `git rev-parse --short HEAD` | |
JL_COMMIT_HASH=8987f7ac6d | |
JL_BUILD_DIR=build-julia-${JL_VERSION}-${JL_COMMIT_HASH} | |
git clone https://github.com/JuliaLang/julia.git $JL_BUILD_DIR && \ | |
cd ${JL_BUILD_DIR} && git checkout ${JL_COMMIT_HASH} && cd .. | |
cat > ${JL_BUILD_DIR}/Make.user << EOF | |
CXXFLAGS=-D_GLIBCXX_USE_CXX11_ABI=0 | |
prefix=/home/pi/julia-${JL_VERSION}-${JL_COMMIT_HASH} | |
USE_BINARYBUILDER=0 | |
LDFLAGS=-latomic | |
CFLAGS += "-mfpu=neon-vfpv4" | |
CXXFLAGS += "-mfpu=neon-vfpv4" | |
MARCH="armv7-a" | |
JULIA_CPU_TARGET="armv7-a\;armv7-a,neon\;armv7-a,neon,vfp4" | |
USE_SYSTEM_NGHTTP2=1 | |
USE_SYSTEM_MBEDTLS=1 | |
EOF | |
cd ${JL_BUILD_DIR} && make -j `nproc` && sudo make install && cd .. |
Have you seen jlcross project ?
Thanks Terasakisatoshi , I've had a look and it looks very interesting - I haven't yet had a chance to try any of the stuff.
Once a 'make' or a 'build' fails - where can I restart the process from - Am I having to reflash a SD Card every time, OR can I just delete the directories I can see - and try again. I think that's my biggest problem.
Cheers for your help
Greg, Liverpool
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi Terasakisatoshi ,
You haven't heard from me - because I haven't managed to get a version of Julia later than 1.0.6 onto my RaspberryPi4. I have tried 'Make' and 'Build' and both get stuck at different stages. Basically I don't know enough about the process to make informed decisions. For example - Once a 'make' fails - do I need to delete the destination directory and re-run it with different settings - Or is there more screwed up elsewhere that once it has failed - only I new Raspbian Image will restore the situation. It is those sorts of questions that I am grabbling with at the moment.
Thanks for your help and interest.
cheers
Greg, Liverpool