Skip to content
Snippets Groups Projects
Commit 1002e0d4 authored by Wouter Deconinck's avatar Wouter Deconinck
Browse files

feat: install iwyu in spack

parent 9891f5ea
No related branches found
No related tags found
1 merge request!778feat: install iwyu in spack
...@@ -72,28 +72,39 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \ ...@@ -72,28 +72,39 @@ RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt/lists,sharing=locked <<EOF --mount=type=cache,target=/var/lib/apt/lists,sharing=locked <<EOF
. /etc/os-release . /etc/os-release
mkdir -p /etc/apt/source.list.d mkdir -p /etc/apt/source.list.d
if [ "${ID}" = "ubuntu" ] ; then # GCC version and repository
echo "deb http://ppa.launchpad.net/ubuntu-toolchain-r/ppa/ubuntu/${VERSION_CODENAME} main" > /etc/apt/source.list.d/ubuntu-toolchain.list case ${ID} in
if [ "${VERSION_ID}" = "20.04" ] ; then GCC="-10" CLANG="-12" ; fi debian)
if [ "${VERSION_ID}" = "22.04" ] ; then GCC="-12" CLANG="-14" ; fi case ${VERSION_CODENAME} in
curl -s https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - bookworm) GCC="-12" ;;
echo "deb http://apt.llvm.org/${VERSION_CODENAME} llvm-toolchain-${VERSION_CODENAME}${CLANG} main" > /etc/apt/source.list.d/llvm.list trixie) GCC="-13" ;;
apt-get -yqq update *) echo "Unsupported VERSION_CODENAME=${VERSION_CODENAME}" ; exit 1 ;;
apt-get -yqq install gcc${GCC} g++${GCC} gfortran${GCC} esac ;;
apt-get -yqq install clang${CLANG} clang-tidy${CLANG} clang-format${CLANG} ubuntu)
apt-get -yqq install iwyu echo "deb http://ppa.launchpad.net/ubuntu-toolchain-r/ppa/ubuntu/${VERSION_CODENAME} main" > /etc/apt/source.list.d/ubuntu-toolchain.list
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc${GCC} 100 case ${VERSION_CODENAME} in
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++${GCC} 100 focal) GCC="-10" ;;
update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran${GCC} 100 jammy) GCC="-12" ;;
update-alternatives --install /usr/bin/clang clang /usr/bin/clang${CLANG} 100 *) echo "Unsupported VERSION_CODENAME=${VERSION_CODENAME}" ; exit 1 ;;
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++${CLANG} 100 esac ;;
else *) echo "Unsupported ID=${ID}" ; exit 1 ;;
apt-get -yqq update esac
apt-get -yqq install gcc g++ gfortran # Clang version and repository
apt-get -yqq install clang clang-tidy clang-format CLANG="-14"
apt-get -yqq install iwyu curl -s https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
fi echo "deb http://apt.llvm.org/${VERSION_CODENAME} llvm-toolchain-${VERSION_CODENAME}${CLANG} main" > /etc/apt/source.list.d/llvm.list
# Install packages
apt-get -yqq update
apt-get -yqq install gcc${GCC} g++${GCC} gfortran${GCC}
apt-get -yqq install clang${CLANG} clang-tidy${CLANG} clang-format${CLANG} libclang${CLANG}-dev
apt-get -yqq autoremove apt-get -yqq autoremove
# Ensure alternatives without version tags
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc${GCC} 100
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++${GCC} 100
update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran${GCC} 100
update-alternatives --install /usr/bin/clang clang /usr/bin/clang${CLANG} 100
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++${CLANG} 100
# Check versions
gcc --version gcc --version
clang --version clang --version
EOF EOF
...@@ -35,6 +35,7 @@ spack: ...@@ -35,6 +35,7 @@ spack:
- heppdt - heppdt
- imagemagick - imagemagick
- irt - irt
- iwyu
- jana2 - jana2
- lcov - lcov
- lhapdf - lhapdf
......
...@@ -142,6 +142,9 @@ packages: ...@@ -142,6 +142,9 @@ packages:
irt: irt:
require: require:
- '@1.0.7' - '@1.0.7'
iwyu:
require:
- '@0.18'
jana2: jana2:
require: require:
- '@2.1.1' - '@2.1.1'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment