-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathfedora.sh
More file actions
executable file
·68 lines (60 loc) · 2.34 KB
/
Copy pathfedora.sh
File metadata and controls
executable file
·68 lines (60 loc) · 2.34 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
#!/usr/bin/env bash
# Fedora 40+ / RHEL 9 / Rocky 9 / Alma 9. RHEL-family needs EPEL for shellcheck.
set -euo pipefail
ENABLE_CUDA="${ENABLE_CUDA:-false}"
ENABLE_SYCL="${ENABLE_SYCL:-false}"
INSTALL_LINTERS="${INSTALL_LINTERS:-true}"
need_sudo() { [[ $EUID -ne 0 ]] && echo "sudo" || echo ""; }
SUDO="$(need_sudo)"
# Detect Fedora vs RHEL-family for EPEL handling.
# shellcheck disable=SC1091 # /etc/os-release is a system file, not in-repo
. /etc/os-release
if [[ "$ID" != "fedora" ]]; then
$SUDO dnf install -y epel-release
fi
echo "=== Fedora/RHEL setup for vmaf fork ==="
$SUDO dnf groupinstall -y "Development Tools"
$SUDO dnf install -y \
clang clang-tools-extra cppcheck \
meson ninja-build nasm pkgconf-pkg-config \
python3 python3-pip python3-virtualenv \
git curl wget \
doxygen \
ffmpeg-devel \
shellcheck
if [[ "$INSTALL_LINTERS" == "true" ]]; then
if ! command -v shfmt >/dev/null; then
# Pin the explicit version URL — /releases/latest/download/ 404s once
# upstream tags a newer version since the filename embeds the version.
SHFMT_VERSION="v3.9.0"
$SUDO curl -fsSL -o /usr/local/bin/shfmt \
"https://github.com/mvdan/sh/releases/download/${SHFMT_VERSION}/shfmt_${SHFMT_VERSION}_linux_amd64"
$SUDO chmod +x /usr/local/bin/shfmt
fi
python3 -m pip install --user --upgrade \
pre-commit ruff black isort mypy semgrep
fi
if [[ "$ENABLE_CUDA" == "true" ]]; then
# RPM Fusion nonfree contains cuda for Fedora; on RHEL, use NVIDIA's repo.
$SUDO dnf config-manager --add-repo "https://developer.download.nvidia.com/compute/cuda/repos/fedora${VERSION_ID}/x86_64/cuda-fedora${VERSION_ID}.repo" || true
$SUDO dnf install -y cuda-toolkit
echo "Note: export PATH=/usr/local/cuda/bin:\$PATH"
fi
if [[ "$ENABLE_SYCL" == "true" ]]; then
# Intel oneAPI yum repo.
$SUDO tee /etc/yum.repos.d/oneAPI.repo >/dev/null <<'EOF'
[oneAPI]
name=Intel(R) oneAPI repository
baseurl=https://yum.repos.intel.com/oneapi
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://yum.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
EOF
$SUDO dnf install -y intel-oneapi-compiler-dpcpp-cpp intel-oneapi-runtime-libs \
level-zero-devel libva-devel
echo "Then: source /opt/intel/oneapi/setvars.sh"
fi
echo ""
echo "=== done. next steps ==="
echo " meson setup build -Denable_cuda=$ENABLE_CUDA -Denable_sycl=$ENABLE_SYCL"