Skip to content

Commit 037f2e1

Browse files
committed
Improve support for newer compilers
Bump all library requirements. Address compiler diagnostics for GCC 13 to 16, Clang 19 to 21, CrayClang 19, IntelLLVM 2023.2.0, nvcc 12.0 to 12.8. Add CMake options for packaging on Fedora.
1 parent 507b7ca commit 037f2e1

File tree

23 files changed

+276
-113
lines changed

23 files changed

+276
-113
lines changed

.github/workflows/push_pull.yml

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ permissions:
99

1010
jobs:
1111
macos:
12-
runs-on: macos-15
12+
runs-on: macos-26
1313
if: ${{ github.repository == 'espressomd/espresso' }}
1414
steps:
1515
- name: Checkout
@@ -24,19 +24,13 @@ jobs:
2424
- name: Install dependencies
2525
run: |
2626
echo '' > Brewfile
27-
for dep in boost boost-mpi fftw gsl ccache ninja; do echo "brew \"${dep}\"" >> Brewfile; done
27+
for dep in boost boost-mpi libomp fftw gsl ccache ninja; do echo "brew \"${dep}\"" >> Brewfile; done
2828
brew bundle check >/dev/null 2>&1 || brew bundle --verbose --no-upgrade
2929
# set up Xcode compiler
3030
echo "::group::List available Xcode compilers"
3131
ls /Applications | grep Xcode
3232
echo "::endgroup::"
33-
sudo xcode-select -switch /Applications/Xcode_16.4.app
34-
echo "::group::Install OpenMP (https://mac.r-project.org/openmp/)"
35-
curl -s -o ${{ runner.temp }}/openmp.tar.gz https://mac.r-project.org/openmp/openmp-19.1.0-darwin20-Release.tar.gz
36-
sudo tar fvxz ${{ runner.temp }}/openmp.tar.gz -C /
37-
rm ${{ runner.temp }}/openmp.tar.gz
38-
codesign -d -vv /usr/local/lib/libomp.dylib
39-
echo "::endgroup::"
33+
sudo xcode-select -switch /Applications/Xcode_26.2.0.app
4034
# Python dependencies
4135
python -m venv venv
4236
. venv/bin/activate
@@ -54,12 +48,12 @@ jobs:
5448
with_gsl: 'true'
5549
with_walberla: 'true'
5650
with_walberla_avx: 'false'
57-
with_shared_memory_parallelism: 'false'
51+
with_shared_memory_parallelism: 'true'
5852

5953
debian:
6054
runs-on: ubuntu-latest
6155
container:
62-
image: ghcr.io/espressomd/docker/debian:3388b293a5e8a9b613b1bfa4220e54dfb4bff245-base-layer
56+
image: ghcr.io/espressomd/docker/debian:4d3e236db5ae334ddcc9c3c82aae7637faa5dabc-base-layer
6357
credentials:
6458
username: ${{ github.actor }}
6559
password: ${{ secrets.github_token }}
@@ -101,7 +95,7 @@ jobs:
10195
runs-on: ubuntu-latest
10296
if: ${{ github.repository == 'espressomd/espresso' }}
10397
container:
104-
image: ghcr.io/espressomd/docker/ubuntu-wo-dependencies:3388b293a5e8a9b613b1bfa4220e54dfb4bff245-base-layer
98+
image: ghcr.io/espressomd/docker/ubuntu-wo-dependencies:4d3e236db5ae334ddcc9c3c82aae7637faa5dabc-base-layer
10599
credentials:
106100
username: ${{ github.actor }}
107101
password: ${{ secrets.github_token }}
@@ -143,7 +137,7 @@ jobs:
143137
runs-on: ubuntu-latest
144138
if: ${{ github.repository == 'espressomd/espresso' }}
145139
container:
146-
image: ghcr.io/espressomd/docker/fedora:3388b293a5e8a9b613b1bfa4220e54dfb4bff245-base-layer
140+
image: ghcr.io/espressomd/docker/fedora:4d3e236db5ae334ddcc9c3c82aae7637faa5dabc-base-layer
147141
credentials:
148142
username: ${{ github.actor }}
149143
password: ${{ secrets.github_token }}

.gitlab-ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
image: ghcr.io/espressomd/docker/ubuntu:3388b293a5e8a9b613b1bfa4220e54dfb4bff245
1+
image: ghcr.io/espressomd/docker/ubuntu:4d3e236db5ae334ddcc9c3c82aae7637faa5dabc
22

33
stages:
44
- prepare
@@ -16,11 +16,11 @@ stages:
1616

1717
.notification_job_template: &notification_job_definition
1818
<<: *global_job_definition
19-
image: ghcr.io/espressomd/docker/alpine:3388b293a5e8a9b613b1bfa4220e54dfb4bff245
19+
image: ghcr.io/espressomd/docker/alpine:4d3e236db5ae334ddcc9c3c82aae7637faa5dabc
2020
variables:
2121
GET_SOURCES_ATTEMPTS: 3
2222
dependencies: []
23-
timeout: 40m
23+
timeout: 20m
2424
interruptible: false
2525
tags:
2626
- espresso
@@ -98,7 +98,7 @@ maxset:
9898
with_nlopt: 'true'
9999
with_caliper: 'true'
100100
check_skip_long: 'true'
101-
cmake_params: '-D CMAKE_CXX_STANDARD=23 -D CMAKE_CXX_EXTENSIONS=OFF -D ESPRESSO_TEST_NP=8'
101+
cmake_params: '-D CMAKE_CXX_STANDARD=23 -D CMAKE_CXX_EXTENSIONS=OFF -D ESPRESSO_TEST_NP=8 -D ESPRESSO_TEST_NT=8'
102102
script:
103103
- bash maintainer/CI/build_cmake.sh
104104
tags:

CMakeLists.txt

Lines changed: 44 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,10 @@ option(ESPRESSO_INSIDE_DOCKER "Set this to ON when running inside Docker." OFF)
142142
mark_as_advanced(ESPRESSO_INSIDE_DOCKER)
143143
set(ESPRESSO_TEST_TIMEOUT "300"
144144
CACHE STRING "Timeout in seconds for each testsuite test")
145+
if(ESPRESSO_BUILD_WITH_PYTHON)
146+
set(ESPRESSO_MODULE_INSTALL_PATH ""
147+
CACHE PATH "Install ESPResSo Python module in a custom location")
148+
endif()
145149

146150
if(ESPRESSO_BUILD_WITH_CCACHE)
147151
find_program(CCACHE_PROGRAM ccache REQUIRED)
@@ -316,7 +320,7 @@ endif()
316320
# Python interpreter and Cython interface library
317321
if(ESPRESSO_BUILD_WITH_PYTHON)
318322
find_package(Python 3.11 REQUIRED COMPONENTS Interpreter Development NumPy)
319-
find_package(Cython 3.0.4...<3.2.0 REQUIRED)
323+
find_package(Cython 3.0.4...<4.0.0 REQUIRED)
320324
if(CYTHON_VERSION VERSION_LESS 3.0.8)
321325
message(WARNING "We strongly recommend using Cython 3.0.8 or later")
322326
endif()
@@ -358,7 +362,7 @@ set(ESPRESSO_INSTALL_LIBDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
358362

359363
set(ESPRESSO_OLD_CMAKE_INSTALL_LIBDIR "${CMAKE_INSTALL_LIBDIR}")
360364

361-
# python site-packages, can be overriden with CMake options
365+
# python site-packages, can be overridden with CMake options
362366
if(ESPRESSO_BUILD_WITH_PYTHON)
363367
if(NOT ESPRESSO_INSTALL_PYTHON)
364368
if(CMAKE_INSTALL_PREFIX STREQUAL "/")
@@ -369,7 +373,10 @@ if(ESPRESSO_BUILD_WITH_PYTHON)
369373
)
370374
endif()
371375
endif()
372-
# override: package C++, CUDA and Cython shared objects together
376+
if(NOT ESPRESSO_MODULE_INSTALL_PATH STREQUAL "")
377+
set(ESPRESSO_INSTALL_PYTHON "${ESPRESSO_MODULE_INSTALL_PATH}")
378+
endif()
379+
# install shared objects in the Python folder
373380
set(ESPRESSO_INSTALL_LIBDIR "${ESPRESSO_INSTALL_PYTHON}/espressomd")
374381
add_custom_target(espresso_packaging_dependencies)
375382
endif()
@@ -633,14 +640,14 @@ if(ESPRESSO_BUILD_WITH_SHARED_MEMORY_PARALLELISM)
633640
find_package(OpenMP REQUIRED COMPONENTS CXX)
634641

635642
if(NOT EXISTS ${FETCHCONTENT_BASE_DIR}/kokkos-src)
636-
find_package(Kokkos 4.3 QUIET)
643+
find_package(Kokkos 4.6 QUIET)
637644
endif()
638645
if(NOT DEFINED Kokkos_FOUND OR NOT ${Kokkos_FOUND})
639646
# cmake-format: off
640647
FetchContent_Declare(
641648
kokkos
642649
GIT_REPOSITORY https://github.com/kokkos/kokkos.git
643-
GIT_TAG 18b830e # version 4.6.1 with patches
650+
GIT_TAG 5.0.2
644651
OVERRIDE_FIND_PACKAGE
645652
)
646653
# cmake-format: on
@@ -652,6 +659,7 @@ if(ESPRESSO_BUILD_WITH_SHARED_MEMORY_PARALLELISM)
652659
set(Kokkos_ENABLE_COMPLEX_ALIGN ON CACHE BOOL "")
653660
set(Kokkos_ENABLE_AGGRESSIVE_VECTORIZATION ON CACHE BOOL "")
654661
set(Kokkos_ENABLE_HWLOC ON CACHE BOOL "")
662+
set(Kokkos_ENABLE_DEPRECATED_CODE_5 OFF CACHE BOOL "")
655663
set(Kokkos_ARCH_NATIVE ON CACHE BOOL "")
656664
FetchContent_MakeAvailable(kokkos)
657665
set(BUILD_SHARED_LIBS ${ESPRESSO_BUILD_SHARED_LIBS_DEFAULT})
@@ -711,7 +719,7 @@ if(ESPRESSO_BUILD_WITH_HDF5)
711719
FetchContent_Declare(
712720
HighFive
713721
GIT_REPOSITORY https://github.com/highfive-devs/highfive.git
714-
GIT_TAG v3.2.0
722+
GIT_TAG v3.3.0
715723
)
716724
# cmake-format: on
717725
FetchContent_MakeAvailable(HighFive)
@@ -893,6 +901,8 @@ if(ESPRESSO_BUILD_TESTS)
893901
"Extra arguments to give to ctest calls (separated by semicolons)")
894902
set(ESPRESSO_TEST_NP "4" CACHE STRING
895903
"Maximal number of MPI ranks to use per test")
904+
set(ESPRESSO_TEST_NT "4"
905+
CACHE STRING "Maximal number of OpenMP threads to use per test")
896906
add_library(espresso_tests_compiler_flags INTERFACE)
897907
add_library(espresso::tests::compiler_flags ALIAS
898908
espresso_tests_compiler_flags)
@@ -923,13 +933,14 @@ if(ESPRESSO_BUILD_WITH_WALBERLA)
923933
FetchContent_Declare(
924934
walberla
925935
GIT_REPOSITORY https://i10git.cs.fau.de/walberla/walberla.git
926-
GIT_TAG 17fc54c8 # v7.2 with patches
936+
GIT_TAG 3247aa73 # v7.2 with patches
927937
)
928938
# cmake-format: on
929939
string(REGEX REPLACE "([/\\]walberla)-src$" "\\1-build" walberla_BINARY_DIR
930940
"${walberla_SOURCE_DIR}")
931941
set(WALBERLA_BUILD_TESTS off CACHE BOOL "")
932942
set(WALBERLA_BUILD_TOOLS off CACHE BOOL "")
943+
set(WALBERLA_BUILD_LEGACY_LBM off CACHE BOOL "")
933944
set(WALBERLA_BUILD_BENCHMARKS off CACHE BOOL "")
934945
set(WALBERLA_BUILD_TUTORIALS off CACHE BOOL "")
935946
set(WALBERLA_BUILD_SHOWCASES off CACHE BOOL "")
@@ -972,14 +983,21 @@ if(ESPRESSO_BUILD_WITH_WALBERLA)
972983
endfunction()
973984
espresso_enable_avx2_support(espresso_avx_flags_callback)
974985
endif()
986+
add_library(espresso_walberla_sqlite_compiler_flags INTERFACE)
987+
target_compile_options(
988+
espresso_walberla_sqlite_compiler_flags
989+
INTERFACE $<$<COMPILE_LANG_AND_ID:C,GNU>:-Wno-discarded-qualifiers>
990+
-Wno-misleading-indentation -Wno-unused-but-set-variable)
991+
target_link_libraries(walberla_sqlite
992+
PRIVATE espresso_walberla_sqlite_compiler_flags)
975993
endif()
976994

977995
if(ESPRESSO_BUILD_WITH_CALIPER)
978996
# cmake-format: off
979997
FetchContent_Declare(
980998
caliper
981999
GIT_REPOSITORY https://github.com/LLNL/Caliper.git
982-
GIT_TAG v2.13.0
1000+
GIT_TAG v2.14.0
9831001
)
9841002
# cmake-format: on
9851003
set(CALIPER_OPTION_PREFIX on CACHE BOOL "")
@@ -995,10 +1013,14 @@ if(ESPRESSO_BUILD_WITH_CALIPER)
9951013
set(BUILD_SHARED_LIBS ${ESPRESSO_BUILD_SHARED_LIBS_DEFAULT})
9961014
set(CMAKE_INSTALL_LIBDIR "${ESPRESSO_OLD_CMAKE_INSTALL_LIBDIR}")
9971015
set(CMAKE_SHARED_LIBRARY_PREFIX "${ESPRESSO_SHARED_LIBRARY_PREFIX}")
1016+
add_library(espresso_caliper_compiler_flags INTERFACE)
9981017
target_compile_options(
999-
caliper-common
1000-
PRIVATE $<$<COMPILE_LANG_AND_ID:CXX,GNU>:-Wno-free-nonheap-object
1001-
-Wno-deprecated-enum-enum-conversion -Wno-volatile>)
1018+
espresso_caliper_compiler_flags
1019+
INTERFACE $<$<COMPILE_LANG_AND_ID:CXX,GNU>:-Wno-free-nonheap-object
1020+
-Wno-deprecated-enum-enum-conversion -Wno-volatile
1021+
-Wno-maybe-uninitialized>)
1022+
target_link_libraries(caliper-common PRIVATE espresso_caliper_compiler_flags)
1023+
target_link_libraries(caliper-runtime PRIVATE espresso_caliper_compiler_flags)
10021024
endif()
10031025

10041026
#
@@ -1028,6 +1050,17 @@ function(espresso_set_common_target_properties)
10281050
elseif(CMAKE_CUDA_COMPILER_ID STREQUAL "Clang")
10291051
set_target_properties(${TARGET_NAME} PROPERTIES LINKER_LANGUAGE "CXX")
10301052
endif()
1053+
# handle builds with different GCC versions for C++ and CUDA
1054+
# (https://github.com/espressomd/espresso/issues/5256)
1055+
if(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA" AND CMAKE_CXX_COMPILER_ID
1056+
STREQUAL "GNU"
1057+
AND NOT "$ENV{CUDAHOSTCXX}" STREQUAL "$ENV{CXX}"
1058+
AND "$ENV{CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES_EXCLUDE}" MATCHES
1059+
"^/usr/lib/gcc/[^/]+/1[4-9]\$")
1060+
target_link_directories(
1061+
${TARGET_NAME} BEFORE PUBLIC
1062+
"$ENV{CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES_EXCLUDE}")
1063+
endif()
10311064
endif()
10321065
endif()
10331066
endfunction()

cmake/espresso_unit_test.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ function(espresso_unit_test_register)
8080
if(NOT DEFINED TEST_NUM_THREADS)
8181
set(TEST_NUM_THREADS 2)
8282
endif()
83+
if(${TEST_NUM_THREADS} GREATER ${ESPRESSO_TEST_NT})
84+
set(TEST_NUM_THREADS ${ESPRESSO_TEST_NT})
85+
endif()
8386

8487
if(ESPRESSO_WARNINGS_ARE_ERRORS)
8588
set(SANITIZERS_HALT_ON_ERROR "halt_on_error=1")

doc/sphinx/conf.py.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ extensions = [
4141
'sphinx.ext.doctest',
4242
'sphinxcontrib.bibtex',
4343
'sphinx_toggleprompt',
44+
'sphinx_tabs.tabs',
4445
'sphinx.ext.napoleon'
4546
]
4647

0 commit comments

Comments
 (0)