Last active
November 5, 2018 21:56
-
-
Save arlk/a1408a2bdb6b774e176ed0126a801e81 to your computer and use it in GitHub Desktop.
Julia Linux Installer
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 | |
typeset -A julia | |
# specify major.minor version | |
# just grabs most recent patch of non-rc/alpha/beta version (if available) | |
julia[1.0]='julia julia1 julia10' | |
julia[0.7]='julia0 julia07' | |
julia[0.6]='julia06' | |
rm -rf julia-bins | |
for ver in "${!julia[@]}"; do | |
tag=$(git ls-remote --tags https://github.com/JuliaLang/julia.git | awk -F"tags/v" '{print $2}' | grep -v '-' | grep $ver | tail -n 1) | |
if [ "$tag" != "" ]; then | |
dlink="https://julialang-s3.julialang.org/bin/linux/x64/${ver}/julia-${tag}-linux-x86_64.tar.gz" | |
printf "Installing Julia v$tag from \n $dlink \n" | |
mkdir -p julia-bins | |
(cd julia-bins && \ | |
mkdir -p julia-${tag} && \ | |
wget -q -O - ${dlink} | tar xzf - -C julia-${tag} --strip-components 1) | |
for jalias in ${julia[$ver]}; do | |
printf "Creating alias $jalias for version $tag \n" | |
sudo ln -sf ${PWD}/julia-bins/julia-${tag}/bin/julia /usr/local/bin/${jalias} | |
done | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment