Files
runner-images/images/ubuntu/scripts/build/install-julia.sh
T

25 lines
1.1 KiB
Bash
Raw Normal View History

2020-10-07 13:49:40 +05:00
#!/bin/bash -e
2020-02-09 19:37:43 +01:00
################################################################################
2023-11-22 21:49:23 +01:00
## File: install-julia.sh
## Desc: Install Julia and add to the path
2020-02-09 19:37:43 +01:00
################################################################################
# Source the helpers for use with the script
source $HELPER_SCRIPTS/install.sh
2020-02-11 14:01:38 +01:00
# get the latest julia version
2023-07-28 20:18:41 +02:00
json=$(curl -fsSL "https://julialang-s3.julialang.org/bin/versions.json")
julia_version=$(echo $json | jq -r '.[].files[] | select(.triplet=="x86_64-linux-gnu" and (.version | contains("-") | not)).version' | sort -V | tail -n1)
2020-02-11 14:01:38 +01:00
# download julia archive
julia_tar_url=$(echo $json | jq -r ".[].files[].url | select(endswith(\"julia-${julia_version}-linux-x86_64.tar.gz\"))")
julia_archive_path=$(download_with_retry "$julia_tar_url")
2020-02-09 19:37:43 +01:00
# extract files and make symlink
julia_installation_path="/usr/local/julia${julia_version}"
mkdir -p "${julia_installation_path}"
tar -C "${julia_installation_path}" -xzf "$julia_archive_path" --strip-components=1
ln -s "${julia_installation_path}/bin/julia" /usr/bin/julia
2020-02-11 14:01:38 +01:00
invoke_tests "Tools" "Julia"