-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprereq_install_ubuntu.sh
More file actions
executable file
·92 lines (77 loc) · 2.31 KB
/
Copy pathprereq_install_ubuntu.sh
File metadata and controls
executable file
·92 lines (77 loc) · 2.31 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#!/usr/bin/env bash
# prereq_install_ubuntu.sh
# Install all the packages needed to install srcML from source on Ubuntu 24.04.
# Always installs CMake from Kitware's apt repo.
set -euo pipefail
# ---------- Config ----------
UBUNTU_CODENAME="${UBUNTU_CODENAME:-noble}"
# ---------- Helpers ----------
require_cmd() {
if ! command -v "$1" >/dev/null 2>&1; then
echo "✗ Missing required command: $1" >&2
exit 1
fi
}
# ---------- Begin ----------
echo ""
echo "=== [1/7] Checking prerequisites ==="
require_cmd sudo
echo "✓ sudo is available"
echo ""
echo "=== [2/7] Installing system dependencies ==="
sudo apt-get update -y
echo "✓ apt cache updated"
sudo apt-get install openjdk-11-jdk-headless -y
echo "✓ OpenJDK 11 installed"
sudo apt-get install --no-install-recommends -y \
ca-certificates \
ccache \
cpio \
curl \
dpkg-dev \
file \
g++ \
git \
libarchive-dev \
libboost-all-dev \
libcurl4-openssl-dev \
libxml2-dev \
libxml2-utils \
libxslt1-dev \
make \
man \
ninja-build \
tree \
valgrind \
zip
echo "✓ Core build tools and libraries installed"
echo ""
echo "=== [3/7] Installing prerequisites for Kitware repo ==="
sudo apt-get update -y
sudo apt-get install gpg wget --no-install-recommends -y
echo "✓ gpg and wget installed"
echo ""
echo "=== [4/7] Adding Kitware signing key ==="
wget -O- https://apt.kitware.com/keys/kitware-archive-latest.asc |
sudo gpg --dearmor |
sudo tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
echo "✓ Kitware GPG key installed"
echo ""
echo "=== [5/7] Adding Kitware apt repository (${UBUNTU_CODENAME}) ==="
echo "deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ ${UBUNTU_CODENAME} main" |
sudo tee /etc/apt/sources.list.d/kitware.list >/dev/null
echo "✓ Kitware repo added"
echo ""
echo "=== [6/7] Updating apt and installing repository key package ==="
sudo apt-get update -y
sudo apt-get install kitware-archive-keyring -y
echo "✓ kitware-archive-keyring installed"
echo ""
echo "=== [7/7] Installing latest CMake from Kitware ==="
sudo apt-get update -y
sudo apt-get install cmake --no-install-recommends -y
echo "✓ CMake installed from Kitware repo"
echo ""
echo "=== Installation Complete ==="
echo "Ubuntu dependencies + Kitware CMake successfully installed."
echo ""