Files
TheRock/rocm-systems/projects/rocprofiler-systems/external/timemory/scripts/linux-ci.sh
T
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

147 lines
5.9 KiB
Bash
Executable File

#!/bin/bash -e
# function for running command verbosely
run-verbose()
{
echo -e "\n\t##### Running : '$@'... #####\n"
eval "${@}"
}
# enable manpages to be installed
# sed -i 's/path-exclude/# path-exclude/g' /etc/dpkg/dpkg.cfg.d/excludes
DISTRIB_CODENAME=$(cat /etc/lsb-release | grep DISTRIB_CODENAME | awk -F '=' '{print $NF}')
#-----------------------------------------------------------------------------#
#
# apt configuration
#
#-----------------------------------------------------------------------------#
run-verbose apt-get update
run-verbose apt-get install -y software-properties-common wget curl
# test
# run-verbose add-apt-repository -u -y ppa:ubuntu-toolchain-r/test
# cmake
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc | apt-key add -
apt-add-repository -y "deb https://apt.kitware.com/ubuntu/ ${DISTRIB_CODENAME} main"
# llvm
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
cat << EOF > /etc/apt/sources.list.d/llvm-toolchain.list
# 9
deb http://apt.llvm.org/${DISTRIB_CODENAME}/ llvm-toolchain-${DISTRIB_CODENAME}-9 main
deb-src http://apt.llvm.org/${DISTRIB_CODENAME}/ llvm-toolchain-${DISTRIB_CODENAME}-9 main
# 10
deb http://apt.llvm.org/${DISTRIB_CODENAME}/ llvm-toolchain-${DISTRIB_CODENAME}-10 main
deb-src http://apt.llvm.org/${DISTRIB_CODENAME}/ llvm-toolchain-${DISTRIB_CODENAME}-10 main
# 11
deb http://apt.llvm.org/${DISTRIB_CODENAME}/ llvm-toolchain-${DISTRIB_CODENAME}-11 main
deb-src http://apt.llvm.org/${DISTRIB_CODENAME}/ llvm-toolchain-${DISTRIB_CODENAME}-11 main
# 12
deb http://apt.llvm.org/${DISTRIB_CODENAME}/ llvm-toolchain-${DISTRIB_CODENAME}-12 main
deb-src http://apt.llvm.org/${DISTRIB_CODENAME}/ llvm-toolchain-${DISTRIB_CODENAME}-12 main
# 13
deb http://apt.llvm.org/${DISTRIB_CODENAME}/ llvm-toolchain-${DISTRIB_CODENAME}-13 main
deb-src http://apt.llvm.org/${DISTRIB_CODENAME}/ llvm-toolchain-${DISTRIB_CODENAME}-13 main
# dev
deb http://apt.llvm.org/${DISTRIB_CODENAME}/ llvm-toolchain-${DISTRIB_CODENAME} main
EOF
# upgrade
run-verbose apt-get update
# run-verbose apt-get dist-upgrade -y
#-----------------------------------------------------------------------------#
#
# Base packages
#
#-----------------------------------------------------------------------------#
run-verbose apt-get install -y build-essential git-core ssed cmake ninja-build
CUDA_VER=$(dpkg --get-selections | grep cuda-cudart- | awk '{print $1}' | tail -n 1 | sed 's/cuda-cudart-//g' | sed 's/dev-//g')
#-----------------------------------------------------------------------------#
#
# CUDA nsight tools
#
#-----------------------------------------------------------------------------#
if [ -n "${CUDA_VER}" ]; then
run-verbose apt-get install -y cuda-nsight-{compute,systems}-${CUDA_VER}
fi
#-----------------------------------------------------------------------------#
# UPDATE ALTERNATIVES -- GCC
#-----------------------------------------------------------------------------#
priority=10
for i in 5 6 7 8 9 10 11 12 13 14 ${GCC_VERSION}
do
if [ -n "$(which gcc-${i})" ]; then
run-verbose update-alternatives --install $(which gcc) gcc $(which gcc-${i}) ${priority} \
--slave $(which g++) g++ $(which g++-${i})
priority=$(( ${priority}+10 ))
fi
done
#-----------------------------------------------------------------------------#
# UPDATE ALTERNATIVES -- CLANG
#-----------------------------------------------------------------------------#
priority=10
for i in 5.0 6.0 7.0 7 8 9 10 11 12 13 14 15 ${CLANG_VERSION}
do
if [ -n "$(which clang-${i})" ]; then
run-verbose update-alternatives --install /usr/bin/clang clang $(which clang-${i}) ${priority}
run-verbose update-alternatives --install /usr/bin/clang++ clang++ $(which clang++-${i}) ${priority}
priority=$(( ${priority}+10 ))
fi
done
#-----------------------------------------------------------------------------#
# UPDATE ALTERNATIVES -- cc/c++
#-----------------------------------------------------------------------------#
priority=10
if [ -n "$(which clang)" ]; then
run-verbose update-alternatives --install $(which cc) cc $(which clang) ${priority}
run-verbose update-alternatives --install $(which c++) c++ $(which clang++) ${priority}
priority=$(( ${priority}+10 ))
fi
if [ -n "$(which gcc)" ]; then
run-verbose update-alternatives --install $(which cc) cc $(which gcc) ${priority}
run-verbose update-alternatives --install $(which c++) c++ $(which g++) ${priority}
priority=$(( ${priority}+10 ))
fi
if [ -d /opt/intel ]; then
export PATH=/opt/intel/bin:${PATH}
if [ -n "$(which icc)" ]; then
run-verbose update-alternatives --install $(which cc) cc $(which icc) ${priority}
run-verbose update-alternatives --install $(which c++) c++ $(which icpc) ${priority}
priority=$(( ${priority}+10 ))
fi
fi
#-----------------------------------------------------------------------------#
# UPDATE ALTERNATIVES -- CUDA compilers
#-----------------------------------------------------------------------------#
priority=10
for i in clang++-{7.0,7,8,9,10,11,12,13,14,${CLANG_VERSION}} nvcc
do
if [ -n "$(which ${i})" ]; then
run-verbose update-alternatives --install /usr/bin/cu cu $(which ${i}) ${priority}
fi
done
#-----------------------------------------------------------------------------#
# CONDA
#-----------------------------------------------------------------------------#
# wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
# bash miniconda.sh -b -p /opt/conda
# export PATH="/opt/conda/bin:${PATH}"
# conda config --set always_yes yes --set changeps1 yes
# conda update -c defaults -n base conda
# conda install -n base -c defaults -c conda-forge python=3.6 pyctest cmake scikit-build numpy matplotlib pillow ipykernel jupyter
# source activate
# python -m ipykernel install --name base --display-name base
# conda clean -a -y
# conda config --set always_yes no