-
Notifications
You must be signed in to change notification settings - Fork 51
Clang Tidy and Sanitizer: Use clang-19 on Ubuntu 24.04 #1783
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
Changes from all commits
a4b078d
5ff3be6
132aa77
4d5f727
4150599
9914b04
ce09ae1
35aa755
44069d4
a9daa1b
1def0f6
51e49ef
6a3b74c
43afa34
12ed499
15fadc6
370fddf
1d41d46
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,54 +14,78 @@ spack: | |
packages: | ||
adios2: | ||
variants: ~zfp ~sz ~png ~dataman ~python ~fortran ~ssc ~shared ~bzip2 ~mgard | ||
|
||
c-blosc2: | ||
# snappy broken on CMake 4.0 | ||
# fixed snappy not yet deployed to a Spack release | ||
variants: ~snappy | ||
|
||
cmake: | ||
externals: | ||
- spec: [email protected].5 | ||
prefix: /usr | ||
- spec: [email protected].8 | ||
prefix: /usr/local | ||
buildable: False | ||
|
||
openmpi: | ||
externals: | ||
- spec: [email protected].2 | ||
- spec: [email protected].6 | ||
prefix: /usr | ||
buildable: False | ||
|
||
perl: | ||
externals: | ||
- spec: perl@5.34.0 | ||
- spec: perl@5.38.2 | ||
prefix: /usr | ||
buildable: False | ||
|
||
python: | ||
externals: | ||
- spec: python@3.10.12 | ||
- spec: python@3.12.3 | ||
prefix: /usr | ||
buildable: False | ||
|
||
all: | ||
target: [x86_64] | ||
variants: ~fortran | ||
providers: | ||
mpi: [openmpi] | ||
compiler: [[email protected]] | ||
cc: [llvm] | ||
cxx: [llvm] | ||
fortran: [gcc] | ||
|
||
llvm: | ||
externals: | ||
- spec: [email protected] | ||
prefix: /usr | ||
paths: | ||
cc: /usr/bin/clang-19 | ||
cxx: /usr/bin/clang++-19 | ||
modules: [] | ||
environment: {} | ||
extra_rpaths: [] | ||
buildable: False | ||
|
||
gcc: | ||
externals: | ||
- spec: [email protected] | ||
prefix: /usr | ||
paths: | ||
cc: /usr/bin/gcc | ||
cxx: /usr/bin/g++ | ||
fortran: /usr/bin/gfortran | ||
modules: [] | ||
environment: {} | ||
extra_rpaths: [] | ||
buildable: False | ||
|
||
compilers: | ||
- compiler: | ||
environment: {} | ||
extra_rpaths: [] | ||
flags: {} | ||
modules: [] | ||
operating_system: ubuntu22.04 | ||
paths: | ||
cc: /usr/bin/clang-14 | ||
cxx: /usr/bin/clang++-14 | ||
f77: /usr/bin/gfortran | ||
fc: /usr/bin/gfortran | ||
spec: [email protected] | ||
target: x86_64 | ||
gcc-runtime: | ||
buildable: false | ||
externals: | ||
- spec: [email protected] | ||
prefix: /usr | ||
|
||
config: | ||
build_jobs: 2 | ||
|
||
mirrors: | ||
E4S: https://cache.e4s.io | ||
spack-public: https://mirror.spack.io | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,20 +7,21 @@ concurrency: | |
cancel-in-progress: true | ||
|
||
jobs: | ||
clangtidy14_nopy_ompi_h5_ad2: | ||
clangtidy19_nopy_ompi_h5_ad2: | ||
name: clang-tidy w/o py | ||
runs-on: ubuntu-22.04 | ||
runs-on: ubuntu-24.04 | ||
if: github.event.pull_request.draft == false | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Spack Cache | ||
uses: actions/cache@v3 | ||
with: {path: /opt/spack, key: clangtidy14_nopy_ompi_h5_ad2 } | ||
with: {path: /opt/spack, key: clangtidy19_nopy_ompi_h5_ad2 } | ||
- name: Install | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install clang clang-tidy gfortran libopenmpi-dev python-is-python3 | ||
sudo .github/workflows/dependencies/install_spack | ||
SPACK_VER=1.0.1 sudo -E .github/workflows/dependencies/install_spack | ||
echo "SPACK VERSION: $(spack --version)" | ||
- name: Build | ||
env: {CC: clang, CXX: clang++} | ||
run: | | ||
|
@@ -36,32 +37,31 @@ jobs: | |
cat build/clang-tidy.log | ||
if [[ $(wc -m <build/clang-tidy.log) -gt 1 ]]; then exit 1; fi | ||
|
||
clangsanitizer14_py38_ompi_h5_ad2: | ||
clangsanitizer19_py38_ompi_h5_ad2: | ||
name: Clang ASAN UBSAN | ||
runs-on: ubuntu-22.04 | ||
runs-on: ubuntu-24.04 | ||
if: github.event.pull_request.draft == false | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Spack Cache | ||
uses: actions/cache@v3 | ||
with: {path: /opt/spack, key: clang14_nopy_ompi_h5_ad2 } | ||
with: {path: /opt/spack, key: clang19_nopy_ompi_h5_ad2 } | ||
- name: Install | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install clang-14 libc++-dev libc++abi-dev python3 gfortran libopenmpi-dev | ||
python3 -m pip install -U pip | ||
python3 -m pip install -U numpy | ||
sudo .github/workflows/dependencies/install_spack | ||
sudo apt-get install clang-19 libc++-dev libc++abi-dev python3 gfortran libopenmpi-dev python3-numpy | ||
SPACK_VER=1.0.1 sudo -E .github/workflows/dependencies/install_spack | ||
echo "SPACK VERSION: $(spack --version)" | ||
- name: Build | ||
env: {CC: mpicc, CXX: mpic++, OMPI_CC: clang-14, OMPI_CXX: clang++-14, CXXFLAGS: -Werror, OPENPMD_HDF5_CHUNKS: none, OPENPMD_TEST_NFILES_MAX: 100} | ||
env: {CC: mpicc, CXX: mpic++, OMPI_CC: clang-19, OMPI_CXX: clang++-19, CXXFLAGS: -Werror, OPENPMD_HDF5_CHUNKS: none, OPENPMD_TEST_NFILES_MAX: 100} | ||
run: | | ||
sudo ln -s "$(which cmake)" /usr/bin/cmake | ||
eval $(spack env activate --sh .github/ci/spack-envs/clangtidy_nopy_ompi_h5_ad2/) | ||
spack install | ||
SOURCEPATH="$(pwd)" | ||
share/openPMD/download_samples.sh build | ||
export LDFLAGS="${LDFLAGS} -fsanitize=address,undefined -shared-libsan" | ||
export CXXFLAGS="${CXXFLAGS} -fsanitize=address,undefined -shared-libsan" | ||
export CXXFLAGS="${CXXFLAGS} -fsanitize=address,undefined -shared-libsan -DOMPI_SKIP_MPICXX" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please check There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I found in the past that surprisingly, the C API of MPI sometimes depends on the (outdated) C++ bindings (e.g., BullMPI, which is an OpenMPI variant) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We need There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is a CMake option
Let's add that! :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We will do that in a follow-up PR, so we can patch it out if it causes issues after all. |
||
cmake -S . -B build \ | ||
-DopenPMD_USE_MPI=ON \ | ||
-DopenPMD_USE_PYTHON=ON \ | ||
|
@@ -72,7 +72,7 @@ jobs: | |
cmake --build build --parallel 2 | ||
export ASAN_OPTIONS=detect_stack_use_after_return=1:detect_leaks=1:check_initialization_order=true:strict_init_order=true:detect_stack_use_after_scope=1:fast_unwind_on_malloc=0 | ||
export LSAN_OPTIONS=suppressions="$SOURCEPATH/.github/ci/sanitizer/clang/Leak.supp" | ||
export LD_PRELOAD=/usr/lib/clang/14/lib/linux/libclang_rt.asan-x86_64.so | ||
export LD_PRELOAD=/usr/lib/clang/19/lib/linux/libclang_rt.asan-x86_64.so | ||
ctest --test-dir build -E 3b --output-on-failure | ||
export OPENPMD_HDF5_CHUNKS="auto" | ||
ctest --test-dir build -R 3b --output-on-failure |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check the change of mirror URL, cache.e4s.io is outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, perfect! :)