-
Notifications
You must be signed in to change notification settings - Fork 0
/
packages.sh
executable file
·41 lines (39 loc) · 1.27 KB
/
packages.sh
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
41
#!/bin/bash
install_julia_executable() {
local JULIA_VERSION="1.7"
local JULIA_PATCH="3"
local JULIA_MACHINE
JULIA_MACHINE=$(uname -m)
local STOW_DIR=/usr/local/stow
case ${JULIA_MACHINE} in
x86_64)
JULIA_ARCH="x64"
;;
aarch64)
JULIA_ARCH="aarch64"
;;
*)
echo "No julia configuration known for machine=${JULIA_MACHINE}"
return
;;
esac
JULIA_BASE_URL="https://julialang-s3.julialang.org/bin/linux/${JULIA_ARCH}/${JULIA_VERSION}/"
JULIA_ARCHIVE="julia-${JULIA_VERSION}.${JULIA_PATCH}-linux-${JULIA_MACHINE}.tar.gz"
cd /tmp || (echo "Unable to cd /tmp" && return)
curl -O "${JULIA_BASE_URL}${JULIA_ARCHIVE}"
tar -C ${STOW_DIR} -xzf "${JULIA_ARCHIVE}"
stow -d ${STOW_DIR} "julia-${JULIA_VERSION}.${JULIA_PATCH}"
cd - || (echo "Unable to restore working directory" && return)
}
if [ "0" = "$(id -u)" ]; then
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -yq $(grep -vE "^\s*#" packages.txt | tr "\n" " ")
wget -q https://bootstrap.pypa.io/get-pip.py
python3 get-pip.py
pip3 install -r requirements.txt
rm get-pip.py
install_julia_executable
else
echo "Need root permissions"
fi