diff --git a/.jenkins b/.jenkins index 9415b43c84..8c5b052677 100644 --- a/.jenkins +++ b/.jenkins @@ -10,6 +10,40 @@ pipeline { stages { stage('Build') { parallel { + stage('rocm-ndebug-orange') { + agent { + docker { + image 'celeritas/ci-centos7-rocm5:2022-12-14.2' + label 'AMD_Radeon_Instinct_MI100 && rocm-docker' + args '--device=/dev/kfd --device=/dev/dri --security-opt seccomp=unconfined' + } + } + steps { + sh 'entrypoint-shell ./scripts/ci/run-ci.sh centos-rocm ndebug-orange' + } + post { + always { + xunit reduceLog: false, tools:[CTest(deleteOutputFiles: true, failIfNotNew: true, pattern: 'build/Testing/**/*.xml', skipNoTestFiles: false, stopProcessingIfError: true)] + } + } + } + stage('rocm-ndebug-orange-float') { + agent { + docker { + image 'celeritas/ci-centos7-rocm5:2022-12-14.2' + label 'AMD_Radeon_Instinct_MI100 && rocm-docker' + args '--device=/dev/kfd --device=/dev/dri --security-opt seccomp=unconfined' + } + } + steps { + sh 'entrypoint-shell ./scripts/ci/run-ci.sh centos-rocm ndebug-orange-float' + } + post { + always { + xunit reduceLog: false, tools:[CTest(deleteOutputFiles: true, failIfNotNew: true, pattern: 'build/Testing/**/*.xml', skipNoTestFiles: false, stopProcessingIfError: true)] + } + } + } stage('cuda-debug-orange') { agent { docker { diff --git a/CMakeLists.txt b/CMakeLists.txt index 457a987f8d..d77fbcc7e4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -447,8 +447,18 @@ elseif(CELERITAS_USE_HIP) set(CELERITAS_HAVE_ROCTX ON) target_link_libraries(celeritas_device_toolkit INTERFACE ${ROCTX_LIBRARY}) endif() - # TODO: downstream libs don't link against correct HIP dependencies when using - # static libraries + if(NOT BUILD_SHARED_LIBS) + # Downstream libs don't link against correct HIP dependencies when using + # static libraries, and even though the code below propagates the library + # names (-lamdhip64) CMake fails to include the link directories + # (/opt/rocm/lib) + target_link_libraries(celeritas_device_toolkit + INTERFACE "$" + ) + target_link_directories(celeritas_device_toolkit + INTERFACE "$" + ) + endif() endif() install(TARGETS celeritas_device_toolkit @@ -610,6 +620,12 @@ message(WARNING \"The Celeritas version was not detected during configuration. provenance data in output results.\") ") endif() - +if(CELERITAS_USE_HIP AND NOT BUILD_SHARED_LIBS) + # See celeritas_device_toolkit above + install(CODE " +message(WARNING \"CMake may not be able to correctly propagate implicit HIP + libraries: downstream executables may fail to link.\") +") +endif() #----------------------------------------------------------------------------# diff --git a/CMakePresets.json b/CMakePresets.json index 609cd2d73f..a314284e37 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -83,7 +83,6 @@ "hidden": true, "description": "Build with optimizations and without debug assertions", "cacheVariables": { - "BUILD_SHARED_LIBS":{"type": "BOOL", "value": "OFF"}, "CELERITAS_DEBUG": {"type": "BOOL", "value": "OFF"}, "CMAKE_BUILD_TYPE": {"type": "STRING", "value": "Release"}, "CMAKE_CUDA_FLAGS_RELEASE": "-O3 -DNDEBUG", diff --git a/example/accel/CMakeLists.txt b/example/accel/CMakeLists.txt index 222da1f560..a389bcd13f 100644 --- a/example/accel/CMakeLists.txt +++ b/example/accel/CMakeLists.txt @@ -9,7 +9,7 @@ project(CeleritasAccelExample VERSION 0.0.1 LANGUAGES CXX) cmake_policy(VERSION 3.12...3.22) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/..") -find_package(Celeritas 0.4 REQUIRED) +find_package(Celeritas 0.5 REQUIRED) find_package(Geant4 REQUIRED) if(NOT CELERITAS_USE_Geant4 OR CELERITAS_CORE_GEO STREQUAL "ORANGE") diff --git a/example/minimal/CMakeLists.txt b/example/minimal/CMakeLists.txt index 963f006e49..34769f9d12 100644 --- a/example/minimal/CMakeLists.txt +++ b/example/minimal/CMakeLists.txt @@ -9,7 +9,7 @@ project(CeleritasMinimalExample VERSION 0.0.1 LANGUAGES CXX) cmake_policy(VERSION 3.12...3.22) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/..") -find_package(Celeritas 0.4 REQUIRED) +find_package(Celeritas 0.5 REQUIRED) add_executable(minimal minimal.cc) diff --git a/scripts/cmake-presets/ci-ubuntu-cuda.json b/scripts/cmake-presets/ci-ubuntu-cuda.json index e68d9b6728..4862c6e8a8 100644 --- a/scripts/cmake-presets/ci-ubuntu-cuda.json +++ b/scripts/cmake-presets/ci-ubuntu-cuda.json @@ -61,6 +61,7 @@ "description": "Build with release ORANGE", "inherits": [".ndebug", "base"], "cacheVariables": { + "BUILD_SHARED_LIBS": {"type": "BOOL", "value": "OFF"}, "CELERITAS_USE_ROOT": {"type": "BOOL", "value": "OFF"} } }, @@ -82,7 +83,6 @@ "description": "Build release with vecgeom for testing *only* demos", "inherits": [".ndebug", ".vecgeom", "base"], "cacheVariables": { - "BUILD_SHARED_LIBS": {"type": "BOOL", "value": "ON"}, "BUILD_TESTING": {"type": "BOOL", "value": "ON"}, "CELERITAS_BUILD_DEMOS": {"type": "BOOL", "value": "ON"}, "CELERITAS_BUILD_TESTS": {"type": "BOOL", "value": "OFF"} diff --git a/src/celeritas/CMakeLists.txt b/src/celeritas/CMakeLists.txt index 5f8edf5d78..45a36f527d 100644 --- a/src/celeritas/CMakeLists.txt +++ b/src/celeritas/CMakeLists.txt @@ -246,13 +246,15 @@ if(CELERITAS_USE_VecGeom) ext/VecgeomParams.surface.cu ) endif() -endif() - -if(CELERITAS_USE_VecGeom AND CELERITAS_USE_CUDA) - # This needs to be public because its might be needed - # to resolve the symbols generate by the `nvcc -dlink` of - # one of the executable. - list(APPEND PUBLIC_DEPS VecGeom::vecgeom) + if(CELERITAS_USE_CUDA) + # This needs to be public because its might be needed + # to resolve the symbols generate by the `nvcc -dlink` of + # one of the executable. + list(APPEND PUBLIC_DEPS VecGeom::vecgeom) + elseif(VecGeom_CUDA_FOUND) + # VecGeom is built with CUDA but Celeritas is not + list(APPEND PRIVATE_DEPS VecGeom::vecgeomcuda) + endif() endif() if(CELERITAS_CORE_GEO STREQUAL "VecGeom")