diff --git a/.github/actions/setup-spack/action.yml b/.github/actions/setup-spack/action.yml new file mode 100644 index 0000000..04892fd --- /dev/null +++ b/.github/actions/setup-spack/action.yml @@ -0,0 +1,190 @@ +#-------------------------------- -*- yaml -*- ---------------------------------# +# Copyright Celeritas contributors: see top-level COPYRIGHT file for details +# SPDX-License-Identifier: (Apache-2.0 OR MIT) +#-----------------------------------------------------------------------------# +# Bootstrap a Spack environment, install dependencies, and activate it. +# +# Adapted from Celeritas .github/actions/setup-spack: the spack and +# spack-packages commits and the scripts/spack config files must match the +# Celeritas ones so that dependencies are pulled from the Celeritas spack +# buildcache (ghcr.io/celeritas-project/spack-buildcache). Unlike Celeritas, +# G4VG never pushes to the buildcache. +#-----------------------------------------------------------------------------# + +name: "Set up Spack environment" +description: "Check out Spack, concretize/install deps, and activate the view" +inputs: + cxxstd: + description: "C++ standard to concretize Spack with" + required: true + env-file: + description: "Base environment file to use (optionally relative to scripts/spack/)" + required: false + add: + description: "Space-separated list of additional spack packages to add" + required: false + default: "" + +runs: + using: "composite" + steps: + - name: Set environment and local variables + id: vars + shell: sh + run: | + SPACK_ROOT=$GITHUB_WORKSPACE/spack-src + { + echo "G4VG_SPACK_ENV=$GITHUB_WORKSPACE/spack-env" + echo "G4VG_SPACK_VIEW=/opt/view" + # Used by spack + echo "SPACK_COLOR=always" + echo "SPACK_DISABLE_LOCAL_CONFIG=1" + echo "SPACK_ROOT=$SPACK_ROOT" + } >> "$GITHUB_ENV" + echo "SPACK_PACKAGES_ROOT=$GITHUB_WORKSPACE/spack-pkg" >> "$GITHUB_OUTPUT" + echo "$SPACK_ROOT/bin" >> "$GITHUB_PATH" + # NOTE: keep these refs in sync with Celeritas to reuse its buildcache + - name: Checkout Spack + uses: actions/checkout@v7 + with: + repository: spack/spack + path: ${{env.SPACK_ROOT}} + ref: 307d3b0a68316341401d311c1ef6442ed2f13868 # upstream/develop, 12 September 2026 + - name: Checkout Spack packages + uses: actions/checkout@v7 + with: + repository: spack/spack-packages + path: ${{steps.vars.outputs.SPACK_PACKAGES_ROOT}} + ref: fa11df3be41f58bac19b73346422e06b103ee5b5 # upstream/develop, 6 October 2026 + + - name: Initialize spack environment + id: init + shell: sh + env: + CXXSTD: ${{inputs.cxxstd}} + SPACK_ENV_FILE: ${{inputs.env-file}} + G4VG_SOURCE_DIR: "${{github.workspace}}" + G4VG_SPACK_OPT: "/opt/spack" + SPACK_PACKAGES_ROOT: "${{steps.vars.outputs.SPACK_PACKAGES_ROOT}}" + run: | + mkdir -p "$G4VG_SPACK_ENV" + cd "$G4VG_SPACK_ENV" + "${G4VG_SOURCE_DIR}/scripts/ci/setup-spack-ci-env.sh" ${{inputs.add}} + + # Prefix padding is only needed when pushing to a buildcache + spack -e . config add "config:install_tree:padded_length:False" + + # Dump config file, which encodes the full spack environment settings + { + spack -e . config get --json | jq -c '.["spack"]' + printf '{"repos": {"core": "%s", "builtin": "%s"}}\n' \ + "$(git -C "$SPACK_ROOT" rev-parse HEAD)" \ + "$(git -C "$SPACK_PACKAGES_ROOT" rev-parse HEAD)" + } > spack.config.jsonl + + { + echo "config-hash=$(sha256sum spack.config.jsonl | cut -d' ' -f1)" + echo "stage-dir=$(spack -e . location -S)" + } >> "$GITHUB_OUTPUT" + - name: Dump spack config blame + if: ${{runner.debug}} + shell: sh + working-directory: ${{env.G4VG_SPACK_ENV}} + run: | + spack -e . config blame + + - name: Restore cached lockfile + id: restore + uses: actions/cache/restore@v6 + with: + path: ${{env.G4VG_SPACK_ENV}}/spack.lock + key: lock-${{steps.init.outputs.config-hash}}-${{github.run_id}} + restore-keys: lock-${{steps.init.outputs.config-hash}} + - name: Concretize + if: ${{ !steps.restore.outputs.cache-matched-key }} + id: concretize + shell: sh + working-directory: ${{env.G4VG_SPACK_ENV}} + run: | + echo "::group::Bootstrapping spack" + spack bootstrap now + echo "::endgroup::" + echo "Using mirrors:" + spack -e . mirror list + echo "::group::Available buildcache that explicitly uses cxxstd=$CXXSTD" + spack -e . buildcache list -a -l cxxstd=$CXXSTD || true + echo "::endgroup::" + # NOTE: unlike Celeritas, *don't* use --fresh, so that matching specs + # in the Celeritas buildcache are reused + spack -e . -v concretize + env: + CXXSTD: ${{inputs.cxxstd}} + - name: Cache lockfile + if: ${{ steps.concretize.outcome == 'success' }} + uses: actions/cache/save@v6 + with: + path: ${{env.G4VG_SPACK_ENV}}/spack.lock + key: lock-${{steps.init.outputs.config-hash}}-${{github.run_id}} + - name: Install dependencies + id: install + shell: sh + working-directory: ${{env.G4VG_SPACK_ENV}} + run: | + spack ${{runner.debug && '-vd' || ''}} -e . \ + install -p 8 --use-buildcache=auto + - name: Upload spack config+lockfile on new concretization or failures + if: >- + ${{ !cancelled() + && (!steps.restore.outputs.cache-matched-key + || steps.concretize.outcome == 'failure' + || steps.install.outcome == 'failure') + }} + uses: actions/upload-artifact@v7 + with: + name: >- + ${{format( + 'spack-{0}-{1}-{2}', + steps.init.outputs.config-hash, + github.job || 'action', + strategy.job-index || 0 + )}} + path: "${{env.G4VG_SPACK_ENV}}/spack.*" + retention-days: 1 + - name: Upload logs only if install failed + if: ${{ !cancelled() && steps.install.outcome == 'failure' }} + uses: actions/upload-artifact@v7 + with: + name: >- + ${{format( + 'spack-logs-{0}-{1}-{2}', + steps.init.outputs.config-hash, + github.job || 'action', + strategy.job-index || 0 + )}} + path: "${{steps.init.outputs.stage-dir}}/*.log" + - name: List installed dependencies + if: ${{ !cancelled() }} + shell: sh + working-directory: ${{env.G4VG_SPACK_ENV}} + run: | + echo "::group::Local and concretized" + spack -e . find -lv -c + echo "::endgroup::" + { + echo '```' + spack -e . find -v + echo '```' + } >> "$GITHUB_STEP_SUMMARY" + + - name: Update environment and create rc file + shell: sh + # NOTE: the env transformation might be sensitive to spack version changes + run: | + echo "$G4VG_SPACK_VIEW/bin" >> "$GITHUB_PATH" + spack env activate --sh "$G4VG_SPACK_ENV" > "${G4VG_SPACK_VIEW}/rc" + grep '^export ' "${G4VG_SPACK_VIEW}/rc" \ + | grep -v '^export PATH=' \ + | sed 's/^export \(.*\);\s*$/\1/' >> "$GITHUB_ENV" + echo "::group::Dump ${G4VG_SPACK_VIEW}/rc" + cat "${G4VG_SPACK_VIEW}/rc" + echo "::endgroup::" diff --git a/.github/workflows/build-full.yml b/.github/workflows/build-full.yml index fb99cf5..1f54aa3 100644 --- a/.github/workflows/build-full.yml +++ b/.github/workflows/build-full.yml @@ -7,27 +7,39 @@ concurrency: group: build-${{github.ref}}-${{github.event.pull_request.number || github.run_number}}-${{github.workflow}} cancel-in-progress: true +env: + # VecGeom 2.3 development commit built with HIP for the ROCm image. + # Keep in sync with VECGEOM_2_3_COMMIT in build-spack.yml. + VECGEOM_2_3_COMMIT: 9cb15a8a6c776df385357688260567f1e714a434 + VECGEOM_PREFIX: /opt/vecgeom + VECGEOM_BUILD_DIR: /opt/vecgeom-build + # Keep in sync with the image tags below + CI_IMAGE_DATE: 2026-11-12 + jobs: - # TODO: this currently includes non-GPU builds as well - # and won't actually run on device - # TODO: need to add vecgeom~shared for testing + # NOTE: the containers have GPU toolchains but GitHub runners have no GPU, + # so tests run on host only gpu: - name: gpu + name: gpu-${{matrix.buildtype}}-${{matrix.image}} strategy: fail-fast: false matrix: special: [null] buildtype: ['debug', 'ndebug'] - image: ['rocky-cuda'] + image: ['ubuntu-cuda', 'ubuntu-rocm'] env: CELER_DISABLE_DEVICE: 1 # IMPORTANT CMAKE_PRESET: >- ${{matrix.buildtype}}${{matrix.special && '-' || ''}}${{matrix.special}} - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 container: + # Celeritas CI images: see celeritas scripts/spack/env-docker-{cuda,rocm}.yaml + # - ci-cuda: Ubuntu 24.04, CUDA 13, VecGeom 2.2 +cuda cuda_arch=80, Geant4 11.3 + # - ci-rocm: Ubuntu 24.04, ROCm 7.2, Geant4 11.3, *no* VecGeom (built below) image: >- - docker.io/celeritas/${{ - matrix.image == 'rocky-cuda' && 'ci-rocky-cuda12:2024-12-29' + ghcr.io/celeritas-project/${{ + matrix.image == 'ubuntu-cuda' && 'ci-cuda:2026-11-12' + || matrix.image == 'ubuntu-rocm' && 'ci-rocm:2026-11-12' || null }} steps: @@ -36,14 +48,73 @@ jobs: . /etc/profile echo "/opt/view/bin" >> $GITHUB_PATH echo "CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}" >> $GITHUB_ENV + # NOTE: checkout must occur *after* setting up environment for git tags to work - name: Check out - uses: actions/checkout@v4 + uses: actions/checkout@v7 + with: + fetch-depth: 0 + + ### VecGeom 2.3 with HIP (ROCm image only) ### + + - name: Restore VecGeom HIP installation + if: ${{matrix.image == 'ubuntu-rocm'}} + id: vecgeom-cache + uses: actions/cache@v6 + with: + # NOTE: VecGeom's config points to the builtin VecCore installed + # in its build directory, so that must be cached too + path: | + ${{env.VECGEOM_PREFIX}} + ${{env.VECGEOM_BUILD_DIR}}/installExternals + key: vecgeom-hip-static-v2-gfx90a-${{env.VECGEOM_2_3_COMMIT}}-ci-rocm-${{env.CI_IMAGE_DATE}} + # NOTE: static, since linking the shared libvecgeom.so with HIP device + # code fails with ROCm 7.2 (undefined hidden __hip_gpubin_handle_*) + - name: Build VecGeom with HIP + if: >- + ${{ matrix.image == 'ubuntu-rocm' + && steps.vecgeom-cache.outputs.cache-hit != 'true' }} + working-directory: /tmp + run: | + git clone --filter=blob:none --no-checkout \ + https://gitlab.cern.ch/VecGeom/VecGeom.git vecgeom-src + git -C vecgeom-src checkout --detach "${VECGEOM_2_3_COMMIT}" + cmake -S vecgeom-src -B "${VECGEOM_BUILD_DIR}" -G Ninja \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX="${VECGEOM_PREFIX}" \ + -DCMAKE_PREFIX_PATH=/opt/rocm \ + -DCMAKE_CXX_COMPILER=/opt/rocm/llvm/bin/clang++ \ + -DCMAKE_HIP_COMPILER=/opt/rocm/llvm/bin/clang++ \ + -DCMAKE_HIP_ARCHITECTURES=gfx90a \ + -DCMAKE_CXX_STANDARD=17 \ + -DBUILD_SHARED_LIBS=OFF \ + -DBUILD_TESTING=OFF \ + -DVECGEOM_ENABLE_HIP=ON \ + -DVECGEOM_BUILTIN_VECCORE=ON \ + -DVECGEOM_GDML=ON + cmake --build "${VECGEOM_BUILD_DIR}" -j4 + cmake --install "${VECGEOM_BUILD_DIR}" + - name: Add VecGeom to environment + if: ${{matrix.image == 'ubuntu-rocm'}} + run: | + echo "CMAKE_PREFIX_PATH=${VECGEOM_PREFIX}:/opt/rocm:${CMAKE_PREFIX_PATH}" >> $GITHUB_ENV + { + printf 'VecGeom: [%s](https://gitlab.cern.ch/VecGeom/VecGeom/-/commit/%s) (HIP, %s)\n' \ + "${VECGEOM_2_3_COMMIT}" "${VECGEOM_2_3_COMMIT}" \ + "${{steps.vecgeom-cache.outputs.cache-hit == 'true' && 'cached' || 'built'}}" + } >> $GITHUB_STEP_SUMMARY + + ### G4VG ### + - name: Configure run: | git config --global --add safe.directory ${PWD} - git fetch --tags ln -fs scripts/cmake-presets/ci-${{matrix.image}}.json CMakeUserPresets.json cmake --preset=${CMAKE_PRESET} --log-level=VERBOSE + - name: Check VecGeom version + shell: bash + run: | + grep -h 'define G4VG_VECGEOM_VERSION' $(find build -name G4VGVersion.hh) \ + | tee -a "$GITHUB_STEP_SUMMARY" - name: Build working-directory: build run: | diff --git a/.github/workflows/build-spack.yml b/.github/workflows/build-spack.yml new file mode 100644 index 0000000..f146132 --- /dev/null +++ b/.github/workflows/build-spack.yml @@ -0,0 +1,137 @@ +#-------------------------------- -*- yaml -*- ---------------------------------# +# Build and test G4VG against spack-installed Geant4 and VecGeom versions. +# +# Geant4 (and VecGeom releases) are pulled from the Celeritas spack buildcache; +# the unreleased VecGeom 2.3 is built from source at a pinned commit of the +# `wip/gpu-portability` branch (VecGeom MR 1689). Once VecGeom 2.3.0 is released +# and in spack-packages, replace the commit with `vecgeom@2.3`. +#-----------------------------------------------------------------------------# + +name: build-spack +on: + workflow_dispatch: + inputs: + vecgeom-commit: + description: >- + VecGeom 2.3 commit SHA, or 'latest' for the head of wip/gpu-portability + (default: the pinned commit) + type: string + required: false + default: "" + workflow_call: + inputs: + vecgeom-commit: + type: string + required: false + default: "" + +concurrency: + group: build-spack-${{github.event.pull_request.number || github.ref_name}}-${{github.workflow}} + cancel-in-progress: true + +env: + # Pinned VecGeom 2.3 development commit (wip/gpu-portability, 1 December 2026) + # Keep in sync with VECGEOM_2_3_COMMIT in build-full.yml (ROCm job) + VECGEOM_2_3_COMMIT: 9cb15a8a6c776df385357688260567f1e714a434 + VECGEOM_2_3_BRANCH: wip/gpu-portability + +jobs: + spack: + name: vecgeom@${{matrix.vecgeom}}-g4@${{matrix.geant}} + strategy: + fail-fast: false + matrix: + include: + # Oldest and newest Geant4 supported by Celeritas against VecGeom 2.3 + - vecgeom: "2.3" + geant: "10.5" + cxxstd: 17 + - vecgeom: "2.3" + geant: "11.4" + cxxstd: 20 + # VecGeom 1.x compatibility (same specs as Celeritas 'vecgeom1' job) + - vecgeom: "1.2.11" + geant: "11.3" + cxxstd: 20 + env: + CMAKE_PRESET: debug + CC: "clang-18" + CXX: "clang++-18" + CXXSTD: ${{matrix.cxxstd}} + runs-on: ubuntu-24.04 + steps: + - name: Check out G4VG + uses: actions/checkout@v7 + with: + fetch-depth: 0 # G4VG version is derived from git tags + + - name: Select VecGeom spec + id: vecgeom + shell: bash + env: + VECGEOM_VERSION: ${{matrix.vecgeom}} + VECGEOM_INPUT: ${{inputs.vecgeom-commit}} + run: | + if [[ "$VECGEOM_VERSION" != "2.3" ]]; then + echo "spec=vecgeom@${VECGEOM_VERSION}~cuda" >> "$GITHUB_OUTPUT" + exit 0 + fi + vecgeom_sha="${VECGEOM_INPUT:-$VECGEOM_2_3_COMMIT}" + if [[ "$vecgeom_sha" == "latest" ]]; then + vecgeom_sha=$(git ls-remote --exit-code \ + https://gitlab.cern.ch/VecGeom/VecGeom.git \ + "refs/heads/${VECGEOM_2_3_BRANCH}" | cut -f1) + fi + printf "VecGeom: %s -> %s\n" "${VECGEOM_INPUT:-pinned}" "$vecgeom_sha" + if [[ ! "$vecgeom_sha" =~ ^[0-9a-f]{40}$ ]]; then + echo "::error::VecGeom revision must resolve to a full commit SHA" + exit 1 + fi + printf 'VecGeom: [%s](https://gitlab.cern.ch/VecGeom/VecGeom/-/commit/%s)\n' \ + "$vecgeom_sha" "$vecgeom_sha" >> "$GITHUB_STEP_SUMMARY" + # NOTE: '=master' gives the git commit a version for spack's + # dependency resolution; VecGeom's own CMake reports 2.3.0 + echo "spec=vecgeom@${vecgeom_sha}=master~cuda~surface" >> "$GITHUB_OUTPUT" + + - name: Set up Spack environment + uses: ./.github/actions/setup-spack + with: + cxxstd: ${{env.CXXSTD}} + add: >- + geant4@${{matrix.geant}} + ${{steps.vecgeom.outputs.spec}} + + - name: Configure + run: | + cp scripts/cmake-presets/ci-ubuntu-github.json CMakeUserPresets.json + cmake --preset=${CMAKE_PRESET} --log-level=VERBOSE + - name: Check VecGeom version + shell: bash + run: | + grep -h 'define G4VG_VECGEOM_VERSION' $(find build -name G4VGVersion.hh) \ + | tee -a "$GITHUB_STEP_SUMMARY" + - name: Build + run: | + cmake --build --preset=${CMAKE_PRESET} + - name: Test + run: | + ctest --preset=${CMAKE_PRESET} + - name: Install + run: | + cmake --install build + + - name: Upload diagnostics on failure + if: ${{ failure() }} + uses: actions/upload-artifact@v7 + with: + name: diagnostics-vecgeom@${{matrix.vecgeom}}-g4@${{matrix.geant}} + path: | + spack-env/spack.yaml + spack-env/spack.lock + build/CMakeCache.txt + build/CMakeFiles/CMakeConfigureLog.yaml + build/Testing/Temporary/LastTest.log + if-no-files-found: ignore + retention-days: 3 + +# vim: set nowrap tw=100: diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 388ecc0..590f677 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -17,14 +17,17 @@ concurrency: cancel-in-progress: true jobs: - build: + build-full: uses: ./.github/workflows/build-full.yml + build-spack: + uses: ./.github/workflows/build-spack.yml # Specifying a dependent job allows us to select a single "requires" check in the project GitHub settings all: if: ${{ always() }} needs: - - build + - build-full + - build-spack runs-on: ubuntu-latest steps: - name: Decide whether the needed jobs succeeded or failed diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 149bab2..49e3338 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -12,8 +12,10 @@ concurrency: jobs: build-full: uses: ./.github/workflows/build-full.yml + build-spack: + uses: ./.github/workflows/build-spack.yml all: - needs: [build-full] + needs: [build-full, build-spack] runs-on: ubuntu-latest steps: - name: Success diff --git a/CMakePresets.json b/CMakePresets.json index a7abe00..e44bc89 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -21,6 +21,14 @@ "CMAKE_CUDA_ARCHITECTURES": {"type": "STRING", "value": "70"} } }, + { + "name": ".cuda-ampere", + "hidden": true, + "description": "Options to enable CUDA on Ampere (A100) architecture", + "cacheVariables": { + "CMAKE_CUDA_ARCHITECTURES": {"type": "STRING", "value": "80"} + } + }, { "name": ".ndebug", "hidden": true, diff --git a/scripts/ci/setup-spack-ci-env.sh b/scripts/ci/setup-spack-ci-env.sh new file mode 100755 index 0000000..87619f6 --- /dev/null +++ b/scripts/ci/setup-spack-ci-env.sh @@ -0,0 +1,102 @@ +#!/bin/sh +#-------------------------------- -*- sh -*- ---------------------------------# +# Copyright Celeritas contributors: see top-level COPYRIGHT file for details +# SPDX-License-Identifier: (Apache-2.0 OR MIT) +#-----------------------------------------------------------------------------# +# Create a spack environment in the current directory for use in CI. +# Adapted from Celeritas scripts/ci/setup-spack-ci-env.sh: see +# :/.github/actions/setup-spack/action.yml +# +# Environment variables: +# - SPACK_ENV_FILE: base environment (default: env-ci-base.yaml, relative to +# ${G4VG_SOURCE_DIR}/scripts/spack) +# - SPACK_PACKAGES_ROOT: checkout of spack-packages to use as builtin repo +# - G4VG_SPACK_OPT: spack install tree root +# - G4VG_SPACK_VIEW: spack view directory +# - CXXSTD: preferred C++ standard +# +# Arguments are additional specs to add to the environment. +#-----------------------------------------------------------------------------# + +set -e +log() { + printf "%s: %s\n" "$1" "$2" >&2 +} + +SPACK=$(command -v spack 2>/dev/null || printf "") + +if [ -z "$SPACK" ]; then + log error "spack not found" + exit 1 +fi + +if [ -n "$SPACK_ENV" ]; then + log error "another spack environment is active: run despacktivate first" + exit 1 +fi + +if [ -z "$SPACK_ENV_FILE" ]; then + SPACK_ENV_FILE="env-ci-base.yaml" + log info "Using default SPACK_ENV_FILE: env-ci-base.yaml" +fi +if ! [ -e "${SPACK_ENV_FILE}" ]; then + if [ -z "$G4VG_SOURCE_DIR" ]; then + log error "Missing G4VG_SOURCE_DIR" + exit 1 + fi + SPACK_ENV_FILE="${G4VG_SOURCE_DIR}/scripts/spack/${SPACK_ENV_FILE}" +fi +if ! [ -f "${SPACK_ENV_FILE}" ]; then + log error "Environment file ${SPACK_ENV_FILE} does not exist" + exit 1 +fi + +# Configure separate packages repository *first*: otherwise the +# environment creation will do a lengthy unnecessary checkout +if [ -n "${SPACK_PACKAGES_ROOT}" ]; then + log info "Using custom builtin spack package repo: ${SPACK_PACKAGES_ROOT}" + $SPACK repo set --destination "${SPACK_PACKAGES_ROOT}" builtin +else + SPACK_PACKAGES_ROOT=$(spack location -P builtin) + log warning "Using default builtin spack repo: ${SPACK_PACKAGES_ROOT}" +fi + +# Create environment in current working directory +log status "Creating environment from ${SPACK_ENV_FILE}" +$SPACK env create . "${SPACK_ENV_FILE}" + +# Configure install prefix +if [ -n "${G4VG_SPACK_OPT}" ]; then + log info "Setting spack install prefix to ${G4VG_SPACK_OPT}" + $SPACK -e . config add "config:install_tree:root:${G4VG_SPACK_OPT}" +else + log warning "Omitting spack install prefix: G4VG_SPACK_OPT is not set" +fi + +# Configure view +if [ -n "${G4VG_SPACK_VIEW}" ]; then + log info "Setting spack view to ${G4VG_SPACK_VIEW}" +else + log warning "Omitting spack view: G4VG_SPACK_VIEW is not set" + G4VG_SPACK_VIEW=false +fi +$SPACK -e . config add "view:${G4VG_SPACK_VIEW}" + +# Configure C++ standard +if [ -n "${CXXSTD}" ]; then + log info "Setting cxxstd preference to ${CXXSTD}" + $SPACK -e . config add "packages:all:prefer:[cxxstd=${CXXSTD}]" +else + log warning "no cxxstd preference: CXXSTD not set" +fi + +if [ $# -ne 0 ] ; then + log info "Adding additional packages: $*" + $SPACK -e . add "$@" +fi + +# Add the spack ref so that updating spack will reconcretize +cat >> spack.yaml <g4world(), Options{.append_pointers = false}); + Options opts; + opts.append_pointers = false; + auto converted = g4vg::convert(this->g4world(), opts); ASSERT_TRUE(converted.world); auto& vg_manager = vecgeom::GeoManager::Instance(); @@ -387,7 +388,9 @@ G4VPhysicalVolume* NestedReplicaParametrizationTest::build_world() TEST_F(NestedReplicaParametrizationTest, default_options) { - auto result = this->run(Options{.verbose = true}); + Options opts; + opts.verbose = true; + auto result = this->run(opts); TestResult ref; ref.lv_name = {