Skip to content

Commit 112b2d3

Browse files
authored
CI: Use C++20 (#4976)
Prepare for switching to C++20.
1 parent 57f121f commit 112b2d3

File tree

19 files changed

+95
-62
lines changed

19 files changed

+95
-62
lines changed

.github/workflows/apps.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ jobs:
6262
export MICROPHYSICS_HOME=${PWD}/Microphysics
6363
cd Castro/Exec/hydro_tests/Sedov/
6464
make -j4 CCACHE=ccache USE_MPI=FALSE \
65+
CXXSTD=c++20 \
6566
USE_LINEAR_SOLVERS_INCFLO=FALSE \
6667
USE_LINEAR_SOLVERS_EM=FALSE
6768
@@ -106,6 +107,7 @@ jobs:
106107
-DWarpX_OPENPMD=OFF \
107108
-DCMAKE_VERBOSE_MAKEFILE=ON \
108109
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
110+
-DCMAKE_CXX_STANDARD=20 \
109111
-DAMReX_FFT=ON
110112
cmake --build WarpX/build -j 4
111113
@@ -152,6 +154,7 @@ jobs:
152154
cd pyamrex
153155
154156
cmake -S . -B build \
157+
-DCMAKE_CXX_STANDARD=20 \
155158
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
156159
-DCMAKE_VERBOSE_MAKEFILE=ON \
157160
-DBUILD_SHARED_LIBS=ON \

.github/workflows/ascent.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ jobs:
2727
run: |
2828
. /ascent_docker_setup_env.sh
2929
cmake -S . -B build \
30+
-DCMAKE_CXX_STANDARD=20 \
3031
-DCMAKE_BUILD_TYPE=Debug \
3132
-DAMReX_ENABLE_TESTS=ON \
3233
-DAMReX_FORTRAN=OFF \

.github/workflows/bittree.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ jobs:
5757
export AMREX_BITTREE_HOME=${{ github.workspace }}/libbittree
5858
cd ${{ github.workspace }}/Tests/Amr/Advection_AmrCore/Exec
5959
make -j4 USE_MPI=TRUE USE_BITTREE=TRUE DIM=2 TEST=TRUE \
60-
CCACHE=ccache
60+
CCACHE=ccache CXXSTD=c++20
6161
mpiexec -n 2 ./main2d.gnu.TEST.MPI.ex inputs_bittree amr.plot_int=1000
6262
6363
${{github.workspace}}/Tools/C_scripts/mmclt.py --input ${{github.workspace}}/ccache.log.txt
@@ -111,7 +111,7 @@ jobs:
111111
export AMREX_BITTREE_HOME=${{ github.workspace }}/libbittree
112112
cd ${{ github.workspace }}/Tests/Amr/Advection_AmrCore/Exec
113113
make -j4 USE_MPI=TRUE USE_BITTREE=TRUE DIM=3 TEST=TRUE BL_NO_FORT=TRUE\
114-
CCACHE=ccache
114+
CCACHE=ccache CXXSTD=c++20
115115
mpiexec -n 2 ./main3d.gnu.TEST.MPI.ex inputs_bittree max_step=10
116116
117117
${{github.workspace}}/Tools/C_scripts/mmclt.py --input ${{github.workspace}}/ccache.log.txt

.github/workflows/catalyst.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ jobs:
3030
- name: Configure
3131
run: |
3232
cmake -S . -B build \
33+
-DCMAKE_CXX_STANDARD=20 \
3334
-DCMAKE_BUILD_TYPE=Debug \
3435
-DAMReX_ENABLE_TESTS=ON \
3536
-DAMReX_FORTRAN=OFF \

.github/workflows/clang.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
# Build and install libamrex as AMReX CMake project
1818
# Note: this is an intentional "minimal" build that does not enable (many) options
1919
library_clang:
20-
name: Clang@18 C++17 SP NOMPI Debug [lib]
20+
name: Clang@18 SP NOMPI Debug [lib]
2121
runs-on: ubuntu-24.04
2222
needs: check_changes
2323
if: needs.check_changes.outputs.has_non_docs_changes == 'true'
@@ -48,6 +48,7 @@ jobs:
4848
mkdir build
4949
cd build
5050
cmake .. \
51+
-DCMAKE_CXX_STANDARD=20 \
5152
-DCMAKE_BUILD_TYPE=Debug \
5253
-DCMAKE_VERBOSE_MAKEFILE=ON \
5354
-DCMAKE_INSTALL_PREFIX=/tmp/my-amrex \
@@ -80,7 +81,7 @@ jobs:
8081
du -hs ~/.cache/ccache
8182
8283
tests_clang:
83-
name: Clang@14.0 C++17 SP Particles DP Mesh Debug [tests]
84+
name: Clang@14.0 SP Particles DP Mesh Debug [tests]
8485
runs-on: ubuntu-22.04
8586
needs: check_changes
8687
if: needs.check_changes.outputs.has_non_docs_changes == 'true'
@@ -112,6 +113,7 @@ jobs:
112113
mkdir build
113114
cd build
114115
cmake .. \
116+
-DCMAKE_CXX_STANDARD=20 \
115117
-DCMAKE_BUILD_TYPE=Debug \
116118
-DCMAKE_VERBOSE_MAKEFILE=ON \
117119
-DAMReX_FFT=ON \
@@ -138,7 +140,7 @@ jobs:
138140
du -hs ~/.cache/ccache
139141
140142
tests_cxx20:
141-
name: Clang C++20 [tests]
143+
name: Clang [tests]
142144
runs-on: ubuntu-22.04
143145
needs: check_changes
144146
if: needs.check_changes.outputs.has_non_docs_changes == 'true'
@@ -169,14 +171,14 @@ jobs:
169171
mkdir build
170172
cd build
171173
cmake .. \
174+
-DCMAKE_CXX_STANDARD=20 \
172175
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
173176
-DCMAKE_VERBOSE_MAKEFILE=ON \
174177
-DAMReX_FFT=ON \
175178
-DAMReX_EB=ON \
176179
-DAMReX_ENABLE_TESTS=ON \
177180
-DAMReX_FORTRAN=OFF \
178181
-DAMReX_MPI=ON \
179-
-DCMAKE_CXX_STANDARD=20 \
180182
-DCMAKE_C_COMPILER=$(which clang-15) \
181183
-DCMAKE_CXX_COMPILER=$(which clang++-15) \
182184
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
@@ -218,7 +220,7 @@ jobs:
218220
219221
./configure --dim 2 --with-fortran no --comp llvm --with-mpi no --enable-fft yes
220222
make -j4 WARN_ALL=TRUE WARN_ERROR=TRUE XTRA_CXXFLAGS="-fno-operator-names" \
221-
CCACHE=ccache
223+
CCACHE=ccache CXXSTD=c++20
222224
make install
223225
224226
${{github.workspace}}/Tools/C_scripts/mmclt.py --input ${{github.workspace}}/ccache.log.txt

.github/workflows/codeql.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ jobs:
5656
if: ${{ matrix.language == 'cpp' }}
5757
run: |
5858
cmake -S . -B build \
59+
-DCMAKE_CXX_STANDARD=20 \
5960
-DAMReX_EB=ON \
6061
-DAMReX_ENABLE_TESTS=ON \
6162
-DAMReX_FORTRAN=OFF \

.github/workflows/cuda.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
# Build libamrex and all tests with CUDA 12.6
1818
tests-cuda12:
19-
name: CUDA@12.6 C++17 Release [tests]
19+
name: CUDA@12.6 Release [tests]
2020
runs-on: ubuntu-24.04
2121
needs: check_changes
2222
if: needs.check_changes.outputs.has_non_docs_changes == 'true'
@@ -47,6 +47,7 @@ jobs:
4747
which nvcc || echo "nvcc not in PATH!"
4848
4949
cmake -S . -B build \
50+
-DCMAKE_CXX_STANDARD=20 \
5051
-DCMAKE_VERBOSE_MAKEFILE=ON \
5152
-DAMReX_FFT=ON \
5253
-DAMReX_EB=ON \
@@ -70,7 +71,7 @@ jobs:
7071
7172
# Build libamrex and all tests for CUDA with LLVM Clang + libc++ + CTK 11.7
7273
tests-cuda11-clang:
73-
name: Clang@15 CUDA@11.7 C++17 Release [tests]
74+
name: Clang@15 CUDA@11.7 Release [tests]
7475
runs-on: ubuntu-22.04
7576
needs: check_changes
7677
if: needs.check_changes.outputs.has_non_docs_changes == 'true'
@@ -109,6 +110,7 @@ jobs:
109110
export LD_LIBRARY_PATH=/usr/local/nvidia/lib:/usr/local/nvidia/lib64:/usr/local/cuda/lib64:${LD_LIBRARY_PATH}
110111
111112
cmake -S . -B build \
113+
-DCMAKE_CXX_STANDARD=20 \
112114
-DCMAKE_VERBOSE_MAKEFILE=ON \
113115
-DAMReX_MPI=OFF \
114116
-DAMReX_FFT=ON \
@@ -126,7 +128,7 @@ jobs:
126128
127129
# Build libamrex and all tests with NVHPC (recent supported)
128130
tests-nvhpc-nvcc:
129-
name: NVHPC NVCC/NVC++ C++17 Release [tests]
131+
name: NVHPC NVCC/NVC++ Release [tests]
130132
runs-on: ubuntu-24.04
131133
needs: check_changes
132134
if: needs.check_changes.outputs.has_non_docs_changes == 'true'
@@ -167,6 +169,7 @@ jobs:
167169
cmake --version
168170
169171
cmake -S . -B build \
172+
-DCMAKE_CXX_STANDARD=20 \
170173
-DCMAKE_VERBOSE_MAKEFILE=ON \
171174
-DAMReX_ENABLE_TESTS=ON \
172175
-DAMReX_TEST_TYPE=Small \
@@ -218,11 +221,7 @@ jobs:
218221
219222
export PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
220223
./configure --dim 3 --with-cuda yes --enable-eb yes --enable-xsdk-defaults yes --with-fortran no --enable-fft yes
221-
#
222-
# /home/runner/work/amrex/amrex/Src/Base/AMReX_GpuLaunchGlobal.H:16:41: error: unused parameter ‘f0’ [-Werror=unused-parameter]
223-
# 16 | AMREX_GPU_GLOBAL void launch_global (L f0) { f0(); }
224-
#
225-
make -j4 WARN_ALL=TRUE WARN_ERROR=TRUE XTRA_CXXFLAGS="-fno-operator-names -Wno-unused-parameter -Werror=deprecated-declarations" CCACHE=ccache CUDA_ARCH="8.0 9.0"
224+
make -j4 CXXSTD=c++20 WARN_ALL=TRUE WARN_ERROR=TRUE XTRA_CXXFLAGS="-fno-operator-names -Werror=deprecated-declarations" CCACHE=ccache CUDA_ARCH="8.0 9.0"
226225
make install
227226
228227
ccache -s

0 commit comments

Comments
 (0)