Skip to content

Commit

Permalink
CI: install clang dependencies directly from LLVM (#5575)
Browse files Browse the repository at this point in the history
I think this was a suggestion by @WeiqunZhang in the context of
debugging the clang sanitizer issue currently addressed in #5492. I'm
extracting all related changes from #5492 to implement and test the LLVM
installation separately here.

This effectively unifies the CI scripts to install clang dependencies
into one single script that reads the clang version number from the
command line.

I think all CI checks should pass here as a prerequisite for debugging
the clang sanitizer issue further in #5492.
  • Loading branch information
EZoni authored Jan 18, 2025
1 parent e4bdcae commit 1c8d21e
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 82 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/clang_sanitizers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- uses: actions/checkout@v4
- name: install dependencies
run: |
.github/workflows/dependencies/clang17.sh
.github/workflows/dependencies/clang.sh 17
- name: CCache Cache
uses: actions/cache@v4
with:
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
- uses: actions/checkout@v4
- name: install dependencies
run: |
.github/workflows/dependencies/clang17.sh
.github/workflows/dependencies/clang.sh 17
- name: CCache Cache
uses: actions/cache@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/clang_tidy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
- uses: actions/checkout@v4
- name: install dependencies
run: |
.github/workflows/dependencies/clang15.sh
.github/workflows/dependencies/clang.sh 15
- name: set up cache
uses: actions/cache@v4
with:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,45 +1,50 @@
#!/usr/bin/env bash
#
# Copyright 2024 The WarpX Community
# Copyright 2025 The WarpX Community
#
# License: BSD-3-Clause-LBNL
# Authors: Luca Fedeli

set -eu -o pipefail

# `man apt.conf`:
# Number of retries to perform. If this is non-zero APT will retry
# failed files the given number of times.
# `man apt.conf`: number of retries to perform (if non-zero,
# APT will retry failed files the given number of times).
echo 'Acquire::Retries "3";' | sudo tee /etc/apt/apt.conf.d/80-retries

# This dependency file is currently used within a docker container,
# which does not come (among others) with wget, xz-utils, curl, git,
# ccache, and pkg-config pre-installed.
sudo apt-get -qqq update
sudo apt-get update
sudo apt-get install -y \
cmake \
clang-17 \
clang-tidy-17 \
libblas-dev \
libc++-17-dev \
libboost-math-dev \
libfftw3-dev \
libfftw3-mpi-dev \
libhdf5-openmpi-dev \
liblapack-dev \
libopenmpi-dev \
libomp-17-dev \
ninja-build \
wget \
xz-utils \
curl \
git \
ccache \
pkg-config
ninja-build

# Use clang 17
export CXX=$(which clang++-17)
export CC=$(which clang-17)
# parse clang version number from command line
version_number=${1}

# add LLVM repository and install clang tools
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh ${version_number}

# install clang, clang-tidy, and
# LLVM implementations of C++ standard library and OpenMP
sudo apt-get update
sudo apt-get install -y \
clang-${version_number} \
clang-tidy-${version_number} \
libc++-${version_number}-dev \
libomp-${version_number}-dev

# export compiler flags
export CXX=$(which clang++-${version_number})
export CC=$(which clang-${version_number})

# ccache
$(dirname "$0")/ccache.sh

# cmake-easyinstall
#
Expand Down
56 changes: 0 additions & 56 deletions .github/workflows/dependencies/clang15.sh

This file was deleted.

0 comments on commit 1c8d21e

Please sign in to comment.