forked from tenstorrent/tt-umd
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker_install_common.sh
More file actions
71 lines (62 loc) · 2.18 KB
/
docker_install_common.sh
File metadata and controls
71 lines (62 loc) · 2.18 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
#!/bin/bash
# Install essential packages first (required for HTTPS and GPG operations)
apt-get update && apt-get install -y \
ca-certificates \
gnupg \
wget
# Add Kitware repository for latest CMake
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
echo "deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ $OS_CODENAME main" | tee /etc/apt/sources.list.d/kitware.list >/dev/null
# Install build and runtime deps
apt-get update && apt-get install -y \
software-properties-common \
build-essential \
cmake \
ninja-build \
git \
git-lfs \
libhwloc-dev \
libgtest-dev \
libyaml-cpp-dev \
libboost-all-dev \
wget \
yamllint \
python3-dev \
python3-pip \
patchelf \
xxd \
rpm \
dpkg-dev \
fakeroot
# Install Python dependencies
python3 -m pip install --no-cache-dir pytest
# gcc-11 should be available only for ubuntu 22 and not 20
if apt-cache show gcc-11 > /dev/null 2>&1; then
echo "gcc-11 is available. Installing..."
apt-get install -y gcc-11 g++-11
else
echo "gcc-11 is not available in the repository."
fi
# Install clang 13 only on Ubuntu 22.04 (obsolete on 24.04, so skip there).
UBUNTU_VERSION=$(grep VERSION_ID /etc/os-release | cut -d'"' -f2)
if [ "${UBUNTU_VERSION}" = "22.04" ]; then
echo "Installing clang-13 for minimum compiler version testing..."
wget https://apt.llvm.org/llvm.sh && \
chmod u+x llvm.sh && \
./llvm.sh 13 && \
apt install -y libc++-13-dev libc++abi-13-dev
else
echo "Skipping clang-13 (Ubuntu ${UBUNTU_VERSION}); not available or obsolete."
fi
# Install clang 20 as the default compiler.
wget https://apt.llvm.org/llvm.sh && \
chmod u+x llvm.sh && \
./llvm.sh 20 && \
apt install -y libc++-20-dev libc++abi-20-dev && \
ln -s /usr/bin/clang-20 /usr/bin/clang && \
ln -s /usr/bin/clang++-20 /usr/bin/clang++
# Install clang-format
apt install -y clang-format-20 && \
ln -s /usr/bin/clang-format-20 /usr/bin/clang-format
# Install clang-tidy-20
apt-get install -y clang-tidy-20