#!/usr/bin/env bash # Install build dependencies for dora-zed on Ubuntu 24.04 x86_64 (CUDA 12). # Skips any component that is already installed. # Uses aria2c for fast parallel downloads if available, otherwise falls back to wget. # Downloads are placed in ./tmp relative to this script for inspection. set -euo pipefail ZED_VERSION="5.2" SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" TMP_DIR="${SCRIPT_DIR}/../tmp" mkdir -p "$TMP_DIR" download() { local url="$1" dest="$2" if command -v aria2c &>/dev/null; then aria2c -x 16 -s 16 -d "$(dirname "$dest")" -o "$(basename "$dest")" "$url" else wget -O "$dest" "$url" fi } # --- ZED SDK --- if [ -d /usr/local/zed ]; then echo ">>> ZED SDK already installed at /usr/local/zed — skipping." else echo ">>> Downloading ZED SDK ${ZED_VERSION} for Ubuntu 24.04 (CUDA 12)..." download \ "https://download.stereolabs.com/zedsdk/${ZED_VERSION}/cu12/ubuntu24" \ "${TMP_DIR}/ZED_SDK.run" chmod +x "${TMP_DIR}/ZED_SDK.run" echo ">>> Installing ZED SDK (silent)..." sudo "${TMP_DIR}/ZED_SDK.run" -- silent skip_python skip_tools fi echo ">>> Done. You can now run: scripts/build.sh" echo ">>> Downloaded files are in ${TMP_DIR}"