Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] CI tests: use ubuntu 24.04 for clang tidy and clang sanitizer tests #5352

Open
wants to merge 11 commits into
base: development
Choose a base branch
from
74 changes: 34 additions & 40 deletions .github/workflows/clang_sanitizers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ concurrency:
jobs:
build_UB_sanitizer:
name: Clang UB sanitizer
runs-on: ubuntu-22.04
container: ubuntu:23.10
runs-on: ubuntu-24.04
if: github.event.pull_request.draft == false
env:
CC: clang
Expand All @@ -27,7 +26,7 @@ jobs:
- uses: actions/checkout@v4
- name: install dependencies
run: |
.github/workflows/dependencies/clang17.sh
.github/workflows/dependencies/clang18.sh
- name: CCache Cache
uses: actions/cache@v4
with:
Expand All @@ -42,8 +41,8 @@ jobs:
export CCACHE_MAXSIZE=100M
ccache -z

export CXX=$(which clang++-17)
export CC=$(which clang-17)
export CXX=$(which clang++-18)
export CC=$(which clang-18)
export CXXFLAGS="-fsanitize=undefined,address,pointer-compare -fno-sanitize-recover=all"

cmake -S . -B build \
Expand All @@ -65,10 +64,6 @@ jobs:
- name: run with UB sanitizer
run: |

# We need these two lines because these tests run inside a docker container
export OMPI_ALLOW_RUN_AS_ROOT=1
export OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1

export OMP_NUM_THREADS=2

#MPI implementations often leak memory
Expand All @@ -81,8 +76,7 @@ jobs:

build_thread_sanitizer:
name: Clang thread sanitizer
runs-on: ubuntu-22.04
container: ubuntu:23.10
runs-on: ubuntu-24.04
if: github.event.pull_request.draft == false
env:
CC: clang
Expand All @@ -93,7 +87,7 @@ jobs:
- uses: actions/checkout@v4
- name: install dependencies
run: |
.github/workflows/dependencies/clang17.sh
.github/workflows/dependencies/clang18.sh
- name: CCache Cache
uses: actions/cache@v4
with:
Expand All @@ -108,35 +102,39 @@ jobs:
export CCACHE_MAXSIZE=100M
ccache -z

export CXX=$(which clang++-17)
export CC=$(which clang-17)
export CXX=$(which clang++-18)
export CC=$(which clang-18)
export CXXFLAGS="-fsanitize=thread"

cmake -S . -B build \
-GNinja \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DWarpX_DIMS="RZ;1;2;3" \
-DWarpX_FFT=ON \
-DWarpX_QED=ON \
-DWarpX_QED_TABLE_GEN=ON \
-DWarpX_OPENPMD=ON \
-DWarpX_EB=OFF \
-DWarpX_PRECISION=DOUBLE \
cmake -S . -B build \
-GNinja \
-DCMAKE_EXE_LINKER_FLAGS="-fsanitize=thread" \
-DCMAKE_SHARED_LINKER_FLAGS="-fsanitize=thread" \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DWarpX_DIMS="RZ;1;2;3" \
-DWarpX_FFT=ON \
-DWarpX_QED=ON \
-DWarpX_QED_TABLE_GEN=ON \
-DWarpX_OPENPMD=ON \
-DWarpX_EB=OFF \
-DWarpX_PRECISION=DOUBLE \
-DWarpX_PARTICLE_PRECISION=DOUBLE
cmake --build build -j 4

cmake -S . -B build_EB \
-GNinja \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DWarpX_DIMS="2" \
-DWarpX_FFT=ON \
-DWarpX_QED=ON \
-DWarpX_QED_TABLE_GEN=ON \
-DWarpX_OPENPMD=ON \
-DWarpX_EB=ON \
-DWarpX_PRECISION=DOUBLE \
cmake -S . -B build_EB \
-GNinja \
-DCMAKE_EXE_LINKER_FLAGS="-fsanitize=thread" \
-DCMAKE_SHARED_LINKER_FLAGS="-fsanitize=thread" \
-DCMAKE_VERBOSE_MAKEFILE=ON \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DWarpX_DIMS="2" \
-DWarpX_FFT=ON \
-DWarpX_QED=ON \
-DWarpX_QED_TABLE_GEN=ON \
-DWarpX_OPENPMD=ON \
-DWarpX_EB=ON \
-DWarpX_PRECISION=DOUBLE \
-DWarpX_PARTICLE_PRECISION=DOUBLE
cmake --build build_EB -j 4

Expand All @@ -149,10 +147,6 @@ jobs:
export TSAN_OPTIONS='ignore_noninstrumented_modules=1'
export ARCHER_OPTIONS="verbose=1"

# We need these two lines because these tests run inside a docker container
export OMPI_ALLOW_RUN_AS_ROOT=1
export OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1

export OMP_NUM_THREADS=2

mpirun -n 2 ./build/bin/warpx.rz Examples/Physics_applications/laser_acceleration/inputs_base_rz warpx.serialize_initial_conditions = 0
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 @@ -18,7 +18,7 @@ jobs:
matrix:
dim: [1, 2, RZ, 3]
name: clang-tidy-${{ matrix.dim }}D
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
timeout-minutes: 180
if: github.event.pull_request.draft == false
steps:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,6 @@

set -eu -o pipefail

# This dependency file is currently used within a docker container,
# which does not come with sudo.
apt-get -qqq update
apt-get -y install sudo

# `man apt.conf`:
# Number of retries to perform. If this is non-zero APT will retry
# failed files the given number of times.
Expand All @@ -23,17 +18,18 @@ echo 'Acquire::Retries "3";' | sudo tee /etc/apt/apt.conf.d/80-retries
sudo apt-get -qqq update
sudo apt-get install -y \
cmake \
clang-17 \
clang-tidy-17 \
clang-18 \
clang-tidy-18 \
libblas-dev \
libc++-17-dev \
libc++-18-dev \
libboost-math-dev \
libfftw3-dev \
libfftw3-mpi-dev \
libhdf5-openmpi-dev \
liblapack-dev \
libopenmpi-dev \
libomp-17-dev \
libomp-18-dev \
libtsan2 \
ninja-build \
wget \
xz-utils \
Expand All @@ -42,9 +38,9 @@ sudo apt-get install -y \
ccache \
pkg-config

# Use clang 17
export CXX=$(which clang++-17)
export CC=$(which clang-17)
# Use clang 18
export CXX=$(which clang++-18)
export CC=$(which clang-18)

# cmake-easyinstall
#
Expand Down
Loading