From a9d96999e0bdce03b9d63d9fdf29c049cb6e56ca Mon Sep 17 00:00:00 2001 From: Luko van der Maas Date: Thu, 19 Mar 2026 12:42:46 +0100 Subject: [PATCH 01/17] Add ccache support to Dockerfiles and build workflow for improved build performance --- .github/workflows/Dockerfile.alpine | 8 ++- .github/workflows/Dockerfile.archlinux | 8 ++- .github/workflows/buildtest.yml | 96 +++++++++++++++++++++++++- Dockerfile | 19 ++++- 4 files changed, 127 insertions(+), 4 deletions(-) diff --git a/.github/workflows/Dockerfile.alpine b/.github/workflows/Dockerfile.alpine index 852dba7c7..812f1d0b1 100644 --- a/.github/workflows/Dockerfile.alpine +++ b/.github/workflows/Dockerfile.alpine @@ -47,6 +47,7 @@ ARG packages="" RUN apk add --no-cache \ bash \ + ccache \ cmake \ make \ gcc \ @@ -69,12 +70,17 @@ RUN apk add --no-cache \ # Build Storm ############# +ENV CCACHE_DIR=/root/.ccache RUN mkdir /opt/storm WORKDIR /opt/storm # Copy the content of the current local Storm repository into the Docker image COPY . . +# Seed ccache from the workflow cache directory if available. +RUN mkdir -p "$CCACHE_DIR" && \ + if [ -d "/opt/storm/.ci-ccache" ]; then cp -a /opt/storm/.ci-ccache/. "$CCACHE_DIR"/; fi + # Switch to build directory RUN mkdir -p /opt/storm/build WORKDIR /opt/storm/build @@ -102,6 +108,6 @@ RUN cmake -DCMAKE_BUILD_TYPE=$build_type \ # Build Storm # (This can be adapted to only build 'storm' or 'binaries' depending on custom needs) -RUN make -j $no_threads +RUN ccache --max-size=3G && make -j $no_threads && ccache --show-stats WORKDIR /opt/storm diff --git a/.github/workflows/Dockerfile.archlinux b/.github/workflows/Dockerfile.archlinux index d35f1a7e8..4df4bb90b 100644 --- a/.github/workflows/Dockerfile.archlinux +++ b/.github/workflows/Dockerfile.archlinux @@ -51,6 +51,7 @@ ARG packages="" RUN pacman -Syu --noconfirm # Updates needed as Archlinux is rolling release RUN pacman -S --noconfirm \ base-devel \ + ccache \ cmake \ git \ boost \ @@ -67,12 +68,17 @@ RUN pacman -S --noconfirm \ # Build Storm ############# +ENV CCACHE_DIR=/root/.ccache RUN mkdir /opt/storm WORKDIR /opt/storm # Copy the content of the current local Storm repository into the Docker image COPY . . +# Seed ccache from the workflow cache directory if available. +RUN mkdir -p "$CCACHE_DIR" && \ + if [ -d "/opt/storm/.ci-ccache" ]; then cp -a /opt/storm/.ci-ccache/. "$CCACHE_DIR"/; fi + # Switch to build directory RUN mkdir -p /opt/storm/build WORKDIR /opt/storm/build @@ -100,6 +106,6 @@ RUN cmake -DCMAKE_BUILD_TYPE=$build_type \ # Build Storm # (This can be adapted to only build 'storm' or 'binaries' depending on custom needs) -RUN make -j $no_threads +RUN ccache --max-size=3G && make -j $no_threads && ccache --show-stats WORKDIR /opt/storm diff --git a/.github/workflows/buildtest.yml b/.github/workflows/buildtest.yml index d0a7915f3..b7cb124f6 100644 --- a/.github/workflows/buildtest.yml +++ b/.github/workflows/buildtest.yml @@ -125,8 +125,18 @@ jobs: steps: - name: Git clone uses: actions/checkout@v6 + - name: Restore ccache (Docker) + id: ccache-restore + uses: actions/cache/restore@v4 + with: + path: .ci-ccache + key: buildtest-ccache-indepth-${{ matrix.config.buildType }}-${{ matrix.config.ClnExact }}-${{ matrix.config.ClnRatfunc }}-${{ matrix.config.disable_cudd }}-${{ hashFiles('Dockerfile', 'CMakeLists.txt') }}-${{ github.run_id }} + restore-keys: | + buildtest-ccache-indepth-${{ matrix.config.buildType }}-${{ matrix.config.ClnExact }}-${{ matrix.config.ClnRatfunc }}-${{ matrix.config.disable_cudd }}- + buildtest-ccache-indepth- - name: Build storm from Dockerfile run: | + mkdir -p .ci-ccache docker build -t movesrwth/storm:ci . \ --build-arg BASE_IMAGE=movesrwth/${{ matrix.config.baseImg }} \ --build-arg build_type="${{ matrix.config.buildType }}" \ @@ -148,6 +158,19 @@ jobs: --build-arg all_sanitizers="${{ matrix.config.AllSanitizers }}" \ --build-arg cmake_args="${{ matrix.config.cmakeArgs }}" \ --build-arg no_threads=${NR_JOBS} + - name: Export ccache from Docker image + run: | + rm -rf .ci-ccache + mkdir -p .ci-ccache + docker create --name ccache-extract movesrwth/storm:ci + docker cp ccache-extract:/root/.ccache/. .ci-ccache/ || true + docker rm ccache-extract + - name: Save ccache (Docker) + if: always() && steps.ccache-restore.outputs.cache-hit != 'true' + uses: actions/cache/save@v4 + with: + path: .ci-ccache + key: ${{ steps.ccache-restore.outputs.cache-primary-key }} - name: Run Docker run: docker run -d -it --name ci movesrwth/storm:ci - name: Run storm @@ -216,8 +239,19 @@ jobs: uses: actions/checkout@v6 - name: Replace Dockerfile run: cp .github/workflows/Dockerfile.${{ matrix.config.distro }} Dockerfile + - name: Restore ccache (Docker) + id: ccache-restore + uses: actions/cache/restore@v4 + with: + path: .ci-ccache + key: buildtest-ccache-compiler-${{ matrix.config.distro }}-${{ matrix.config.name }}-${{ matrix.config.buildType }}-${{ hashFiles('.github/workflows/Dockerfile.archlinux', '.github/workflows/Dockerfile.alpine', 'CMakeLists.txt') }}-${{ github.run_id }} + restore-keys: | + buildtest-ccache-compiler-${{ matrix.config.distro }}-${{ matrix.config.name }}-${{ matrix.config.buildType }}- + buildtest-ccache-compiler-${{ matrix.config.distro }}- + buildtest-ccache-compiler- - name: Build storm from Dockerfile run: | + mkdir -p .ci-ccache docker build -t movesrwth/storm:ci . \ --build-arg build_type="${{ matrix.config.buildType }}" \ --build-arg carl_tag="master" \ @@ -226,6 +260,19 @@ jobs: --build-arg packages="${{ matrix.config.packages }}" \ --build-arg no_threads=${NR_JOBS} # Omitting arguments disable_*, cln_exact, cln_ratfunc, all_sanitizers + - name: Export ccache from Docker image + run: | + rm -rf .ci-ccache + mkdir -p .ci-ccache + docker create --name ccache-extract movesrwth/storm:ci + docker cp ccache-extract:/root/.ccache/. .ci-ccache/ || true + docker rm ccache-extract + - name: Save ccache (Docker) + if: always() && steps.ccache-restore.outputs.cache-hit != 'true' + uses: actions/cache/save@v4 + with: + path: .ci-ccache + key: ${{ steps.ccache-restore.outputs.cache-primary-key }} - name: Run Docker run: docker run -d -it --name ci movesrwth/storm:ci - name: Run storm @@ -269,8 +316,19 @@ jobs: steps: - name: Git clone uses: actions/checkout@v6 + - name: Restore ccache (Docker) + id: ccache-restore + uses: actions/cache/restore@v4 + with: + path: .ci-ccache + key: buildtest-ccache-linux-${{ matrix.distro }}-${{ matrix.buildType }}-${{ matrix.runner }}-${{ hashFiles('Dockerfile', 'CMakeLists.txt') }}-${{ github.run_id }} + restore-keys: | + buildtest-ccache-linux-${{ matrix.distro }}-${{ matrix.buildType }}-${{ matrix.runner }}- + buildtest-ccache-linux-${{ matrix.distro }}- + buildtest-ccache-linux- - name: Build storm from Dockerfile run: | + mkdir -p .ci-ccache docker build -t movesrwth/storm:ci . \ --build-arg BASE_IMAGE=movesrwth/storm-basesystem:${{ matrix.distro }} \ --build-arg build_type="${{ matrix.buildType }}" \ @@ -278,6 +336,19 @@ jobs: --build-arg no_threads=${NR_JOBS} \ --build-arg cmake_args="-DSTORM_WARNING_AS_ERROR=ON" # Omitting arguments developer, disable_*, cln_exact, cln_ratfunc, all_sanitizers + - name: Export ccache from Docker image + run: | + rm -rf .ci-ccache + mkdir -p .ci-ccache + docker create --name ccache-extract movesrwth/storm:ci + docker cp ccache-extract:/root/.ccache/. .ci-ccache/ || true + docker rm ccache-extract + - name: Save ccache (Docker) + if: always() && steps.ccache-restore.outputs.cache-hit != 'true' + uses: actions/cache/save@v4 + with: + path: .ci-ccache + key: ${{ steps.ccache-restore.outputs.cache-primary-key }} - name: Run Docker run: docker run -d -it --name ci movesrwth/storm:ci - name: Run storm @@ -332,17 +403,38 @@ jobs: buildType: "Debug" } runs-on: ${{ matrix.config.distro }} + env: + CCACHE_DIR: ~/.ccache steps: - uses: maxim-lobanov/setup-xcode@v1 with: xcode-version: ${{ matrix.config.xcode }} - name: Git clone uses: actions/checkout@v6 + - name: Cache Homebrew downloads + uses: actions/cache@v4 + with: + path: ~/Library/Caches/Homebrew + key: buildtest-brew-${{ matrix.config.distro }}-${{ hashFiles('.github/workflows/buildtest.yml') }} + restore-keys: | + buildtest-brew-${{ matrix.config.distro }}- + - name: Cache ccache (macOS) + uses: actions/cache@v4 + with: + path: ~/.ccache + key: buildtest-ccache-macos-${{ matrix.config.distro }}-${{ matrix.config.buildType }}-${{ github.ref_name }} + restore-keys: | + buildtest-ccache-macos-${{ matrix.config.distro }}-${{ matrix.config.buildType }}- + buildtest-ccache-macos-${{ matrix.config.distro }}- - name: Install dependencies # cmake and gmp are already installed run: | brew update - brew install automake boost cln ginac glpk hwloc libarchive xerces-c z3 + brew install automake boost ccache cln ginac glpk hwloc libarchive xerces-c z3 + - name: Prepare ccache + run: | + ccache --max-size=2G + ccache --zero-stats - name: Configure storm run: | mkdir build @@ -351,6 +443,8 @@ jobs: - name: Build storm working-directory: ./build run: make -j ${NR_JOBS} + - name: Print ccache stats + run: ccache --show-stats - name: Run storm (build tree) working-directory: ./build run: ./bin/storm diff --git a/Dockerfile b/Dockerfile index a361f0c8d..60fa12576 100644 --- a/Dockerfile +++ b/Dockerfile @@ -45,12 +45,29 @@ ARG cmake_args="" # Build Storm ############# +RUN if ! command -v ccache >/dev/null 2>&1; then \ + if command -v apt-get >/dev/null 2>&1; then \ + apt-get update && apt-get install -y --no-install-recommends ccache && rm -rf /var/lib/apt/lists/*; \ + elif command -v apk >/dev/null 2>&1; then \ + apk add --no-cache ccache; \ + elif command -v pacman >/dev/null 2>&1; then \ + pacman -S --noconfirm ccache; \ + else \ + echo "No supported package manager found for ccache installation"; \ + fi; \ + fi + +ENV CCACHE_DIR=/root/.ccache RUN mkdir /opt/storm WORKDIR /opt/storm # Copy the content of the current local Storm repository into the Docker image COPY . . +# Seed ccache from the workflow cache directory if available. +RUN mkdir -p "$CCACHE_DIR" && \ + if [ -d "/opt/storm/.ci-ccache" ]; then cp -a /opt/storm/.ci-ccache/. "$CCACHE_DIR"/; fi + # Switch to build directory RUN mkdir -p /opt/storm/build WORKDIR /opt/storm/build @@ -78,6 +95,6 @@ RUN cmake -DCMAKE_BUILD_TYPE=$build_type \ # Build Storm # (This can be adapted to only build 'storm' or 'binaries' depending on custom needs) -RUN make -j $no_threads +RUN ccache --max-size=3G && make -j $no_threads && ccache --show-stats WORKDIR /opt/storm From db2357b41c0fdcadc7a5d8bcebb1597cbda59864 Mon Sep 17 00:00:00 2001 From: Luko van der Maas Date: Thu, 19 Mar 2026 13:58:13 +0100 Subject: [PATCH 02/17] cache test --- src/storm/transformer/AddUncertainty.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/storm/transformer/AddUncertainty.h b/src/storm/transformer/AddUncertainty.h index f31088c1c..664dd56ae 100644 --- a/src/storm/transformer/AddUncertainty.h +++ b/src/storm/transformer/AddUncertainty.h @@ -16,7 +16,7 @@ template class AddUncertainty { public: AddUncertainty(std::shared_ptr> const& originalModel); - std::shared_ptr> transform(double additiveUncertainty, double minimalValue = 0.0001); + std::shared_ptr> transform(double additiveUncertainty, double minimalValue = 0.001); private: storm::Interval addUncertainty(ValueType const& vt, double additiveUncertainty, double minimalValue); From b565e9a06d5ac24bc6521c7f895a2378250d191d Mon Sep 17 00:00:00 2001 From: Luko van der Maas Date: Thu, 19 Mar 2026 15:38:29 +0100 Subject: [PATCH 03/17] Remove PCH when using ccache, fix missing includes. --- .github/workflows/buildtest.yml | 13 +++++++++++-- CMakeLists.txt | 16 +++++++++++++++- src/storm-cli-utilities/CMakeLists.txt | 2 +- src/storm-cli/CMakeLists.txt | 2 +- src/storm-conv-cli/CMakeLists.txt | 2 +- src/storm-conv/CMakeLists.txt | 2 +- src/storm-counterexamples/CMakeLists.txt | 2 +- src/storm-dft-cli/CMakeLists.txt | 2 +- src/storm-dft/CMakeLists.txt | 2 +- src/storm-gamebased-ar/CMakeLists.txt | 2 +- src/storm-gspn-cli/CMakeLists.txt | 2 +- src/storm-gspn/CMakeLists.txt | 2 +- src/storm-pars-cli/CMakeLists.txt | 2 +- src/storm-pars/CMakeLists.txt | 2 +- .../region/RegionSplittingStrategy.h | 3 +++ src/storm-parsers/CMakeLists.txt | 2 +- src/storm-permissive/CMakeLists.txt | 2 +- src/storm-pomdp-cli/CMakeLists.txt | 2 +- src/storm-pomdp/CMakeLists.txt | 2 +- src/storm/CMakeLists.txt | 2 +- src/storm/logic/Formula.h | 2 ++ .../solver/helper/SchedulerTrackingHelper.h | 2 ++ .../bisimulation/DeterministicBlockData.h | 4 ++++ src/storm/utility/SignalHandler.h | 2 ++ src/storm/utility/numerical.h | 1 + src/storm/utility/shortestPaths.h | 6 ++++++ src/storm/utility/threads.cpp | 2 ++ src/storm/utility/threads.h | 2 ++ src/test/storm-dft/CMakeLists.txt | 2 +- src/test/storm-gamebased-ar/CMakeLists.txt | 2 +- src/test/storm-pars/CMakeLists.txt | 2 +- src/test/storm-permissive/CMakeLists.txt | 2 +- src/test/storm-pomdp/CMakeLists.txt | 2 +- src/test/storm/CMakeLists.txt | 8 ++++---- 34 files changed, 76 insertions(+), 29 deletions(-) diff --git a/.github/workflows/buildtest.yml b/.github/workflows/buildtest.yml index b7cb124f6..2088af0bf 100644 --- a/.github/workflows/buildtest.yml +++ b/.github/workflows/buildtest.yml @@ -418,8 +418,11 @@ jobs: key: buildtest-brew-${{ matrix.config.distro }}-${{ hashFiles('.github/workflows/buildtest.yml') }} restore-keys: | buildtest-brew-${{ matrix.config.distro }}- - - name: Cache ccache (macOS) - uses: actions/cache@v4 + - name: Ensure ccache directory exists (macOS) + run: mkdir -p ~/.ccache + - name: Restore ccache (macOS) + id: ccache-restore-macos + uses: actions/cache/restore@v4 with: path: ~/.ccache key: buildtest-ccache-macos-${{ matrix.config.distro }}-${{ matrix.config.buildType }}-${{ github.ref_name }} @@ -445,6 +448,12 @@ jobs: run: make -j ${NR_JOBS} - name: Print ccache stats run: ccache --show-stats + - name: Save ccache (macOS) + if: always() && steps.ccache-restore-macos.outputs.cache-hit != 'true' + uses: actions/cache/save@v4 + with: + path: ~/.ccache + key: ${{ steps.ccache-restore-macos.outputs.cache-primary-key }} - name: Run storm (build tree) working-directory: ./build run: ./bin/storm diff --git a/CMakeLists.txt b/CMakeLists.txt index f6798b6b1..286e11543 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -168,8 +168,16 @@ if(STORM_COMPILE_WITH_CCACHE) mark_as_advanced(CCACHE_FOUND) if(CCACHE_FOUND) message(STATUS "Storm - Using ccache") + message(STATUS "Storm - Disabling precompiled headers because of ccache compatibility.") + set(CMAKE_DISABLE_PRECOMPILE_HEADERS ON) + set(ENV{CCACHE_SLOPPINESS} "pch_defines,time_macros") set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) - set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) + # set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) + if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + add_compile_options($<$:-fpch-preprocess>) + elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") + add_compile_options($<$:-Xclang> $<$:-fno-pch-timestamp>) + endif() else() message(STATUS "Storm - Could not find ccache.") endif() @@ -313,6 +321,12 @@ SET(STORM_PRECOMPILED_HEADERS "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "") +function(storm_target_precompile_headers target) + if(NOT CMAKE_DISABLE_PRECOMPILE_HEADERS) + target_precompile_headers(${target} ${ARGN}) + endif() +endfunction() + ############################################################# ## ## Compiler tests during config diff --git a/src/storm-cli-utilities/CMakeLists.txt b/src/storm-cli-utilities/CMakeLists.txt index eba330827..1af0660f3 100644 --- a/src/storm-cli-utilities/CMakeLists.txt +++ b/src/storm-cli-utilities/CMakeLists.txt @@ -9,7 +9,7 @@ target_sources(storm-cli-utilities ${STORM_CLI_UTIL_SOURCES} PUBLIC FILE_SET fs_storm_cli_utilities_headers TYPE HEADERS BASE_DIRS "${PROJECT_SOURCE_DIR}/src" FILES ${STORM_CLI_UTIL_HEADERS}) -target_precompile_headers(storm-cli-utilities REUSE_FROM storm) +storm_target_precompile_headers(storm-cli-utilities REUSE_FROM storm) set_target_properties(storm-cli-utilities PROPERTIES VERSION ${STORM_VERSION} SOVERSION ${STORM_VERSION}) target_link_libraries(storm-cli-utilities PUBLIC storm storm-counterexamples storm-gamebased-ar storm-parsers storm-version-info) set_target_properties(storm-cli-utilities PROPERTIES DEFINE_SYMBOL "") # to avoid problems with pch on linux. diff --git a/src/storm-cli/CMakeLists.txt b/src/storm-cli/CMakeLists.txt index 21a828f38..ca0565e58 100644 --- a/src/storm-cli/CMakeLists.txt +++ b/src/storm-cli/CMakeLists.txt @@ -3,7 +3,7 @@ add_executable(storm-cli ${PROJECT_SOURCE_DIR}/src/storm-cli/storm-cli.cpp) target_link_libraries(storm-cli storm storm-cli-utilities) set_target_properties(storm-cli PROPERTIES OUTPUT_NAME "storm") set_target_properties(storm-cli PROPERTIES VERSION ${STORM_VERSION} SOVERSION ${STORM_VERSION}) -target_precompile_headers(storm-cli PRIVATE ${STORM_PRECOMPILED_HEADERS}) +storm_target_precompile_headers(storm-cli PRIVATE ${STORM_PRECOMPILED_HEADERS}) add_dependencies(binaries storm-cli) diff --git a/src/storm-conv-cli/CMakeLists.txt b/src/storm-conv-cli/CMakeLists.txt index 4ae4b508d..4836769e3 100644 --- a/src/storm-conv-cli/CMakeLists.txt +++ b/src/storm-conv-cli/CMakeLists.txt @@ -3,7 +3,7 @@ add_executable(storm-conv-cli ${PROJECT_SOURCE_DIR}/src/storm-conv-cli/storm-con target_link_libraries(storm-conv-cli storm-conv storm-cli-utilities) set_target_properties(storm-conv-cli PROPERTIES OUTPUT_NAME "storm-conv") set_target_properties(storm-conv-cli PROPERTIES VERSION ${STORM_VERSION} SOVERSION ${STORM_VERSION}) -target_precompile_headers(storm-conv-cli REUSE_FROM storm-cli) +storm_target_precompile_headers(storm-conv-cli REUSE_FROM storm-cli) add_dependencies(binaries storm-conv-cli) diff --git a/src/storm-conv/CMakeLists.txt b/src/storm-conv/CMakeLists.txt index 05d5a9890..89d7e234f 100644 --- a/src/storm-conv/CMakeLists.txt +++ b/src/storm-conv/CMakeLists.txt @@ -8,7 +8,7 @@ target_sources(storm-conv ${STORM_CONV_SOURCES} PUBLIC FILE_SET fs_storm_conv_headers TYPE HEADERS BASE_DIRS "${PROJECT_SOURCE_DIR}/src" FILES ${STORM_CONV_HEADERS}) -target_precompile_headers(storm-conv REUSE_FROM storm) +storm_target_precompile_headers(storm-conv REUSE_FROM storm) set_target_properties(storm-conv PROPERTIES VERSION ${STORM_VERSION} SOVERSION ${STORM_VERSION}) target_link_libraries(storm-conv PUBLIC storm) set_target_properties(storm-conv PROPERTIES DEFINE_SYMBOL "") # to avoid problems with pch on linux. diff --git a/src/storm-counterexamples/CMakeLists.txt b/src/storm-counterexamples/CMakeLists.txt index 4b787e33c..7448579d0 100644 --- a/src/storm-counterexamples/CMakeLists.txt +++ b/src/storm-counterexamples/CMakeLists.txt @@ -7,7 +7,7 @@ target_sources(storm-counterexamples ${STORM_CEX_SOURCES} PUBLIC FILE_SET fs_storm_cex_headers TYPE HEADERS BASE_DIRS "${PROJECT_SOURCE_DIR}/src" FILES ${STORM_CEX_HEADERS}) -target_precompile_headers(storm-counterexamples REUSE_FROM storm) +storm_target_precompile_headers(storm-counterexamples REUSE_FROM storm) set_target_properties(storm-counterexamples PROPERTIES VERSION ${STORM_VERSION} SOVERSION ${STORM_VERSION}) target_link_libraries(storm-counterexamples PUBLIC storm) set_target_properties(storm-counterexamples PROPERTIES DEFINE_SYMBOL "") # to avoid problems with pch on linux. diff --git a/src/storm-dft-cli/CMakeLists.txt b/src/storm-dft-cli/CMakeLists.txt index 9f2e7f616..ae6ba0ac9 100644 --- a/src/storm-dft-cli/CMakeLists.txt +++ b/src/storm-dft-cli/CMakeLists.txt @@ -3,7 +3,7 @@ add_executable(storm-dft-cli ${PROJECT_SOURCE_DIR}/src/storm-dft-cli/storm-dft.c target_link_libraries(storm-dft-cli storm-dft storm-cli-utilities) set_target_properties(storm-dft-cli PROPERTIES OUTPUT_NAME "storm-dft") set_target_properties(storm-dft-cli PROPERTIES VERSION ${STORM_VERSION} SOVERSION ${STORM_VERSION}) -target_precompile_headers(storm-dft-cli REUSE_FROM storm-cli) +storm_target_precompile_headers(storm-dft-cli REUSE_FROM storm-cli) add_dependencies(binaries storm-dft-cli) diff --git a/src/storm-dft/CMakeLists.txt b/src/storm-dft/CMakeLists.txt index b3e6ce4b3..1391f7d50 100644 --- a/src/storm-dft/CMakeLists.txt +++ b/src/storm-dft/CMakeLists.txt @@ -8,7 +8,7 @@ target_sources(storm-dft ${STORM_DFT_SOURCES} PUBLIC FILE_SET fs_storm_dft_headers TYPE HEADERS BASE_DIRS "${PROJECT_SOURCE_DIR}/src" FILES ${STORM_DFT_HEADERS}) -target_precompile_headers(storm-dft REUSE_FROM storm) +storm_target_precompile_headers(storm-dft REUSE_FROM storm) set_target_properties(storm-dft PROPERTIES VERSION ${STORM_VERSION} SOVERSION ${STORM_VERSION}) target_link_libraries(storm-dft PUBLIC storm storm-gspn storm-conv storm-parsers storm-pars ${STORM_DFT_LINK_LIBRARIES}) set_target_properties(storm-dft PROPERTIES DEFINE_SYMBOL "") # to avoid problems with pch on linux. diff --git a/src/storm-gamebased-ar/CMakeLists.txt b/src/storm-gamebased-ar/CMakeLists.txt index 190a22d89..d9f1b9211 100644 --- a/src/storm-gamebased-ar/CMakeLists.txt +++ b/src/storm-gamebased-ar/CMakeLists.txt @@ -7,7 +7,7 @@ target_sources(storm-gamebased-ar ${STORM_GBAR_SOURCES} PUBLIC FILE_SET fs_storm_gbar_headers TYPE HEADERS BASE_DIRS "${PROJECT_SOURCE_DIR}/src" FILES ${STORM_GBAR_HEADERS}) -target_precompile_headers(storm-gamebased-ar REUSE_FROM storm) +storm_target_precompile_headers(storm-gamebased-ar REUSE_FROM storm) set_target_properties(storm-gamebased-ar PROPERTIES VERSION ${STORM_VERSION} SOVERSION ${STORM_VERSION}) target_link_libraries(storm-gamebased-ar PUBLIC storm) set_target_properties(storm-gamebased-ar PROPERTIES DEFINE_SYMBOL "") # to avoid problems with pch on linux. diff --git a/src/storm-gspn-cli/CMakeLists.txt b/src/storm-gspn-cli/CMakeLists.txt index 7bbc8e8ea..7635d727e 100644 --- a/src/storm-gspn-cli/CMakeLists.txt +++ b/src/storm-gspn-cli/CMakeLists.txt @@ -3,7 +3,7 @@ add_executable(storm-gspn-cli ${PROJECT_SOURCE_DIR}/src/storm-gspn-cli/storm-gsp target_link_libraries(storm-gspn-cli storm-gspn storm-cli-utilities) set_target_properties(storm-gspn-cli PROPERTIES OUTPUT_NAME "storm-gspn") set_target_properties(storm-gspn-cli PROPERTIES VERSION ${STORM_VERSION} SOVERSION ${STORM_VERSION}) -target_precompile_headers(storm-gspn-cli REUSE_FROM storm-cli) +storm_target_precompile_headers(storm-gspn-cli REUSE_FROM storm-cli) add_dependencies(binaries storm-gspn-cli) diff --git a/src/storm-gspn/CMakeLists.txt b/src/storm-gspn/CMakeLists.txt index b8e5caeef..c4d72c7d5 100644 --- a/src/storm-gspn/CMakeLists.txt +++ b/src/storm-gspn/CMakeLists.txt @@ -7,7 +7,7 @@ target_sources(storm-gspn ${STORM_GSPN_SOURCES} PUBLIC FILE_SET fs_storm_gspn_headers TYPE HEADERS BASE_DIRS "${PROJECT_SOURCE_DIR}/src" FILES ${STORM_GSPN_HEADERS}) -target_precompile_headers(storm-gspn REUSE_FROM storm) +storm_target_precompile_headers(storm-gspn REUSE_FROM storm) set_target_properties(storm-gspn PROPERTIES VERSION ${STORM_VERSION} SOVERSION ${STORM_VERSION}) target_link_libraries(storm-gspn PUBLIC storm storm-conv storm-parsers ${STORM_GSPN_LINK_LIBRARIES}) set_target_properties(storm-gspn PROPERTIES DEFINE_SYMBOL "") # to avoid problems with pch on linux. diff --git a/src/storm-pars-cli/CMakeLists.txt b/src/storm-pars-cli/CMakeLists.txt index d7e8d0d2f..c6255dc2e 100644 --- a/src/storm-pars-cli/CMakeLists.txt +++ b/src/storm-pars-cli/CMakeLists.txt @@ -8,7 +8,7 @@ target_link_libraries(storm-pars-cli storm-pars storm-cli-utilities) target_include_directories(storm-pars-cli PRIVATE "${PROJECT_SOURCE_DIR}/src") set_target_properties(storm-pars-cli PROPERTIES OUTPUT_NAME "storm-pars") set_target_properties(storm-pars-cli PROPERTIES VERSION ${STORM_VERSION} SOVERSION ${STORM_VERSION}) -target_precompile_headers(storm-pars-cli REUSE_FROM storm-cli) +storm_target_precompile_headers(storm-pars-cli REUSE_FROM storm-cli) add_dependencies(binaries storm-pars-cli) diff --git a/src/storm-pars/CMakeLists.txt b/src/storm-pars/CMakeLists.txt index 5ceba6116..cdff27042 100644 --- a/src/storm-pars/CMakeLists.txt +++ b/src/storm-pars/CMakeLists.txt @@ -8,7 +8,7 @@ target_sources(storm-pars ${STORM_PARS_SOURCES} PUBLIC FILE_SET fs_storm_pars_headers TYPE HEADERS BASE_DIRS "${PROJECT_SOURCE_DIR}/src" FILES ${STORM_PARS_HEADERS}) -target_precompile_headers(storm-pars REUSE_FROM storm) +storm_target_precompile_headers(storm-pars REUSE_FROM storm) set_target_properties(storm-pars PROPERTIES VERSION ${STORM_VERSION} SOVERSION ${STORM_VERSION}) set_target_properties(storm-pars PROPERTIES DEFINE_SYMBOL "") # to avoid problems with pch on linux. target_link_libraries(storm-pars PUBLIC storm) diff --git a/src/storm-pars/modelchecker/region/RegionSplittingStrategy.h b/src/storm-pars/modelchecker/region/RegionSplittingStrategy.h index df7698ad5..17db3bc94 100644 --- a/src/storm-pars/modelchecker/region/RegionSplittingStrategy.h +++ b/src/storm-pars/modelchecker/region/RegionSplittingStrategy.h @@ -1,5 +1,8 @@ #pragma once +#include +#include +#include #include #include "RegionSplitEstimateKind.h" diff --git a/src/storm-parsers/CMakeLists.txt b/src/storm-parsers/CMakeLists.txt index 8564131b3..e758deb68 100644 --- a/src/storm-parsers/CMakeLists.txt +++ b/src/storm-parsers/CMakeLists.txt @@ -11,7 +11,7 @@ target_sources(storm-parsers ${STORM_PARSER_SOURCES} PUBLIC FILE_SET fs_storm_parsers_headers TYPE HEADERS BASE_DIRS "${PROJECT_SOURCE_DIR}/src" FILES ${STORM_PARSER_HEADERS}) -target_precompile_headers(storm-parsers REUSE_FROM storm) +storm_target_precompile_headers(storm-parsers REUSE_FROM storm) set_target_properties(storm-parsers PROPERTIES VERSION ${STORM_VERSION} SOVERSION ${STORM_VERSION}) set_target_properties(storm-parsers PROPERTIES DEFINE_SYMBOL "") # to avoid problems with pch on linux. target_link_libraries(storm-parsers PUBLIC storm) diff --git a/src/storm-permissive/CMakeLists.txt b/src/storm-permissive/CMakeLists.txt index 1b5138ce8..323ac622a 100644 --- a/src/storm-permissive/CMakeLists.txt +++ b/src/storm-permissive/CMakeLists.txt @@ -8,7 +8,7 @@ target_sources(storm-permissive ${STORM_PERMISSIVE_SOURCES} PUBLIC FILE_SET fs_storm_permissive_headers TYPE HEADERS BASE_DIRS "${PROJECT_SOURCE_DIR}/src" FILES ${STORM_PERMISSIVE_HEADERS}) -target_precompile_headers(storm-permissive REUSE_FROM storm) +storm_target_precompile_headers(storm-permissive REUSE_FROM storm) set_target_properties(storm-permissive PROPERTIES VERSION ${STORM_VERSION} SOVERSION ${STORM_VERSION}) set_target_properties(storm-permissive PROPERTIES DEFINE_SYMBOL "") # to avoid problems with pch on linux. target_link_libraries(storm-permissive PUBLIC storm) diff --git a/src/storm-pomdp-cli/CMakeLists.txt b/src/storm-pomdp-cli/CMakeLists.txt index e68c6cc5d..316d62cf7 100644 --- a/src/storm-pomdp-cli/CMakeLists.txt +++ b/src/storm-pomdp-cli/CMakeLists.txt @@ -5,7 +5,7 @@ add_executable(storm-pomdp-cli ${PROJECT_SOURCE_DIR}/src/storm-pomdp-cli/storm-p target_link_libraries(storm-pomdp-cli storm-pomdp storm-cli-utilities) set_target_properties(storm-pomdp-cli PROPERTIES OUTPUT_NAME "storm-pomdp") target_include_directories(storm-pomdp-cli PRIVATE "${PROJECT_SOURCE_DIR}/src") -target_precompile_headers(storm-pomdp-cli REUSE_FROM storm-cli) +storm_target_precompile_headers(storm-pomdp-cli REUSE_FROM storm-cli) set_target_properties(storm-pomdp-cli PROPERTIES VERSION ${STORM_VERSION} SOVERSION ${STORM_VERSION}) add_dependencies(binaries storm-pomdp-cli) diff --git a/src/storm-pomdp/CMakeLists.txt b/src/storm-pomdp/CMakeLists.txt index 019585a30..9701f93bf 100644 --- a/src/storm-pomdp/CMakeLists.txt +++ b/src/storm-pomdp/CMakeLists.txt @@ -8,7 +8,7 @@ target_sources(storm-pomdp ${STORM_POMDP_SOURCES} PUBLIC FILE_SET fs_storm_pomdp_headers TYPE HEADERS BASE_DIRS "${PROJECT_SOURCE_DIR}/src" FILES ${STORM_POMDP_HEADERS}) -target_precompile_headers(storm-pomdp REUSE_FROM storm) +storm_target_precompile_headers(storm-pomdp REUSE_FROM storm) set_target_properties(storm-pomdp PROPERTIES VERSION ${STORM_VERSION} SOVERSION ${STORM_VERSION}) set_target_properties(storm-pomdp PROPERTIES DEFINE_SYMBOL "") # to avoid problems with pch on linux. target_link_libraries(storm-pomdp PUBLIC storm storm-parsers storm-pars) diff --git a/src/storm/CMakeLists.txt b/src/storm/CMakeLists.txt index 24d978ca8..742197c28 100644 --- a/src/storm/CMakeLists.txt +++ b/src/storm/CMakeLists.txt @@ -19,7 +19,7 @@ add_library(storm SHARED) target_sources(storm PRIVATE ${STORM_SOURCES}) target_sources(storm PUBLIC FILE_SET fs_storm_headers TYPE HEADERS BASE_DIRS "${PROJECT_SOURCE_DIR}/src" FILES ${STORM_HEADERS}) target_sources(storm PUBLIC FILE_SET fs_storm_configured_headers TYPE HEADERS BASE_DIRS "${PROJECT_BINARY_DIR}/include" FILES ${STORM_BUILD_HEADERS}) -target_precompile_headers(storm PRIVATE ${STORM_PRECOMPILED_HEADERS}) +storm_target_precompile_headers(storm PRIVATE ${STORM_PRECOMPILED_HEADERS}) set_target_properties(storm PROPERTIES VERSION ${STORM_VERSION} SOVERSION ${STORM_VERSION}) set_target_properties(storm PROPERTIES DEFINE_SYMBOL "") # to avoid problems with pch on linux. set_target_properties(storm PROPERTIES BUILD_RPATH ${STORM_3RDPARTY_BINARY_DIR}/spot/lib/) diff --git a/src/storm/logic/Formula.h b/src/storm/logic/Formula.h index 57863e123..ee307b3d4 100644 --- a/src/storm/logic/Formula.h +++ b/src/storm/logic/Formula.h @@ -1,7 +1,9 @@ #ifndef STORM_LOGIC_FORMULA_H_ #define STORM_LOGIC_FORMULA_H_ +#include #include +#include #include #include #include diff --git a/src/storm/solver/helper/SchedulerTrackingHelper.h b/src/storm/solver/helper/SchedulerTrackingHelper.h index 7a3ad04c3..95245dbd9 100644 --- a/src/storm/solver/helper/SchedulerTrackingHelper.h +++ b/src/storm/solver/helper/SchedulerTrackingHelper.h @@ -2,6 +2,8 @@ #include #include +#include + #include "storm/solver/OptimizationDirection.h" #include "storm/solver/UncertaintyResolutionMode.h" #include "storm/solver/helper/ValueIterationOperatorForward.h" diff --git a/src/storm/storage/bisimulation/DeterministicBlockData.h b/src/storm/storage/bisimulation/DeterministicBlockData.h index e0f345813..84f274436 100644 --- a/src/storm/storage/bisimulation/DeterministicBlockData.h +++ b/src/storm/storage/bisimulation/DeterministicBlockData.h @@ -1,5 +1,9 @@ #pragma once +#include +#include +#include + #include "storm/storage/bisimulation/Block.h" namespace storm { diff --git a/src/storm/utility/SignalHandler.h b/src/storm/utility/SignalHandler.h index 59cba034b..f7602d99d 100644 --- a/src/storm/utility/SignalHandler.h +++ b/src/storm/utility/SignalHandler.h @@ -3,6 +3,8 @@ #include #include +#include + #include "storm-config.h" #include "storm/utility/OsDetection.h" diff --git a/src/storm/utility/numerical.h b/src/storm/utility/numerical.h index 25e15308d..b8e904c58 100644 --- a/src/storm/utility/numerical.h +++ b/src/storm/utility/numerical.h @@ -1,5 +1,6 @@ #pragma once +#include #include namespace storm { diff --git a/src/storm/utility/shortestPaths.h b/src/storm/utility/shortestPaths.h index 63acb9fd8..fd0b7c3c2 100644 --- a/src/storm/utility/shortestPaths.h +++ b/src/storm/utility/shortestPaths.h @@ -1,7 +1,13 @@ #ifndef STORM_UTIL_SHORTESTPATHS_H_ #define STORM_UTIL_SHORTESTPATHS_H_ +#include +#include #include +#include +#include +#include +#include #include #include diff --git a/src/storm/utility/threads.cpp b/src/storm/utility/threads.cpp index eee44c2e9..0731c75ed 100644 --- a/src/storm/utility/threads.cpp +++ b/src/storm/utility/threads.cpp @@ -1,5 +1,7 @@ #include "storm/utility/threads.h" +#include +#include #include #include diff --git a/src/storm/utility/threads.h b/src/storm/utility/threads.h index a5851a0d6..2fe6e9b7b 100644 --- a/src/storm/utility/threads.h +++ b/src/storm/utility/threads.h @@ -1,5 +1,7 @@ #pragma once +#include + namespace storm { namespace utility { uint64_t getNumberOfThreads(); diff --git a/src/test/storm-dft/CMakeLists.txt b/src/test/storm-dft/CMakeLists.txt index d8e12cc84..bb54502a4 100644 --- a/src/test/storm-dft/CMakeLists.txt +++ b/src/test/storm-dft/CMakeLists.txt @@ -12,7 +12,7 @@ foreach (testsuite api bdd simulator storage transformations) target_link_libraries(test-dft-${testsuite} storm-dft storm-parsers) target_link_libraries(test-dft-${testsuite} ${STORM_TEST_LINK_LIBRARIES}) target_include_directories(test-dft-${testsuite} PRIVATE "${PROJECT_SOURCE_DIR}/src") - target_precompile_headers(test-dft-${testsuite} REUSE_FROM test-builder) + storm_target_precompile_headers(test-dft-${testsuite} REUSE_FROM test-builder) add_dependencies(test-dft-${testsuite} test-resources) add_test(NAME run-test-dft-${testsuite} COMMAND $) diff --git a/src/test/storm-gamebased-ar/CMakeLists.txt b/src/test/storm-gamebased-ar/CMakeLists.txt index 7436c99b5..554764567 100644 --- a/src/test/storm-gamebased-ar/CMakeLists.txt +++ b/src/test/storm-gamebased-ar/CMakeLists.txt @@ -11,7 +11,7 @@ foreach (testsuite abstraction modelchecker) target_link_libraries(test-gamebased-ar-${testsuite} storm-gamebased-ar storm-parsers) target_link_libraries(test-gamebased-ar-${testsuite} ${STORM_TEST_LINK_LIBRARIES}) target_include_directories(test-gamebased-ar-${testsuite} PRIVATE "${PROJECT_SOURCE_DIR}/src") - target_precompile_headers(test-gamebased-ar-${testsuite} REUSE_FROM test-builder) + storm_target_precompile_headers(test-gamebased-ar-${testsuite} REUSE_FROM test-builder) add_dependencies(test-gamebased-ar-${testsuite} test-resources) add_test(NAME run-test-gamebased-ar-${testsuite} COMMAND $) diff --git a/src/test/storm-pars/CMakeLists.txt b/src/test/storm-pars/CMakeLists.txt index 6b66b6d6e..32753f211 100644 --- a/src/test/storm-pars/CMakeLists.txt +++ b/src/test/storm-pars/CMakeLists.txt @@ -11,7 +11,7 @@ foreach (testsuite derivative modelchecker transformer utility) target_link_libraries(test-pars-${testsuite} storm-pars storm-parsers) target_link_libraries(test-pars-${testsuite} ${STORM_TEST_LINK_LIBRARIES}) target_include_directories(test-pars-${testsuite} PRIVATE "${PROJECT_SOURCE_DIR}/src") - target_precompile_headers(test-pars-${testsuite} REUSE_FROM test-builder) + storm_target_precompile_headers(test-pars-${testsuite} REUSE_FROM test-builder) add_dependencies(test-pars-${testsuite} test-resources) add_test(NAME run-test-pars-${testsuite} COMMAND $) diff --git a/src/test/storm-permissive/CMakeLists.txt b/src/test/storm-permissive/CMakeLists.txt index e382cf98e..49406045c 100644 --- a/src/test/storm-permissive/CMakeLists.txt +++ b/src/test/storm-permissive/CMakeLists.txt @@ -11,7 +11,7 @@ foreach (testsuite analysis) target_link_libraries(test-permissive-${testsuite} storm-permissive storm-parsers) target_link_libraries(test-permissive-${testsuite} ${STORM_TEST_LINK_LIBRARIES}) target_include_directories(test-permissive-${testsuite} PRIVATE "${PROJECT_SOURCE_DIR}/src") - target_precompile_headers(test-permissive-${testsuite} REUSE_FROM test-builder) + storm_target_precompile_headers(test-permissive-${testsuite} REUSE_FROM test-builder) add_dependencies(test-permissive-${testsuite} test-resources) add_test(NAME run-test-permissive-${testsuite} COMMAND $) diff --git a/src/test/storm-pomdp/CMakeLists.txt b/src/test/storm-pomdp/CMakeLists.txt index 3d31c7a49..86665b07a 100644 --- a/src/test/storm-pomdp/CMakeLists.txt +++ b/src/test/storm-pomdp/CMakeLists.txt @@ -11,7 +11,7 @@ foreach (testsuite analysis api modelchecker tracking transformation) target_link_libraries(test-pomdp-${testsuite} storm-pomdp storm-parsers) target_link_libraries(test-pomdp-${testsuite} ${STORM_TEST_LINK_LIBRARIES}) target_include_directories(test-pomdp-${testsuite} PRIVATE "${PROJECT_SOURCE_DIR}/src") - target_precompile_headers(test-pomdp-${testsuite} REUSE_FROM test-builder) + storm_target_precompile_headers(test-pomdp-${testsuite} REUSE_FROM test-builder) add_dependencies(test-pomdp-${testsuite} test-resources) add_test(NAME run-test-pomdp-${testsuite} COMMAND $) diff --git a/src/test/storm/CMakeLists.txt b/src/test/storm/CMakeLists.txt index b1e6831b9..ebe43a434 100755 --- a/src/test/storm/CMakeLists.txt +++ b/src/test/storm/CMakeLists.txt @@ -26,10 +26,10 @@ foreach(testsuite ${NON_SPLIT_TESTS}) add_executable(test-${testsuite} ${TEST_${testsuite}_FILES} ${STORM_TESTS_BASE_PATH}/storm-test.cpp) if (REUSE_PCH_FROM STREQUAL "") # note that reusing from storm main leads to errors on arch linux (late 2023). - target_precompile_headers(test-${testsuite} PRIVATE ${STORM_PRECOMPILED_HEADERS}) + storm_target_precompile_headers(test-${testsuite} PRIVATE ${STORM_PRECOMPILED_HEADERS}) set(REUSE_PCH_FROM "test-${testsuite}") else () - target_precompile_headers(test-${testsuite} REUSE_FROM ${REUSE_PCH_FROM}) + storm_target_precompile_headers(test-${testsuite} REUSE_FROM ${REUSE_PCH_FROM}) endif() configure_testsuite_target(${testsuite}) endforeach() @@ -39,7 +39,7 @@ foreach(modelchecker_split ${MODELCHECKER_TEST_SPLITS}) file(GLOB_RECURSE TEST_MODELCHECKER_${modelchecker_split}_FILES ${STORM_TESTS_BASE_PATH}/modelchecker/${modelchecker_split}/*.h ${STORM_TESTS_BASE_PATH}/modelchecker/${modelchecker_split}/*.cpp ${STORM_TESTS_BASE_PATH}/../storm_gtest.cpp) add_executable(test-modelchecker-${modelchecker_split} ${TEST_MODELCHECKER_${modelchecker_split}_FILES} ${STORM_TESTS_BASE_PATH}/storm-test.cpp) configure_testsuite_target(modelchecker-${modelchecker_split}) - target_precompile_headers(test-modelchecker-${modelchecker_split} REUSE_FROM ${REUSE_PCH_FROM}) + storm_target_precompile_headers(test-modelchecker-${modelchecker_split} REUSE_FROM ${REUSE_PCH_FROM}) endforeach() # Modelchecker-Prctl testsuite split @@ -47,5 +47,5 @@ foreach(prctl_split ${MODELCHECKER_PRCTL_TEST_SPLITS}) file(GLOB_RECURSE TEST_MODELCHECKER_PRCTL_${prctl_split}_FILES ${STORM_TESTS_BASE_PATH}/modelchecker/prctl/${prctl_split}/*.h ${STORM_TESTS_BASE_PATH}/modelchecker/prctl/${prctl_split}/*.cpp ${STORM_TESTS_BASE_PATH}/../storm_gtest.cpp) add_executable(test-modelchecker-prctl-${prctl_split} ${TEST_MODELCHECKER_PRCTL_${prctl_split}_FILES} ${STORM_TESTS_BASE_PATH}/storm-test.cpp) configure_testsuite_target(modelchecker-prctl-${prctl_split}) - target_precompile_headers(test-modelchecker-prctl-${prctl_split} REUSE_FROM ${REUSE_PCH_FROM}) + storm_target_precompile_headers(test-modelchecker-prctl-${prctl_split} REUSE_FROM ${REUSE_PCH_FROM}) endforeach() From d89c26c1de9703c9623dc4a1e997e8d22481c924 Mon Sep 17 00:00:00 2001 From: Luko van der Maas Date: Thu, 19 Mar 2026 16:00:53 +0100 Subject: [PATCH 04/17] Update cache key in build workflow and fix includes --- .github/workflows/buildtest.yml | 2 +- src/storm/storage/bisimulation/Block.h | 2 ++ src/storm/utility/shortestPaths.h | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/buildtest.yml b/.github/workflows/buildtest.yml index 2088af0bf..3cc8423d5 100644 --- a/.github/workflows/buildtest.yml +++ b/.github/workflows/buildtest.yml @@ -425,7 +425,7 @@ jobs: uses: actions/cache/restore@v4 with: path: ~/.ccache - key: buildtest-ccache-macos-${{ matrix.config.distro }}-${{ matrix.config.buildType }}-${{ github.ref_name }} + key: buildtest-ccache-macos-${{ matrix.config.distro }}-${{ matrix.config.buildType }}-${{ hashFiles('CMakeLists.txt', '.github/workflows/buildtest.yml') }}-${{ github.run_id }} restore-keys: | buildtest-ccache-macos-${{ matrix.config.distro }}-${{ matrix.config.buildType }}- buildtest-ccache-macos-${{ matrix.config.distro }}- diff --git a/src/storm/storage/bisimulation/Block.h b/src/storm/storage/bisimulation/Block.h index db412e739..d7bc86499 100644 --- a/src/storm/storage/bisimulation/Block.h +++ b/src/storm/storage/bisimulation/Block.h @@ -1,5 +1,7 @@ #pragma once +#include + #include "storm/storage/sparse/StateType.h" namespace storm { diff --git a/src/storm/utility/shortestPaths.h b/src/storm/utility/shortestPaths.h index fd0b7c3c2..8e3696c49 100644 --- a/src/storm/utility/shortestPaths.h +++ b/src/storm/utility/shortestPaths.h @@ -2,8 +2,8 @@ #define STORM_UTIL_SHORTESTPATHS_H_ #include -#include #include +#include #include #include #include From d578afccd856486dd9ffe04569097ee37c667d84 Mon Sep 17 00:00:00 2001 From: Luko van der Maas Date: Thu, 19 Mar 2026 17:07:37 +0100 Subject: [PATCH 05/17] Enhance ccache usage with verbose output in Dockerfiles and build workflow; add benchmark script for compile time analysis --- .github/workflows/Dockerfile.alpine | 2 +- .github/workflows/Dockerfile.archlinux | 2 +- .github/workflows/buildtest.yml | 2 +- CMakeLists.txt | 5 - Dockerfile | 2 +- resources/scripts/benchmark-pch-ccache.sh | 232 ++++++++++++++++++++++ 6 files changed, 236 insertions(+), 9 deletions(-) create mode 100755 resources/scripts/benchmark-pch-ccache.sh diff --git a/.github/workflows/Dockerfile.alpine b/.github/workflows/Dockerfile.alpine index 812f1d0b1..482796d98 100644 --- a/.github/workflows/Dockerfile.alpine +++ b/.github/workflows/Dockerfile.alpine @@ -108,6 +108,6 @@ RUN cmake -DCMAKE_BUILD_TYPE=$build_type \ # Build Storm # (This can be adapted to only build 'storm' or 'binaries' depending on custom needs) -RUN ccache --max-size=3G && make -j $no_threads && ccache --show-stats +RUN ccache --max-size=3G && make -j $no_threads && ccache --show-stats --verbose WORKDIR /opt/storm diff --git a/.github/workflows/Dockerfile.archlinux b/.github/workflows/Dockerfile.archlinux index 4df4bb90b..cb411a7c1 100644 --- a/.github/workflows/Dockerfile.archlinux +++ b/.github/workflows/Dockerfile.archlinux @@ -106,6 +106,6 @@ RUN cmake -DCMAKE_BUILD_TYPE=$build_type \ # Build Storm # (This can be adapted to only build 'storm' or 'binaries' depending on custom needs) -RUN ccache --max-size=3G && make -j $no_threads && ccache --show-stats +RUN ccache --max-size=3G && make -j $no_threads && ccache --show-stats --verbose WORKDIR /opt/storm diff --git a/.github/workflows/buildtest.yml b/.github/workflows/buildtest.yml index 3cc8423d5..a8aef2d31 100644 --- a/.github/workflows/buildtest.yml +++ b/.github/workflows/buildtest.yml @@ -447,7 +447,7 @@ jobs: working-directory: ./build run: make -j ${NR_JOBS} - name: Print ccache stats - run: ccache --show-stats + run: ccache --show-stats --verbose - name: Save ccache (macOS) if: always() && steps.ccache-restore-macos.outputs.cache-hit != 'true' uses: actions/cache/save@v4 diff --git a/CMakeLists.txt b/CMakeLists.txt index 286e11543..002398532 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -173,11 +173,6 @@ if(STORM_COMPILE_WITH_CCACHE) set(ENV{CCACHE_SLOPPINESS} "pch_defines,time_macros") set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) # set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) - if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") - add_compile_options($<$:-fpch-preprocess>) - elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") - add_compile_options($<$:-Xclang> $<$:-fno-pch-timestamp>) - endif() else() message(STATUS "Storm - Could not find ccache.") endif() diff --git a/Dockerfile b/Dockerfile index 60fa12576..3b084ab1a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -95,6 +95,6 @@ RUN cmake -DCMAKE_BUILD_TYPE=$build_type \ # Build Storm # (This can be adapted to only build 'storm' or 'binaries' depending on custom needs) -RUN ccache --max-size=3G && make -j $no_threads && ccache --show-stats +RUN ccache --max-size=3G && make -j $no_threads && ccache --show-stats --verbose WORKDIR /opt/storm diff --git a/resources/scripts/benchmark-pch-ccache.sh b/resources/scripts/benchmark-pch-ccache.sh new file mode 100755 index 000000000..2df314444 --- /dev/null +++ b/resources/scripts/benchmark-pch-ccache.sh @@ -0,0 +1,232 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Benchmark Storm compile time across: +# - PCH enabled/disabled +# - ccache cold/warm +# +# The script uses ccache through CMake compiler launchers and controls PCH via +# CMAKE_DISABLE_PRECOMPILE_HEADERS, so all four combinations are measurable. + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +SOURCE_DIR="$(cd "${SCRIPT_DIR}/../.." && pwd)" +BUILD_ROOT="${SOURCE_DIR}/build-bench-pch-ccache" +CCACHE_ROOT="" +BUILD_TYPE="Release" +TARGET="storm" +JOBS="$(command -v nproc >/dev/null 2>&1 && nproc || echo 4)" +GENERATOR="" +EXTRA_CMAKE_ARGS=() + +usage() { + cat <<'EOF' +Usage: benchmark-pch-ccache.sh [options] + +Options: + --source-dir Storm source directory (default: repo root) + --build-root Directory for benchmark build trees/results + --ccache-root Directory for benchmark ccache data (default: /ccache) + --build-type CMake build type (default: Release) + --target Build target (default: storm) + --jobs Parallel build jobs (default: nproc or 4) + --generator CMake generator (e.g. Ninja) + --cmake-arg Extra CMake argument (can be repeated) + --help Show this help + +Output: + - Summary table in stdout + - CSV at /results.csv + - Per-run ccache stats in /results/ +EOF +} + +require_cmd() { + if ! command -v "$1" >/dev/null 2>&1; then + echo "Error: required command '$1' not found" >&2 + exit 1 + fi +} + +extract_stat() { + local label="$1" + local file="$2" + awk -F: -v key="$label" ' + $1 ~ key { + gsub(/^[[:space:]]+|[[:space:]]+$/, "", $2) + gsub(/[[:space:]]/, "", $2) + print $2 + found=1 + exit + } + END { if (!found) print 0 } + ' "$file" +} + +run_case() { + local pch_mode="$1" # on|off + local cache_state="$2" # cold|warm + local namespace="storm-bench-pch-${pch_mode}" + local ccache_dir="${CCACHE_ROOT}/${namespace}" + local disable_pch="OFF" + + if [[ "$pch_mode" == "off" ]]; then + disable_pch="ON" + fi + + local build_dir="${BUILD_ROOT}/build-${pch_mode}" + local result_dir="${BUILD_ROOT}/results" + mkdir -p "$result_dir" + + export CCACHE_DIR="$ccache_dir" + export CCACHE_NAMESPACE="$namespace" + export CCACHE_BASEDIR="$SOURCE_DIR" + export CCACHE_NOHASHDIR="1" + + if [[ "$cache_state" == "cold" ]]; then + rm -rf "$ccache_dir" + rm -rf "$build_dir" + fi + mkdir -p "$ccache_dir" + ccache --zero-stats >/dev/null + + local cmake_cmd=(cmake -S "$SOURCE_DIR" -B "$build_dir" + -DCMAKE_DISABLE_PRECOMPILE_HEADERS="$disable_pch" + -DCMAKE_BUILD_TYPE="$BUILD_TYPE") + + if [[ -n "$GENERATOR" ]]; then + cmake_cmd+=(-G "$GENERATOR") + fi + + if [[ ${#EXTRA_CMAKE_ARGS[@]} -gt 0 ]]; then + cmake_cmd+=("${EXTRA_CMAKE_ARGS[@]}") + fi + + if [[ "$cache_state" == "cold" || ! -d "$build_dir" ]]; then + echo "[benchmark] Configure: pch=${pch_mode}, cache=${cache_state}" + "${cmake_cmd[@]}" >/dev/null + fi + + if [[ "$cache_state" == "warm" ]]; then + # Rebuild in the same build directory to keep paths stable for ccache. + cmake --build "$build_dir" --target clean -j "$JOBS" >/dev/null || true + fi + + local time_file="${result_dir}/time-${pch_mode}-${cache_state}.txt" + echo "[benchmark] Build: pch=${pch_mode}, cache=${cache_state}" + /usr/bin/time -f "%e" -o "$time_file" \ + cmake --build "$build_dir" --target "$TARGET" -j "$JOBS" >/dev/null + + local stats_file="${result_dir}/ccache-${pch_mode}-${cache_state}.txt" + ccache --show-stats --verbose >"$stats_file" + + local elapsed + elapsed="$(cat "$time_file")" + + local cacheable hits misses uncacheable + cacheable="$(extract_stat "Cacheable calls" "$stats_file")" + hits="$(extract_stat "Hits" "$stats_file")" + misses="$(extract_stat "Misses" "$stats_file")" + uncacheable="$(extract_stat "Uncacheable calls" "$stats_file")" + + local hit_rate="0.00" + if [[ "$cacheable" != "0" ]]; then + hit_rate="$(awk -v h="$hits" -v c="$cacheable" 'BEGIN { printf "%.2f", (100.0*h)/c }')" + fi + + printf "%s,%s,%s,%s,%s,%s,%s\n" \ + "$pch_mode" "$cache_state" "$elapsed" "$cacheable" "$hits" "$misses" "$uncacheable" \ + >>"${BUILD_ROOT}/results.csv" + + printf "%-8s %-6s %10s %12s %10s %10s %12s %9s\n" \ + "$pch_mode" "$cache_state" "$elapsed" "$cacheable" "$hits" "$misses" "$uncacheable" "${hit_rate}%" +} + +while [[ $# -gt 0 ]]; do + case "$1" in + --source-dir) + SOURCE_DIR="$2" + shift 2 + ;; + --build-root) + BUILD_ROOT="$2" + shift 2 + ;; + --ccache-root) + CCACHE_ROOT="$2" + shift 2 + ;; + --build-type) + BUILD_TYPE="$2" + shift 2 + ;; + --target) + TARGET="$2" + shift 2 + ;; + --jobs) + JOBS="$2" + shift 2 + ;; + --generator) + GENERATOR="$2" + shift 2 + ;; + --cmake-arg) + EXTRA_CMAKE_ARGS+=("$2") + shift 2 + ;; + --help) + usage + exit 0 + ;; + *) + echo "Unknown argument: $1" >&2 + usage + exit 1 + ;; + esac +done + +require_cmd cmake +require_cmd ccache +require_cmd /usr/bin/time + +if [[ -z "$CCACHE_ROOT" ]]; then + CCACHE_ROOT="${BUILD_ROOT}/ccache" +fi + +mkdir -p "$BUILD_ROOT" +mkdir -p "$CCACHE_ROOT" +: >"${BUILD_ROOT}/results.csv" +echo "pch,cache_state,build_seconds,cacheable_calls,hits,misses,uncacheable_calls" >>"${BUILD_ROOT}/results.csv" + +echo +echo "Benchmark settings" +echo " source-dir: $SOURCE_DIR" +echo " build-root: $BUILD_ROOT" +echo " ccache-root: $CCACHE_ROOT" +echo " build-type: $BUILD_TYPE" +echo " target: $TARGET" +echo " jobs: $JOBS" +if [[ -n "$GENERATOR" ]]; then + echo " generator: $GENERATOR" +fi +if [[ ${#EXTRA_CMAKE_ARGS[@]} -gt 0 ]]; then + echo " extra args: ${EXTRA_CMAKE_ARGS[*]}" +fi + +echo +echo "Results" +printf "%-8s %-6s %10s %12s %10s %10s %12s %9s\n" \ + "pch" "cache" "seconds" "cacheable" "hits" "misses" "uncacheable" "hit-rate" +printf "%-8s %-6s %10s %12s %10s %10s %12s %9s\n" \ + "--------" "------" "----------" "------------" "----------" "----------" "------------" "---------" + +run_case on cold +run_case on warm +run_case off cold +run_case off warm + +echo +echo "CSV written to: ${BUILD_ROOT}/results.csv" +echo "Raw stats in: ${BUILD_ROOT}/results" From c905fc49fd41f0e7c081c4104405643012aab307 Mon Sep 17 00:00:00 2001 From: Luko van der Maas Date: Thu, 19 Mar 2026 19:24:38 +0100 Subject: [PATCH 06/17] Update docker files --- .github/workflows/Dockerfile.alpine | 2 +- .github/workflows/Dockerfile.archlinux | 2 +- .github/workflows/buildtest.yml | 1 + Dockerfile | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Dockerfile.alpine b/.github/workflows/Dockerfile.alpine index 482796d98..44af99958 100644 --- a/.github/workflows/Dockerfile.alpine +++ b/.github/workflows/Dockerfile.alpine @@ -108,6 +108,6 @@ RUN cmake -DCMAKE_BUILD_TYPE=$build_type \ # Build Storm # (This can be adapted to only build 'storm' or 'binaries' depending on custom needs) -RUN ccache --max-size=3G && make -j $no_threads && ccache --show-stats --verbose +RUN ccache --max-size=3G && ccache --zero-stats && make -j $no_threads && ccache --show-stats --verbose WORKDIR /opt/storm diff --git a/.github/workflows/Dockerfile.archlinux b/.github/workflows/Dockerfile.archlinux index cb411a7c1..df36e7822 100644 --- a/.github/workflows/Dockerfile.archlinux +++ b/.github/workflows/Dockerfile.archlinux @@ -106,6 +106,6 @@ RUN cmake -DCMAKE_BUILD_TYPE=$build_type \ # Build Storm # (This can be adapted to only build 'storm' or 'binaries' depending on custom needs) -RUN ccache --max-size=3G && make -j $no_threads && ccache --show-stats --verbose +RUN ccache --max-size=3G && ccache --zero-stats && make -j $no_threads && ccache --show-stats --verbose WORKDIR /opt/storm diff --git a/.github/workflows/buildtest.yml b/.github/workflows/buildtest.yml index a8aef2d31..e91d6b422 100644 --- a/.github/workflows/buildtest.yml +++ b/.github/workflows/buildtest.yml @@ -437,6 +437,7 @@ jobs: - name: Prepare ccache run: | ccache --max-size=2G + ccache --show-stats --verbose ccache --zero-stats - name: Configure storm run: | diff --git a/Dockerfile b/Dockerfile index 3b084ab1a..bbb472712 100644 --- a/Dockerfile +++ b/Dockerfile @@ -95,6 +95,6 @@ RUN cmake -DCMAKE_BUILD_TYPE=$build_type \ # Build Storm # (This can be adapted to only build 'storm' or 'binaries' depending on custom needs) -RUN ccache --max-size=3G && make -j $no_threads && ccache --show-stats --verbose +RUN ccache --max-size=3G && ccache --zero-stats && make -j $no_threads && ccache --show-stats --verbose WORKDIR /opt/storm From fc5220f3e1920dab08030f4d47c00111e1883250 Mon Sep 17 00:00:00 2001 From: Luko van der Maas Date: Fri, 20 Mar 2026 09:09:26 +0100 Subject: [PATCH 07/17] warm cache --- src/storm/transformer/AddUncertainty.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/storm/transformer/AddUncertainty.h b/src/storm/transformer/AddUncertainty.h index 664dd56ae..f31088c1c 100644 --- a/src/storm/transformer/AddUncertainty.h +++ b/src/storm/transformer/AddUncertainty.h @@ -16,7 +16,7 @@ template class AddUncertainty { public: AddUncertainty(std::shared_ptr> const& originalModel); - std::shared_ptr> transform(double additiveUncertainty, double minimalValue = 0.001); + std::shared_ptr> transform(double additiveUncertainty, double minimalValue = 0.0001); private: storm::Interval addUncertainty(ValueType const& vt, double additiveUncertainty, double minimalValue); From f525bcd8d7e21bbd1da1efd65b4aa84f3355a2b0 Mon Sep 17 00:00:00 2001 From: Luko van der Maas Date: Fri, 20 Mar 2026 13:06:51 +0100 Subject: [PATCH 08/17] add PCH flag, disable PCH when developer is turned on --- .github/workflows/buildtest.yml | 28 +++++---- CMakeLists.txt | 19 ++++-- resources/scripts/benchmark-pch-ccache.sh | 73 +++++++++++++++++++++-- 3 files changed, 100 insertions(+), 20 deletions(-) diff --git a/.github/workflows/buildtest.yml b/.github/workflows/buildtest.yml index e91d6b422..105338ea6 100644 --- a/.github/workflows/buildtest.yml +++ b/.github/workflows/buildtest.yml @@ -127,6 +127,7 @@ jobs: uses: actions/checkout@v6 - name: Restore ccache (Docker) id: ccache-restore + if: github.ref != 'refs/heads/master' uses: actions/cache/restore@v4 with: path: .ci-ccache @@ -166,7 +167,7 @@ jobs: docker cp ccache-extract:/root/.ccache/. .ci-ccache/ || true docker rm ccache-extract - name: Save ccache (Docker) - if: always() && steps.ccache-restore.outputs.cache-hit != 'true' + if: github.ref != 'refs/heads/master' && always() && steps.ccache-restore.outputs.cache-hit != 'true' uses: actions/cache/save@v4 with: path: .ci-ccache @@ -241,6 +242,7 @@ jobs: run: cp .github/workflows/Dockerfile.${{ matrix.config.distro }} Dockerfile - name: Restore ccache (Docker) id: ccache-restore + if: github.ref != 'refs/heads/master' uses: actions/cache/restore@v4 with: path: .ci-ccache @@ -268,7 +270,7 @@ jobs: docker cp ccache-extract:/root/.ccache/. .ci-ccache/ || true docker rm ccache-extract - name: Save ccache (Docker) - if: always() && steps.ccache-restore.outputs.cache-hit != 'true' + if: github.ref != 'refs/heads/master' && always() && steps.ccache-restore.outputs.cache-hit != 'true' uses: actions/cache/save@v4 with: path: .ci-ccache @@ -318,6 +320,7 @@ jobs: uses: actions/checkout@v6 - name: Restore ccache (Docker) id: ccache-restore + if: github.ref != 'refs/heads/master' uses: actions/cache/restore@v4 with: path: .ci-ccache @@ -344,7 +347,7 @@ jobs: docker cp ccache-extract:/root/.ccache/. .ci-ccache/ || true docker rm ccache-extract - name: Save ccache (Docker) - if: always() && steps.ccache-restore.outputs.cache-hit != 'true' + if: github.ref != 'refs/heads/master' && always() && steps.ccache-restore.outputs.cache-hit != 'true' uses: actions/cache/save@v4 with: path: .ci-ccache @@ -404,7 +407,7 @@ jobs: } runs-on: ${{ matrix.config.distro }} env: - CCACHE_DIR: ~/.ccache + CCACHE_DIR: /Users/runner/.ccache steps: - uses: maxim-lobanov/setup-xcode@v1 with: @@ -412,6 +415,7 @@ jobs: - name: Git clone uses: actions/checkout@v6 - name: Cache Homebrew downloads + if: github.ref != 'refs/heads/master' uses: actions/cache@v4 with: path: ~/Library/Caches/Homebrew @@ -419,12 +423,13 @@ jobs: restore-keys: | buildtest-brew-${{ matrix.config.distro }}- - name: Ensure ccache directory exists (macOS) - run: mkdir -p ~/.ccache + run: mkdir -p /Users/runner/.ccache - name: Restore ccache (macOS) id: ccache-restore-macos + if: github.ref != 'refs/heads/master' uses: actions/cache/restore@v4 with: - path: ~/.ccache + path: /Users/runner/.ccache key: buildtest-ccache-macos-${{ matrix.config.distro }}-${{ matrix.config.buildType }}-${{ hashFiles('CMakeLists.txt', '.github/workflows/buildtest.yml') }}-${{ github.run_id }} restore-keys: | buildtest-ccache-macos-${{ matrix.config.distro }}-${{ matrix.config.buildType }}- @@ -437,23 +442,24 @@ jobs: - name: Prepare ccache run: | ccache --max-size=2G - ccache --show-stats --verbose ccache --zero-stats - name: Configure storm run: | mkdir build cd build - cmake .. -DCMAKE_BUILD_TYPE="${{ matrix.config.buildType }}" -DSTORM_CARL_GIT_TAG="master" -DSTORM_WARNING_AS_ERROR=ON + cmake .. -DCMAKE_BUILD_TYPE="${{ matrix.config.buildType }}" -DSTORM_CARL_GIT_TAG="master" -DSTORM_WARNING_AS_ERROR=ON -DSTORM_DEVELOPER=ON - name: Build storm working-directory: ./build - run: make -j ${NR_JOBS} + run: | + ccache --show-stats --verbose + make -j ${NR_JOBS} - name: Print ccache stats run: ccache --show-stats --verbose - name: Save ccache (macOS) - if: always() && steps.ccache-restore-macos.outputs.cache-hit != 'true' + if: github.ref != 'refs/heads/master' && always() && steps.ccache-restore-macos.outputs.cache-hit != 'true' uses: actions/cache/save@v4 with: - path: ~/.ccache + path: /Users/runner/.ccache key: ${{ steps.ccache-restore-macos.outputs.cache-primary-key }} - name: Run storm (build tree) working-directory: ./build diff --git a/CMakeLists.txt b/CMakeLists.txt index 002398532..c1e573fd7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,6 +48,8 @@ option(STORM_FORCE_POPCNT "Sets whether the popcnt instruction is forced to be u MARK_AS_ADVANCED(STORM_FORCE_POPCNT) option(STORM_COMPILE_WITH_CCACHE "Compile using CCache [if found]" ON) mark_as_advanced(STORM_COMPILE_WITH_CCACHE) +option(STORM_COMPILE_WITH_PCH "Enable pre-compiled headers" ON) +mark_as_advanced(STORM_COMPILE_WITH_PCH) option(STORM_LOG_DISABLE_DEBUG "Disable log and trace message support" OFF) option(STORM_COMPILE_WITH_ADDRESS_SANITIZER "Sets whether to compile with AddressSanitizer enabled" OFF) option(STORM_COMPILE_WITH_ALL_SANITIZERS "Sets whether to compile with all sanitizers enabled" OFF) @@ -153,6 +155,8 @@ if (STORM_DEVELOPER) set(STORM_DEBUG_SPOT ON) set(STORM_DEBUG_SYLVAN ON) set(STORM_WARNING_AS_ERROR ON) + # Turn off PCH for faster ccache usage on warm caches. + set(STORM_COMPILE_WITH_PCH OFF) else() set(STORM_LOG_DISABLE_DEBUG ON) if (NOT CMAKE_BUILD_TYPE) @@ -163,16 +167,23 @@ set(CMAKE_COMPILE_WARNING_AS_ERROR ${STORM_WARNING_AS_ERROR}) message(STATUS "Storm - Building ${CMAKE_BUILD_TYPE} version.") +# PCH compiled files cannot be properly cached currently. Thus disabling it is recommended when doing many warm ccache builds. +if(NOT STORM_COMPILE_WITH_PCH) + set(CMAKE_DISABLE_PRECOMPILE_HEADERS ON) + message(STATUS "Storm - Disabling precompiled headers because of ccache compatibility.") +endif() + if(STORM_COMPILE_WITH_CCACHE) find_program(CCACHE_FOUND ccache) mark_as_advanced(CCACHE_FOUND) if(CCACHE_FOUND) message(STATUS "Storm - Using ccache") - message(STATUS "Storm - Disabling precompiled headers because of ccache compatibility.") - set(CMAKE_DISABLE_PRECOMPILE_HEADERS ON) - set(ENV{CCACHE_SLOPPINESS} "pch_defines,time_macros") + set(ENV{CCACHE_SLOPPINESS} "pch_defines,time_macros,include_file_mtime,include_file_ctime") set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) - # set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) + + if(STORM_COMPILE_WITH_PCH) + message(STATUS "STORM - PCH is enabled which will lead to significantly lower ccache hit rates. Consider disabling PCH if you plan to rebuild storm multiple times.") + endif() else() message(STATUS "Storm - Could not find ccache.") endif() diff --git a/resources/scripts/benchmark-pch-ccache.sh b/resources/scripts/benchmark-pch-ccache.sh index 2df314444..cbc25676a 100755 --- a/resources/scripts/benchmark-pch-ccache.sh +++ b/resources/scripts/benchmark-pch-ccache.sh @@ -17,6 +17,9 @@ TARGET="storm" JOBS="$(command -v nproc >/dev/null 2>&1 && nproc || echo 4)" GENERATOR="" EXTRA_CMAKE_ARGS=() +ENABLE_TRACE=0 +NINJATRACING_BIN="" +NINJATRACING_URL="https://raw.githubusercontent.com/nico/ninjatracing/master/ninjatracing" usage() { cat <<'EOF' @@ -31,12 +34,15 @@ Options: --jobs Parallel build jobs (default: nproc or 4) --generator CMake generator (e.g. Ninja) --cmake-arg Extra CMake argument (can be repeated) + --trace Generate Chrome trace files via ninjatracing + --ninjatracing Path to local ninjatracing script/binary --help Show this help Output: - Summary table in stdout - CSV at /results.csv - Per-run ccache stats in /results/ + - Optional traces at /results/trace--.json EOF } @@ -67,10 +73,10 @@ run_case() { local cache_state="$2" # cold|warm local namespace="storm-bench-pch-${pch_mode}" local ccache_dir="${CCACHE_ROOT}/${namespace}" - local disable_pch="OFF" + local enable_pch="ON" if [[ "$pch_mode" == "off" ]]; then - disable_pch="ON" + enable_pch="OFF" fi local build_dir="${BUILD_ROOT}/build-${pch_mode}" @@ -90,7 +96,7 @@ run_case() { ccache --zero-stats >/dev/null local cmake_cmd=(cmake -S "$SOURCE_DIR" -B "$build_dir" - -DCMAKE_DISABLE_PRECOMPILE_HEADERS="$disable_pch" + -DSTORM_COMPILE_WITH_PCH="$enable_pch" -DCMAKE_BUILD_TYPE="$BUILD_TYPE") if [[ -n "$GENERATOR" ]]; then @@ -119,6 +125,16 @@ run_case() { local stats_file="${result_dir}/ccache-${pch_mode}-${cache_state}.txt" ccache --show-stats --verbose >"$stats_file" + if [[ "$ENABLE_TRACE" == "1" ]]; then + local ninja_log="${build_dir}/.ninja_log" + local trace_file="${result_dir}/trace-${pch_mode}-${cache_state}.json" + if [[ ! -f "$ninja_log" ]]; then + echo "Error: ninja log not found at $ninja_log" >&2 + exit 1 + fi + python3 "$NINJATRACING_BIN" "$ninja_log" >"$trace_file" + fi + local elapsed elapsed="$(cat "$time_file")" @@ -175,6 +191,14 @@ while [[ $# -gt 0 ]]; do EXTRA_CMAKE_ARGS+=("$2") shift 2 ;; + --trace) + ENABLE_TRACE=1 + shift + ;; + --ninjatracing) + NINJATRACING_BIN="$2" + shift 2 + ;; --help) usage exit 0 @@ -191,6 +215,18 @@ require_cmd cmake require_cmd ccache require_cmd /usr/bin/time +if [[ "$ENABLE_TRACE" == "1" ]]; then + require_cmd python3 + if [[ -z "$GENERATOR" ]]; then + GENERATOR="Ninja" + fi + if [[ "$GENERATOR" != "Ninja" ]]; then + echo "Error: --trace requires --generator Ninja (or no generator, which defaults to Ninja)." >&2 + exit 1 + fi + require_cmd ninja +fi + if [[ -z "$CCACHE_ROOT" ]]; then CCACHE_ROOT="${BUILD_ROOT}/ccache" fi @@ -200,6 +236,24 @@ mkdir -p "$CCACHE_ROOT" : >"${BUILD_ROOT}/results.csv" echo "pch,cache_state,build_seconds,cacheable_calls,hits,misses,uncacheable_calls" >>"${BUILD_ROOT}/results.csv" +if [[ "$ENABLE_TRACE" == "1" ]]; then + if [[ -z "$NINJATRACING_BIN" ]]; then + NINJATRACING_BIN="${BUILD_ROOT}/tools/ninjatracing" + mkdir -p "${BUILD_ROOT}/tools" + if [[ ! -f "$NINJATRACING_BIN" ]]; then + if command -v curl >/dev/null 2>&1; then + curl -fsSL "$NINJATRACING_URL" -o "$NINJATRACING_BIN" + elif command -v wget >/dev/null 2>&1; then + wget -qO "$NINJATRACING_BIN" "$NINJATRACING_URL" + else + echo "Error: neither curl nor wget found; provide --ninjatracing ." >&2 + exit 1 + fi + chmod +x "$NINJATRACING_BIN" + fi + fi +fi + echo echo "Benchmark settings" echo " source-dir: $SOURCE_DIR" @@ -211,6 +265,12 @@ echo " jobs: $JOBS" if [[ -n "$GENERATOR" ]]; then echo " generator: $GENERATOR" fi +if [[ "$ENABLE_TRACE" == "1" ]]; then + echo " trace: enabled" + echo " ninjatrace: $NINJATRACING_BIN" +else + echo " trace: disabled" +fi if [[ ${#EXTRA_CMAKE_ARGS[@]} -gt 0 ]]; then echo " extra args: ${EXTRA_CMAKE_ARGS[*]}" fi @@ -222,11 +282,14 @@ printf "%-8s %-6s %10s %12s %10s %10s %12s %9s\n" \ printf "%-8s %-6s %10s %12s %10s %10s %12s %9s\n" \ "--------" "------" "----------" "------------" "----------" "----------" "------------" "---------" -run_case on cold -run_case on warm run_case off cold run_case off warm +run_case on cold +run_case on warm echo echo "CSV written to: ${BUILD_ROOT}/results.csv" echo "Raw stats in: ${BUILD_ROOT}/results" +if [[ "$ENABLE_TRACE" == "1" ]]; then + echo "Traces in: ${BUILD_ROOT}/results" +fi From 2b666624e28a94869c03ac533e05e848bb45b07f Mon Sep 17 00:00:00 2001 From: Luko van der Maas Date: Fri, 20 Mar 2026 13:31:16 +0100 Subject: [PATCH 09/17] Fix Mac CI error with STORM_DEVELOPER --- .github/workflows/buildtest.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/buildtest.yml b/.github/workflows/buildtest.yml index 105338ea6..6a90e1c2f 100644 --- a/.github/workflows/buildtest.yml +++ b/.github/workflows/buildtest.yml @@ -447,10 +447,10 @@ jobs: run: | mkdir build cd build - cmake .. -DCMAKE_BUILD_TYPE="${{ matrix.config.buildType }}" -DSTORM_CARL_GIT_TAG="master" -DSTORM_WARNING_AS_ERROR=ON -DSTORM_DEVELOPER=ON + cmake .. -DCMAKE_BUILD_TYPE="${{ matrix.config.buildType }}" -DSTORM_CARL_GIT_TAG="master" -DSTORM_WARNING_AS_ERROR=ON -DSTORM_COMPILE_WITH_PCH=OFF - name: Build storm working-directory: ./build - run: | + run: |u ccache --show-stats --verbose make -j ${NR_JOBS} - name: Print ccache stats From 24910364d3fcc1d133430a7938316101feee1c38 Mon Sep 17 00:00:00 2001 From: Luko van der Maas Date: Fri, 20 Mar 2026 13:34:35 +0100 Subject: [PATCH 10/17] Set correct key for Minimal dependices indepth tests --- .github/workflows/buildtest.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/buildtest.yml b/.github/workflows/buildtest.yml index 6a90e1c2f..e511a194d 100644 --- a/.github/workflows/buildtest.yml +++ b/.github/workflows/buildtest.yml @@ -131,9 +131,9 @@ jobs: uses: actions/cache/restore@v4 with: path: .ci-ccache - key: buildtest-ccache-indepth-${{ matrix.config.buildType }}-${{ matrix.config.ClnExact }}-${{ matrix.config.ClnRatfunc }}-${{ matrix.config.disable_cudd }}-${{ hashFiles('Dockerfile', 'CMakeLists.txt') }}-${{ github.run_id }} + key: buildtest-ccache-indepth-${{ matrix.config.buildType }}-${{ matrix.config.ClnExact }}-${{ matrix.config.ClnRatfunc }}-${{ matrix.config.disable_cudd }}-${{ matrix.config.baseImg }}-${{ hashFiles('Dockerfile', 'CMakeLists.txt') }}-${{ github.run_id }} restore-keys: | - buildtest-ccache-indepth-${{ matrix.config.buildType }}-${{ matrix.config.ClnExact }}-${{ matrix.config.ClnRatfunc }}-${{ matrix.config.disable_cudd }}- + buildtest-ccache-indepth-${{ matrix.config.buildType }}-${{ matrix.config.ClnExact }}-${{ matrix.config.ClnRatfunc }}-${{ matrix.config.disable_cudd }}-${{ matrix.config.baseImg }}- buildtest-ccache-indepth- - name: Build storm from Dockerfile run: | From ddbecae4fadddd2c4d9c98924601eef41c87f7b3 Mon Sep 17 00:00:00 2001 From: Luko van der Maas Date: Fri, 20 Mar 2026 13:40:12 +0100 Subject: [PATCH 11/17] Disable PCH for linuxtests ci --- .github/workflows/Dockerfile.archlinux | 36 +++++++++++++------------- .github/workflows/buildtest.yml | 3 +-- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/.github/workflows/Dockerfile.archlinux b/.github/workflows/Dockerfile.archlinux index df36e7822..e3e5228a8 100644 --- a/.github/workflows/Dockerfile.archlinux +++ b/.github/workflows/Dockerfile.archlinux @@ -85,24 +85,24 @@ WORKDIR /opt/storm/build # Configure Storm RUN cmake -DCMAKE_BUILD_TYPE=$build_type \ - -DSTORM_PORTABLE=ON \ - -DSTORM_CARL_GIT_TAG=$carl_tag \ - -DSTORM_DISABLE_CUDD=$disable_cudd \ - -DSTORM_DISABLE_GLPK=$disable_glpk \ - -DSTORM_DISABLE_GMM=$disable_gmm \ - -DSTORM_DISABLE_GUROBI=$disable_gurobi \ - -DSTORM_DISABLE_LIBARCHIVE=$disable_libarchive \ - -DSTORM_DISABLE_MATHSAT=$disable_mathsat \ - -DSTORM_DISABLE_SOPLEX=$disable_soplex \ - -DSTORM_DISABLE_SPOT=$disable_spot \ - -DSTORM_DISABLE_SYLVAN=$disable_sylvan \ - -DSTORM_DISABLE_XERCES=$disable_xerces \ - -DSTORM_DISABLE_Z3=$disable_z3 \ - -DSTORM_DEVELOPER=$developer \ - -DSTORM_USE_CLN_EA=$cln_exact \ - -DSTORM_USE_CLN_RF=$cln_ratfunc \ - -DSTORM_COMPILE_WITH_ALL_SANITIZERS=$all_sanitizers \ - $cmake_args .. + -DSTORM_PORTABLE=ON \ + -DSTORM_CARL_GIT_TAG=$carl_tag \ + -DSTORM_DISABLE_CUDD=$disable_cudd \ + -DSTORM_DISABLE_GLPK=$disable_glpk \ + -DSTORM_DISABLE_GMM=$disable_gmm \ + -DSTORM_DISABLE_GUROBI=$disable_gurobi \ + -DSTORM_DISABLE_LIBARCHIVE=$disable_libarchive \ + -DSTORM_DISABLE_MATHSAT=$disable_mathsat \ + -DSTORM_DISABLE_SOPLEX=$disable_soplex \ + -DSTORM_DISABLE_SPOT=$disable_spot \ + -DSTORM_DISABLE_SYLVAN=$disable_sylvan \ + -DSTORM_DISABLE_XERCES=$disable_xerces \ + -DSTORM_DISABLE_Z3=$disable_z3 \ + -DSTORM_DEVELOPER=$developer \ + -DSTORM_USE_CLN_EA=$cln_exact \ + -DSTORM_USE_CLN_RF=$cln_ratfunc \ + -DSTORM_COMPILE_WITH_ALL_SANITIZERS=$all_sanitizers \ + $cmake_args .. # Build Storm # (This can be adapted to only build 'storm' or 'binaries' depending on custom needs) diff --git a/.github/workflows/buildtest.yml b/.github/workflows/buildtest.yml index e511a194d..3625490ff 100644 --- a/.github/workflows/buildtest.yml +++ b/.github/workflows/buildtest.yml @@ -327,7 +327,6 @@ jobs: key: buildtest-ccache-linux-${{ matrix.distro }}-${{ matrix.buildType }}-${{ matrix.runner }}-${{ hashFiles('Dockerfile', 'CMakeLists.txt') }}-${{ github.run_id }} restore-keys: | buildtest-ccache-linux-${{ matrix.distro }}-${{ matrix.buildType }}-${{ matrix.runner }}- - buildtest-ccache-linux-${{ matrix.distro }}- buildtest-ccache-linux- - name: Build storm from Dockerfile run: | @@ -337,7 +336,7 @@ jobs: --build-arg build_type="${{ matrix.buildType }}" \ --build-arg carl_tag="master" \ --build-arg no_threads=${NR_JOBS} \ - --build-arg cmake_args="-DSTORM_WARNING_AS_ERROR=ON" + --build-arg cmake_args="-DSTORM_WARNING_AS_ERROR=ON -DSTORM_COMPILE_WITH_PCH=OFF" # Omitting arguments developer, disable_*, cln_exact, cln_ratfunc, all_sanitizers - name: Export ccache from Docker image run: | From 22a84a75c43d238df9b36341fdb850568dc21798 Mon Sep 17 00:00:00 2001 From: Luko van der Maas Date: Fri, 20 Mar 2026 13:43:22 +0100 Subject: [PATCH 12/17] fix syntax in buildtest.yml --- .github/workflows/buildtest.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/buildtest.yml b/.github/workflows/buildtest.yml index 3625490ff..fb35df32f 100644 --- a/.github/workflows/buildtest.yml +++ b/.github/workflows/buildtest.yml @@ -442,6 +442,7 @@ jobs: run: | ccache --max-size=2G ccache --zero-stats + ccache --show-stats --verbose - name: Configure storm run: | mkdir build @@ -449,8 +450,7 @@ jobs: cmake .. -DCMAKE_BUILD_TYPE="${{ matrix.config.buildType }}" -DSTORM_CARL_GIT_TAG="master" -DSTORM_WARNING_AS_ERROR=ON -DSTORM_COMPILE_WITH_PCH=OFF - name: Build storm working-directory: ./build - run: |u - ccache --show-stats --verbose + run: | make -j ${NR_JOBS} - name: Print ccache stats run: ccache --show-stats --verbose From d3eee94cb6eb46eba97a2d8ed003d427245d5bd8 Mon Sep 17 00:00:00 2001 From: Luko van der Maas Date: Fri, 20 Mar 2026 14:44:57 +0100 Subject: [PATCH 13/17] Update cache key for build tests to include cmakeArgs --- .github/workflows/buildtest.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/buildtest.yml b/.github/workflows/buildtest.yml index fb35df32f..e8b182115 100644 --- a/.github/workflows/buildtest.yml +++ b/.github/workflows/buildtest.yml @@ -246,9 +246,9 @@ jobs: uses: actions/cache/restore@v4 with: path: .ci-ccache - key: buildtest-ccache-compiler-${{ matrix.config.distro }}-${{ matrix.config.name }}-${{ matrix.config.buildType }}-${{ hashFiles('.github/workflows/Dockerfile.archlinux', '.github/workflows/Dockerfile.alpine', 'CMakeLists.txt') }}-${{ github.run_id }} + key: buildtest-ccache-compiler-${{ matrix.config.distro }}-${{ matrix.config.cmakeArgs }}-${{ matrix.config.buildType }}-${{ github.run_id }} restore-keys: | - buildtest-ccache-compiler-${{ matrix.config.distro }}-${{ matrix.config.name }}-${{ matrix.config.buildType }}- + buildtest-ccache-compiler-${{ matrix.config.distro }}-${{ matrix.config.cmakeArgs }}-${{ matrix.config.buildType }}- buildtest-ccache-compiler-${{ matrix.config.distro }}- buildtest-ccache-compiler- - name: Build storm from Dockerfile From af35ec31a512b350b63096e17518dd930d64606f Mon Sep 17 00:00:00 2001 From: Luko van der Maas Date: Fri, 20 Mar 2026 15:47:12 +0100 Subject: [PATCH 14/17] Refine cache keys for build tests to improve cache efficiency --- .github/workflows/buildtest.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/buildtest.yml b/.github/workflows/buildtest.yml index e8b182115..f719adb1a 100644 --- a/.github/workflows/buildtest.yml +++ b/.github/workflows/buildtest.yml @@ -134,6 +134,7 @@ jobs: key: buildtest-ccache-indepth-${{ matrix.config.buildType }}-${{ matrix.config.ClnExact }}-${{ matrix.config.ClnRatfunc }}-${{ matrix.config.disable_cudd }}-${{ matrix.config.baseImg }}-${{ hashFiles('Dockerfile', 'CMakeLists.txt') }}-${{ github.run_id }} restore-keys: | buildtest-ccache-indepth-${{ matrix.config.buildType }}-${{ matrix.config.ClnExact }}-${{ matrix.config.ClnRatfunc }}-${{ matrix.config.disable_cudd }}-${{ matrix.config.baseImg }}- + buildtest-ccache-indepth-${{ matrix.config.buildType }}-${{ matrix.config.ClnExact }}-${{ matrix.config.ClnRatfunc }}-${{ matrix.config.disable_cudd }}- buildtest-ccache-indepth- - name: Build storm from Dockerfile run: | @@ -324,7 +325,7 @@ jobs: uses: actions/cache/restore@v4 with: path: .ci-ccache - key: buildtest-ccache-linux-${{ matrix.distro }}-${{ matrix.buildType }}-${{ matrix.runner }}-${{ hashFiles('Dockerfile', 'CMakeLists.txt') }}-${{ github.run_id }} + key: buildtest-ccache-linux-${{ matrix.distro }}-${{ matrix.buildType }}-${{ matrix.runner }}-${{ github.run_id }} restore-keys: | buildtest-ccache-linux-${{ matrix.distro }}-${{ matrix.buildType }}-${{ matrix.runner }}- buildtest-ccache-linux- @@ -429,7 +430,7 @@ jobs: uses: actions/cache/restore@v4 with: path: /Users/runner/.ccache - key: buildtest-ccache-macos-${{ matrix.config.distro }}-${{ matrix.config.buildType }}-${{ hashFiles('CMakeLists.txt', '.github/workflows/buildtest.yml') }}-${{ github.run_id }} + key: buildtest-ccache-macos-${{ matrix.config.distro }}-${{ matrix.config.buildType }}-${{ github.run_id }} restore-keys: | buildtest-ccache-macos-${{ matrix.config.distro }}-${{ matrix.config.buildType }}- buildtest-ccache-macos-${{ matrix.config.distro }}- From 897f8dbde2b6fc37e97cb8610b99898bd70a575a Mon Sep 17 00:00:00 2001 From: Luko van der Maas Date: Fri, 20 Mar 2026 16:53:38 +0100 Subject: [PATCH 15/17] Fix Spot build flags for debug mode and ensure CCACHE is applied correctly --- resources/3rdparty/include_spot.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/resources/3rdparty/include_spot.cmake b/resources/3rdparty/include_spot.cmake index 9c556ae81..5d3c87b48 100644 --- a/resources/3rdparty/include_spot.cmake +++ b/resources/3rdparty/include_spot.cmake @@ -63,7 +63,10 @@ if(NOT STORM_DISABLE_SPOT) set(STORM_SPOT_FLAGS "${STORM_SPOT_FLAGS};--disable-devel;--disable-debug;--enable-optimizations") else() message(WARNING "Storm - Building Spot in DEBUG mode.") - set(STORM_SPOT_FLAGS "${STORM_SPOT_FLAGS};--enable-devel;--enable-debug;--disable-optimizations") + set(STORM_SPOT_FLAGS "${STORM_SPOT_FLAGS};--disable-devel;--enable-debug;--disable-optimizations") + endif() + if (CCACHE_FOUND) + set(STORM_SPOT_FLAGS "${STORM_SPOT_FLAGS};CC=ccache\\ ${CMAKE_C_COMPILER};CXX=ccache\\ ${CMAKE_CXX_COMPILER}") endif() ExternalProject_Add(Spot URL https://www.lre.epita.fr/dload/spot/spot-${SPOT_SHIPPED_VERSION}.tar.gz https://www.lrde.epita.fr/dload/spot/spot-${SPOT_SHIPPED_VERSION}.tar.gz From eb9b0a7904fe207ce0e064abcee3048b7216707a Mon Sep 17 00:00:00 2001 From: Luko van der Maas Date: Thu, 26 Mar 2026 14:48:44 +0100 Subject: [PATCH 16/17] Set workflow cache keys so they are properly saved. --- .github/workflows/buildtest.yml | 8 ++++---- resources/3rdparty/include_spot.cmake | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/buildtest.yml b/.github/workflows/buildtest.yml index f719adb1a..cc5e8140b 100644 --- a/.github/workflows/buildtest.yml +++ b/.github/workflows/buildtest.yml @@ -172,7 +172,7 @@ jobs: uses: actions/cache/save@v4 with: path: .ci-ccache - key: ${{ steps.ccache-restore.outputs.cache-primary-key }} + key: buildtest-ccache-indepth-${{ matrix.config.buildType }}-${{ matrix.config.ClnExact }}-${{ matrix.config.ClnRatfunc }}-${{ matrix.config.disable_cudd }}-${{ matrix.config.baseImg }}-${{ hashFiles('Dockerfile', 'CMakeLists.txt') }}-${{ github.run_id }} - name: Run Docker run: docker run -d -it --name ci movesrwth/storm:ci - name: Run storm @@ -275,7 +275,7 @@ jobs: uses: actions/cache/save@v4 with: path: .ci-ccache - key: ${{ steps.ccache-restore.outputs.cache-primary-key }} + key: buildtest-ccache-compiler-${{ matrix.config.distro }}-${{ matrix.config.cmakeArgs }}-${{ matrix.config.buildType }}-${{ github.run_id }} - name: Run Docker run: docker run -d -it --name ci movesrwth/storm:ci - name: Run storm @@ -351,7 +351,7 @@ jobs: uses: actions/cache/save@v4 with: path: .ci-ccache - key: ${{ steps.ccache-restore.outputs.cache-primary-key }} + key: buildtest-ccache-linux-${{ matrix.distro }}-${{ matrix.buildType }}-${{ matrix.runner }}-${{ github.run_id }} - name: Run Docker run: docker run -d -it --name ci movesrwth/storm:ci - name: Run storm @@ -460,7 +460,7 @@ jobs: uses: actions/cache/save@v4 with: path: /Users/runner/.ccache - key: ${{ steps.ccache-restore-macos.outputs.cache-primary-key }} + key: buildtest-ccache-macos-${{ matrix.config.distro }}-${{ matrix.config.buildType }}-${{ github.run_id }} - name: Run storm (build tree) working-directory: ./build run: ./bin/storm diff --git a/resources/3rdparty/include_spot.cmake b/resources/3rdparty/include_spot.cmake index 5d3c87b48..c236c95b8 100644 --- a/resources/3rdparty/include_spot.cmake +++ b/resources/3rdparty/include_spot.cmake @@ -60,9 +60,9 @@ if(NOT STORM_DISABLE_SPOT) set(SPOT_SHIPPED_VERSION 2.14.3) set(STORM_SPOT_FLAGS "--disable-python;--enable-shared;--disable-static") if (NOT STORM_DEBUG_SPOT) - set(STORM_SPOT_FLAGS "${STORM_SPOT_FLAGS};--disable-devel;--disable-debug;--enable-optimizations") + set(STORM_SPOT_FLAGS "${STORM_SPOT_FLAGS};--disable-devel;--disable-debug;--enable-optimizations") else() - message(WARNING "Storm - Building Spot in DEBUG mode.") + message(WARNING "Storm - Building Spot in DEBUG mode.") set(STORM_SPOT_FLAGS "${STORM_SPOT_FLAGS};--disable-devel;--enable-debug;--disable-optimizations") endif() if (CCACHE_FOUND) From 32e0eec7c338761fb983dd361aa7d28c764600af Mon Sep 17 00:00:00 2001 From: Luko van der Maas Date: Thu, 2 Apr 2026 15:14:32 +0200 Subject: [PATCH 17/17] Seperate out the build tests in seperate files which can be called from different sources. Currently we have the old every PR commit trigger and a PR label trigger. They can have different configs. --- .github/workflows/buildtest.yml | 521 +++++----------------------- .github/workflows/selfrun.yml | 184 ++++++++++ .github/workflows/test-compiler.yml | 117 +++++++ .github/workflows/test-deploy.yml | 108 ++++++ .github/workflows/test-indepth.yml | 169 +++++++++ .github/workflows/test-linux.yml | 99 ++++++ .github/workflows/test-mac.yml | 118 +++++++ 7 files changed, 888 insertions(+), 428 deletions(-) create mode 100644 .github/workflows/selfrun.yml create mode 100644 .github/workflows/test-compiler.yml create mode 100644 .github/workflows/test-deploy.yml create mode 100644 .github/workflows/test-indepth.yml create mode 100644 .github/workflows/test-linux.yml create mode 100644 .github/workflows/test-mac.yml diff --git a/.github/workflows/buildtest.yml b/.github/workflows/buildtest.yml index cc5e8140b..8d4677325 100644 --- a/.github/workflows/buildtest.yml +++ b/.github/workflows/buildtest.yml @@ -10,15 +10,8 @@ on: workflow_dispatch: pull_request: -env: - # GitHub runners currently have 4 cores - NR_JOBS: "4" - jobs: - # Perform in-depth tests with different configurations indepthTests: - name: Indepth Tests (${{ matrix.config.name }}, ${{ matrix.config.buildType }}) - runs-on: ubuntu-latest strategy: matrix: config: @@ -122,112 +115,46 @@ jobs: AllSanitizers: "OFF", cmakeArgs: "-DSTORM_WARNING_AS_ERROR=ON" } - steps: - - name: Git clone - uses: actions/checkout@v6 - - name: Restore ccache (Docker) - id: ccache-restore - if: github.ref != 'refs/heads/master' - uses: actions/cache/restore@v4 - with: - path: .ci-ccache - key: buildtest-ccache-indepth-${{ matrix.config.buildType }}-${{ matrix.config.ClnExact }}-${{ matrix.config.ClnRatfunc }}-${{ matrix.config.disable_cudd }}-${{ matrix.config.baseImg }}-${{ hashFiles('Dockerfile', 'CMakeLists.txt') }}-${{ github.run_id }} - restore-keys: | - buildtest-ccache-indepth-${{ matrix.config.buildType }}-${{ matrix.config.ClnExact }}-${{ matrix.config.ClnRatfunc }}-${{ matrix.config.disable_cudd }}-${{ matrix.config.baseImg }}- - buildtest-ccache-indepth-${{ matrix.config.buildType }}-${{ matrix.config.ClnExact }}-${{ matrix.config.ClnRatfunc }}-${{ matrix.config.disable_cudd }}- - buildtest-ccache-indepth- - - name: Build storm from Dockerfile - run: | - mkdir -p .ci-ccache - docker build -t movesrwth/storm:ci . \ - --build-arg BASE_IMAGE=movesrwth/${{ matrix.config.baseImg }} \ - --build-arg build_type="${{ matrix.config.buildType }}" \ - --build-arg carl_tag="master" \ - --build-arg disable_cudd="${{ matrix.config.disable_cudd }}" \ - --build-arg disable_glpk="${{ matrix.config.disable_glpk }}" \ - --build-arg disable_gmm="${{ matrix.config.disable_gmm }}" \ - --build-arg disable_gurobi="${{ matrix.config.disable_gurobi }}" \ - --build-arg disable_libarchive="${{ matrix.config.disable_libarchive }}" \ - --build-arg disable_mathsat="${{ matrix.config.disable_mathsat }}" \ - --build-arg disable_soplex="${{ matrix.config.disable_soplex }}" \ - --build-arg disable_spot="${{ matrix.config.disable_spot }}" \ - --build-arg disable_sylvan="${{ matrix.config.disable_sylvan }}" \ - --build-arg disable_xerces="${{ matrix.config.disable_xerces }}" \ - --build-arg disable_z3="${{ matrix.config.disable_z3 }}" \ - --build-arg developer="${{ matrix.config.Developer }}" \ - --build-arg cln_exact="${{ matrix.config.ClnExact }}" \ - --build-arg cln_ratfunc="${{ matrix.config.ClnRatfunc }}" \ - --build-arg all_sanitizers="${{ matrix.config.AllSanitizers }}" \ - --build-arg cmake_args="${{ matrix.config.cmakeArgs }}" \ - --build-arg no_threads=${NR_JOBS} - - name: Export ccache from Docker image - run: | - rm -rf .ci-ccache - mkdir -p .ci-ccache - docker create --name ccache-extract movesrwth/storm:ci - docker cp ccache-extract:/root/.ccache/. .ci-ccache/ || true - docker rm ccache-extract - - name: Save ccache (Docker) - if: github.ref != 'refs/heads/master' && always() && steps.ccache-restore.outputs.cache-hit != 'true' - uses: actions/cache/save@v4 - with: - path: .ci-ccache - key: buildtest-ccache-indepth-${{ matrix.config.buildType }}-${{ matrix.config.ClnExact }}-${{ matrix.config.ClnRatfunc }}-${{ matrix.config.disable_cudd }}-${{ matrix.config.baseImg }}-${{ hashFiles('Dockerfile', 'CMakeLists.txt') }}-${{ github.run_id }} - - name: Run Docker - run: docker run -d -it --name ci movesrwth/storm:ci - - name: Run storm - run: docker exec ci bash -c "/opt/storm/build/bin/storm --version" - - name: Check compile flags - uses: ./.github/actions/check-compile-flags-action - with: - buildType: ${{ matrix.config.buildType }} - docker: true - - name: Run tests - # Disabled sanitizer checks for now - #run: docker exec ci bash -c "cd /opt/storm/build; ASAN_OPTIONS=detect_leaks=0,detect_odr_violation=0 ctest test --output-on-failure" - run: docker exec ci bash -c "cd /opt/storm/build; ctest test --output-on-failure" - - name: Build starter-project - uses: ./.github/actions/starter-project-action - with: - docker: true - stormDir: "/opt/storm/build" - command: "--help" # TODO using --help as running the starter-project requires Z3. - - name: Install storm - run: docker exec ci bash -c "cd /opt/storm/build; make install" - - name: Remove build dir - run: | - docker exec ci bash -c "rm -rf /opt/storm/build" - - name: Run installed storm - run: | - docker exec ci bash -c "/usr/local/bin/storm --version" - - name: Build starter-project on installed Storm - uses: ./.github/actions/starter-project-action - with: - docker: true - stormDir: "" - command: "--help" # TODO using --help as running the starter-project requires Z3. + uses: ./.github/workflows/test-indepth.yml + with: + NR_JOBS: "4" + name: ${{ matrix.config.name }} + baseImg: ${{ matrix.config.baseImg }} + buildType: ${{ matrix.config.buildType }} + disable_cudd: ${{ matrix.config.disable_cudd }} + disable_glpk: ${{ matrix.config.disable_glpk }} + disable_gmm: ${{ matrix.config.disable_gmm }} + disable_gurobi: ${{ matrix.config.disable_gurobi }} + disable_libarchive: ${{ matrix.config.disable_libarchive }} + disable_mathsat: ${{ matrix.config.disable_mathsat }} + disable_soplex: ${{ matrix.config.disable_soplex }} + disable_spot: ${{ matrix.config.disable_spot }} + disable_sylvan: ${{ matrix.config.disable_sylvan }} + disable_xerces: ${{ matrix.config.disable_xerces }} + disable_z3: ${{ matrix.config.disable_z3 }} + Developer: ${{ matrix.config.Developer }} + ClnExact: ${{ matrix.config.ClnExact }} + ClnRatfunc: ${{ matrix.config.ClnRatfunc }} + AllSanitizers: ${{ matrix.config.AllSanitizers }} + cmakeArgs: ${{ matrix.config.cmakeArgs }} compilerTests: - # Build and run with different compilers (GCC, Clang) - # Run on latest Archlinux version to get most recent compiler versions - name: Compiler Tests (${{ matrix.config.name }} on ${{ matrix.config.distro }}, ${{ matrix.config.buildType }}) - runs-on: ubuntu-latest strategy: matrix: config: - - {name: "GCC", - buildType: "Debug", - Developer: "ON", - cmakeArgs: "-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DSTORM_WARNING_AS_ERROR=ON", - packages: "", - distro: "archlinux" + - { name: "GCC", + buildType: "Debug", + Developer: "ON", + cmakeArgs: "-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DSTORM_WARNING_AS_ERROR=ON", + packages: "", + distro: "archlinux" } - - {name: "Clang", - buildType: "Debug", - Developer: "ON", - cmakeArgs: "-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DSTORM_WARNING_AS_ERROR=ON", - packages: "clang", - distro: "archlinux" + - { name: "Clang", + buildType: "Debug", + Developer: "ON", + cmakeArgs: "-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DSTORM_WARNING_AS_ERROR=ON", + packages: "clang", + distro: "archlinux" } - { name: "musl", buildType: "Debug", @@ -235,346 +162,84 @@ jobs: cmakeArgs: "-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DSTORM_WARNING_AS_ERROR=ON", packages: "", distro: "alpine" - } - steps: - - name: Git clone - uses: actions/checkout@v6 - - name: Replace Dockerfile - run: cp .github/workflows/Dockerfile.${{ matrix.config.distro }} Dockerfile - - name: Restore ccache (Docker) - id: ccache-restore - if: github.ref != 'refs/heads/master' - uses: actions/cache/restore@v4 - with: - path: .ci-ccache - key: buildtest-ccache-compiler-${{ matrix.config.distro }}-${{ matrix.config.cmakeArgs }}-${{ matrix.config.buildType }}-${{ github.run_id }} - restore-keys: | - buildtest-ccache-compiler-${{ matrix.config.distro }}-${{ matrix.config.cmakeArgs }}-${{ matrix.config.buildType }}- - buildtest-ccache-compiler-${{ matrix.config.distro }}- - buildtest-ccache-compiler- - - name: Build storm from Dockerfile - run: | - mkdir -p .ci-ccache - docker build -t movesrwth/storm:ci . \ - --build-arg build_type="${{ matrix.config.buildType }}" \ - --build-arg carl_tag="master" \ - --build-arg developer="${{ matrix.config.Developer }}" \ - --build-arg cmake_args="${{ matrix.config.cmakeArgs }}" \ - --build-arg packages="${{ matrix.config.packages }}" \ - --build-arg no_threads=${NR_JOBS} - # Omitting arguments disable_*, cln_exact, cln_ratfunc, all_sanitizers - - name: Export ccache from Docker image - run: | - rm -rf .ci-ccache - mkdir -p .ci-ccache - docker create --name ccache-extract movesrwth/storm:ci - docker cp ccache-extract:/root/.ccache/. .ci-ccache/ || true - docker rm ccache-extract - - name: Save ccache (Docker) - if: github.ref != 'refs/heads/master' && always() && steps.ccache-restore.outputs.cache-hit != 'true' - uses: actions/cache/save@v4 - with: - path: .ci-ccache - key: buildtest-ccache-compiler-${{ matrix.config.distro }}-${{ matrix.config.cmakeArgs }}-${{ matrix.config.buildType }}-${{ github.run_id }} - - name: Run Docker - run: docker run -d -it --name ci movesrwth/storm:ci - - name: Run storm - run: docker exec ci bash -c "/opt/storm/build/bin/storm --version" - - name: Check compile flags - uses: ./.github/actions/check-compile-flags-action - with: - buildType: ${{ matrix.config.buildType }} - docker: true - - name: Run tests - run: docker exec ci bash -c "cd /opt/storm/build; ctest test --output-on-failure" - - name: Build starter-project - uses: ./.github/actions/starter-project-action - with: - docker: true - stormDir: "/opt/storm/build" - command: "/opt/storm/resources/examples/testfiles/dtmc/brp-16-2.pm 'P=? [F s=5]'" - - name: Install storm - run: docker exec ci bash -c "cd /opt/storm/build; make install" - - name: Remove build dir - run: | - docker exec ci bash -c "rm -rf /opt/storm/build" - - name: Run installed storm - run: | - docker exec ci bash -c "/usr/local/bin/storm --version" - - name: Build starter-project on installed Storm - uses: ./.github/actions/starter-project-action - with: - docker: true - stormDir: "" - command: "/opt/storm/resources/examples/testfiles/dtmc/brp-16-2.pm 'P=? [F s=5]'" + } + uses: ./.github/workflows/test-compiler.yml + with: + NR_JOBS: "4" + name: ${{ matrix.config.name }} + buildType: ${{ matrix.config.buildType }} + Developer: ${{ matrix.config.Developer }} + cmakeArgs: ${{ matrix.config.cmakeArgs }} + packages: ${{ matrix.config.packages }} + distro: ${{ matrix.config.distro }} linuxTests: - name: Linux Tests (${{ matrix.distro }}, ${{ matrix.buildType }}) on ${{ matrix.runner }} - runs-on: ${{ matrix.runner }} + uses: ./.github/workflows/test-linux.yml strategy: matrix: distro: ["debian-12", "ubuntu-24.04", "debian-13"] buildType: ["Release"] runner: [ubuntu-latest, ubuntu-24.04-arm] - steps: - - name: Git clone - uses: actions/checkout@v6 - - name: Restore ccache (Docker) - id: ccache-restore - if: github.ref != 'refs/heads/master' - uses: actions/cache/restore@v4 - with: - path: .ci-ccache - key: buildtest-ccache-linux-${{ matrix.distro }}-${{ matrix.buildType }}-${{ matrix.runner }}-${{ github.run_id }} - restore-keys: | - buildtest-ccache-linux-${{ matrix.distro }}-${{ matrix.buildType }}-${{ matrix.runner }}- - buildtest-ccache-linux- - - name: Build storm from Dockerfile - run: | - mkdir -p .ci-ccache - docker build -t movesrwth/storm:ci . \ - --build-arg BASE_IMAGE=movesrwth/storm-basesystem:${{ matrix.distro }} \ - --build-arg build_type="${{ matrix.buildType }}" \ - --build-arg carl_tag="master" \ - --build-arg no_threads=${NR_JOBS} \ - --build-arg cmake_args="-DSTORM_WARNING_AS_ERROR=ON -DSTORM_COMPILE_WITH_PCH=OFF" - # Omitting arguments developer, disable_*, cln_exact, cln_ratfunc, all_sanitizers - - name: Export ccache from Docker image - run: | - rm -rf .ci-ccache - mkdir -p .ci-ccache - docker create --name ccache-extract movesrwth/storm:ci - docker cp ccache-extract:/root/.ccache/. .ci-ccache/ || true - docker rm ccache-extract - - name: Save ccache (Docker) - if: github.ref != 'refs/heads/master' && always() && steps.ccache-restore.outputs.cache-hit != 'true' - uses: actions/cache/save@v4 - with: - path: .ci-ccache - key: buildtest-ccache-linux-${{ matrix.distro }}-${{ matrix.buildType }}-${{ matrix.runner }}-${{ github.run_id }} - - name: Run Docker - run: docker run -d -it --name ci movesrwth/storm:ci - - name: Run storm - run: docker exec ci bash -c "/opt/storm/build/bin/storm --version" - - name: Check compile flags - uses: ./.github/actions/check-compile-flags-action - with: - buildType: ${{ matrix.buildType }} - docker: true - - name: Run tests - run: docker exec ci bash -c "cd /opt/storm/build; ctest test --output-on-failure" - - name: Build starter-project - uses: ./.github/actions/starter-project-action - with: - docker: true - stormDir: "/opt/storm/build" - command: "/opt/storm/resources/examples/testfiles/dtmc/brp-16-2.pm 'P=? [F s=5]'" - - name: Install storm - run: docker exec ci bash -c "cd /opt/storm/build; make install" - - name: Remove build dir - run: | - docker exec ci bash -c "rm -rf /opt/storm/build" - - name: Run installed storm - run: | - docker exec ci bash -c "/usr/local/bin/storm --version" - - name: Build starter-project on installed Storm - uses: ./.github/actions/starter-project-action - with: - docker: true - stormDir: "" - command: "/opt/storm/resources/examples/testfiles/dtmc/brp-16-2.pm 'P=? [F s=5]'" + with: + NR_JOBS: "4" + distro: ${{ matrix.distro }} + buildType: ${{ matrix.buildType }} + runner: ${{ matrix.runner }} macTests: - name: macOS Tests (${{ matrix.config.name }}, ${{ matrix.config.buildType }}) strategy: matrix: - config: - - - {name: "Xcode 15.4, ARM", - distro: "macos-14", - xcode: "15.4", - buildType: "Debug" + config: + - { name: "Xcode 15.4, ARM", + distro: "macos-14", + xcode: "15.4", + buildType: "Debug" } - - {name: "Xcode Latest, ARM", - distro: "macos-15", - xcode: "latest-stable", - buildType: "Debug" + - { name: "Xcode Latest, ARM", + distro: "macos-15", + xcode: "latest-stable", + buildType: "Debug" } - - {name: "Xcode Latest, Intel", - distro: "macos-15-intel", - xcode: "latest-stable", - buildType: "Debug" - } - runs-on: ${{ matrix.config.distro }} - env: - CCACHE_DIR: /Users/runner/.ccache - steps: - - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: ${{ matrix.config.xcode }} - - name: Git clone - uses: actions/checkout@v6 - - name: Cache Homebrew downloads - if: github.ref != 'refs/heads/master' - uses: actions/cache@v4 - with: - path: ~/Library/Caches/Homebrew - key: buildtest-brew-${{ matrix.config.distro }}-${{ hashFiles('.github/workflows/buildtest.yml') }} - restore-keys: | - buildtest-brew-${{ matrix.config.distro }}- - - name: Ensure ccache directory exists (macOS) - run: mkdir -p /Users/runner/.ccache - - name: Restore ccache (macOS) - id: ccache-restore-macos - if: github.ref != 'refs/heads/master' - uses: actions/cache/restore@v4 - with: - path: /Users/runner/.ccache - key: buildtest-ccache-macos-${{ matrix.config.distro }}-${{ matrix.config.buildType }}-${{ github.run_id }} - restore-keys: | - buildtest-ccache-macos-${{ matrix.config.distro }}-${{ matrix.config.buildType }}- - buildtest-ccache-macos-${{ matrix.config.distro }}- - - name: Install dependencies - # cmake and gmp are already installed - run: | - brew update - brew install automake boost ccache cln ginac glpk hwloc libarchive xerces-c z3 - - name: Prepare ccache - run: | - ccache --max-size=2G - ccache --zero-stats - ccache --show-stats --verbose - - name: Configure storm - run: | - mkdir build - cd build - cmake .. -DCMAKE_BUILD_TYPE="${{ matrix.config.buildType }}" -DSTORM_CARL_GIT_TAG="master" -DSTORM_WARNING_AS_ERROR=ON -DSTORM_COMPILE_WITH_PCH=OFF - - name: Build storm - working-directory: ./build - run: | - make -j ${NR_JOBS} - - name: Print ccache stats - run: ccache --show-stats --verbose - - name: Save ccache (macOS) - if: github.ref != 'refs/heads/master' && always() && steps.ccache-restore-macos.outputs.cache-hit != 'true' - uses: actions/cache/save@v4 - with: - path: /Users/runner/.ccache - key: buildtest-ccache-macos-${{ matrix.config.distro }}-${{ matrix.config.buildType }}-${{ github.run_id }} - - name: Run storm (build tree) - working-directory: ./build - run: ./bin/storm - - name: Check compile flags - uses: ./.github/actions/check-compile-flags-action - with: - buildType: ${{ matrix.config.buildType }} - docker: false - - name: Run tests - working-directory: ./build - run: ctest test --output-on-failure - - name: Build starter-project - uses: ./.github/actions/starter-project-action - with: - docker: false - stormDir: "${GITHUB_WORKSPACE}/build" - command: "${GITHUB_WORKSPACE}/resources/examples/testfiles/dtmc/brp-16-2.pm 'P=? [F s=5]'" - - name: Install storm - working-directory: ./build - run: sudo make install - - name: Remove build dir - run: | - rm -rf ${GITHUB_WORKSPACE}/build - - name: Run installed storm - run: | - /usr/local/bin/storm --version - - name: Build starter-project on installed Storm - uses: ./.github/actions/starter-project-action - with: - docker: false - stormDir: "" - command: "${GITHUB_WORKSPACE}/resources/examples/testfiles/dtmc/brp-16-2.pm 'P=? [F s=5]'" + - { name: "Xcode Latest, Intel", + distro: "macos-15-intel", + xcode: "latest-stable", + buildType: "Debug" + } + uses: ./.github/workflows/test-mac.yml + with: + NR_JOBS: "4" + name: ${{ matrix.config.name }} + distro: ${{ matrix.config.distro }} + xcode: ${{ matrix.config.xcode }} + buildType: ${{ matrix.config.buildType }} deploy: - name: Test and Deploy (${{ matrix.buildType.name }}) - runs-on: ubuntu-latest strategy: matrix: - buildType: - - {name: "Debug", - dockerTag: "ci-debug", - baseImg: "storm-dependencies:latest", - Developer: "ON", - cmakeArgs: "-DSTORM_WARNING_AS_ERROR=ON" + config: + - { buildType: "Debug", + dockerTag: "ci-debug", + baseImg: "storm-dependencies:latest", + Developer: "ON", + cmakeArgs: "-DSTORM_WARNING_AS_ERROR=ON" } - - {name: "Release", - dockerTag: "ci", - baseImg: "storm-dependencies:latest", - Developer: "OFF", - cmakeArgs: "-DSTORM_WARNING_AS_ERROR=ON" + - { buildType: "Release", + dockerTag: "ci", + baseImg: "storm-dependencies:latest", + Developer: "OFF", + cmakeArgs: "-DSTORM_WARNING_AS_ERROR=ON" } - steps: - - name: Git clone - uses: actions/checkout@v6 - - name: Git describe - id: ghd - uses: proudust/gh-describe@v3 - - name: Set static Storm version - run: echo "set(STORM_VERSION_COMMITS_AHEAD ${{ steps.ghd.outputs.distance }})" >> version.cmake - - name: Build storm from Dockerfile - run: | - docker build -t movesrwth/storm:${{ matrix.buildType.dockerTag }} . \ - --build-arg BASE_IMAGE=movesrwth/${{ matrix.buildType.baseImg }} \ - --build-arg build_type="${{ matrix.buildType.name }}" \ - --build-arg carl_tag="master" \ - --build-arg developer="${{ matrix.buildType.Developer }}" \ - --build-arg cmake_args="${{ matrix.buildType.cmakeArgs }}" \ - --build-arg no_threads=${NR_JOBS} - # Omitting arguments disable_*, cln_exact, cln_ratfunc, all_sanitizers - - name: Run Docker - run: docker run -d -it --name ci movesrwth/storm:${{ matrix.buildType.dockerTag }} - - name: Check compile flags - uses: ./.github/actions/check-compile-flags-action - with: - buildType: ${{ matrix.buildType.name }} - docker: true - - name: Run tests - run: docker exec ci bash -c "cd /opt/storm/build; ctest test --output-on-failure" - - name: Build starter-project - uses: ./.github/actions/starter-project-action - with: - docker: true - stormDir: "/opt/storm/build" - command: "/opt/storm/resources/examples/testfiles/dtmc/brp-16-2.pm 'P=? [F s=5]'" - - name: Install storm - run: docker exec ci bash -c "cd /opt/storm/build; make install" - - name: Temporarily move build dir - run: | - docker exec ci bash -c "mv /opt/storm/build /opt/storm/build-backup" - - name: Run installed storm - run: | - docker exec ci bash -c "/usr/local/bin/storm --version" - - name: Build starter-project on installed Storm - uses: ./.github/actions/starter-project-action - with: - docker: true - stormDir: "" - command: "/opt/storm/resources/examples/testfiles/dtmc/brp-16-2.pm 'P=? [F s=5]'" - - name: Restore build dir - run: | - docker exec ci bash -c "mv /opt/storm/build-backup /opt/storm/build" - - name: Login into docker - # Only login if using master on original repo (and not for pull requests or forks) - if: github.repository_owner == 'moves-rwth' && github.ref == 'refs/heads/master' - uses: docker/login-action@v4 - with: - username: ${{ secrets.STORM_CI_DOCKER_USERNAME }} - password: ${{ secrets.STORM_CI_DOCKER_TOKEN }} - - name: Deploy storm - # Only deploy if using master on original repo (and not for pull requests or forks) - if: github.repository_owner == 'moves-rwth' && github.ref == 'refs/heads/master' - run: | - docker commit ci movesrwth/storm:${{ matrix.buildType.dockerTag }} - docker push movesrwth/storm:${{ matrix.buildType.dockerTag }} + uses: ./.github/workflows/test-deploy.yml + with: + NR_JOBS: "4" + buildType: ${{ matrix.config.buildType }} + dockerTag: ${{ matrix.config.dockerTag }} + baseImg: ${{ matrix.config.baseImg }} + Developer: ${{ matrix.config.Developer }} + cmakeArgs: ${{ matrix.config.cmakeArgs }} + secrets: + STORM_CI_DOCKER_USERNAME: ${{ secrets.STORM_CI_DOCKER_USERNAME }} + STORM_CI_DOCKER_TOKEN: ${{ secrets.STORM_CI_DOCKER_TOKEN }} notify: name: Email notification diff --git a/.github/workflows/selfrun.yml b/.github/workflows/selfrun.yml new file mode 100644 index 000000000..9aaac21c2 --- /dev/null +++ b/.github/workflows/selfrun.yml @@ -0,0 +1,184 @@ +name: PR Label Test Dispatcher + +on: + pull_request: + types: [labeled] + +# Labels: +# run-all-tests — run all test suites +# run-indepth-tests — run indepth tests only +# run-compiler-tests — run compiler tests only +# run-linux-tests — run linux tests only +# run-mac-tests — run mac tests only + +permissions: + pull-requests: write + +jobs: + indepthTests: + if: | + github.event.label.name == 'run-all-tests' || + github.event.label.name == 'run-indepth-tests' + strategy: + matrix: + config: + - {name: "GMP exact; GMP rational functions; All dependencies", + baseImg: "storm-dependencies:latest", + buildType: "Debug", + disable_cudd: "OFF", disable_glpk: "OFF", disable_gmm: "OFF", + disable_gurobi: "OFF", disable_libarchive: "OFF", disable_mathsat: "OFF", + disable_soplex: "OFF", disable_spot: "OFF", disable_sylvan: "OFF", + disable_xerces: "OFF", disable_z3: "OFF", + Developer: "ON", ClnExact: "OFF", ClnRatfunc: "OFF", AllSanitizers: "OFF", + cmakeArgs: "-DSTORM_WARNING_AS_ERROR=ON" + } + - {name: "CLN exact; GMP rational functions; All dependencies", + baseImg: "storm-dependencies:latest", + buildType: "Debug", + disable_cudd: "OFF", disable_glpk: "OFF", disable_gmm: "OFF", + disable_gurobi: "OFF", disable_libarchive: "OFF", disable_mathsat: "OFF", + disable_soplex: "OFF", disable_spot: "OFF", disable_sylvan: "OFF", + disable_xerces: "OFF", disable_z3: "OFF", + Developer: "ON", ClnExact: "ON", ClnRatfunc: "OFF", AllSanitizers: "OFF", + cmakeArgs: "-DSTORM_WARNING_AS_ERROR=ON" + } + - {name: "CLN exact; CLN rational functions; All dependencies", + baseImg: "storm-dependencies:latest", + buildType: "Debug", + disable_cudd: "OFF", disable_glpk: "OFF", disable_gmm: "OFF", + disable_gurobi: "OFF", disable_libarchive: "OFF", disable_mathsat: "OFF", + disable_soplex: "OFF", disable_spot: "OFF", disable_sylvan: "OFF", + disable_xerces: "OFF", disable_z3: "OFF", + Developer: "ON", ClnExact: "ON", ClnRatfunc: "ON", AllSanitizers: "OFF", + cmakeArgs: "-DSTORM_WARNING_AS_ERROR=ON" + } + - {name: "GMP exact; CLN rational functions; No dependencies", + baseImg: "storm-dependencies:latest", + buildType: "Debug", + disable_cudd: "ON", disable_glpk: "ON", disable_gmm: "ON", + disable_gurobi: "ON", disable_libarchive: "ON", disable_mathsat: "ON", + disable_soplex: "ON", disable_spot: "ON", disable_sylvan: "ON", + disable_xerces: "ON", disable_z3: "ON", + Developer: "ON", ClnExact: "OFF", ClnRatfunc: "ON", AllSanitizers: "OFF", + cmakeArgs: "-DSTORM_WARNING_AS_ERROR=ON" + } + - {name: "Minimal dependencies (without CLN)", + baseImg: "storm-basesystem:minimal_dependencies", + buildType: "Debug", + disable_cudd: "ON", disable_glpk: "ON", disable_gmm: "ON", + disable_gurobi: "ON", disable_libarchive: "ON", disable_mathsat: "ON", + disable_soplex: "ON", disable_spot: "ON", disable_sylvan: "ON", + disable_xerces: "ON", disable_z3: "ON", + Developer: "ON", ClnExact: "OFF", ClnRatfunc: "OFF", AllSanitizers: "OFF", + cmakeArgs: "-DSTORM_WARNING_AS_ERROR=ON" + } + uses: ./.github/workflows/test-indepth.yml + with: + NR_JOBS: "4" + name: ${{ matrix.config.name }} + baseImg: ${{ matrix.config.baseImg }} + buildType: ${{ matrix.config.buildType }} + disable_cudd: ${{ matrix.config.disable_cudd }} + disable_glpk: ${{ matrix.config.disable_glpk }} + disable_gmm: ${{ matrix.config.disable_gmm }} + disable_gurobi: ${{ matrix.config.disable_gurobi }} + disable_libarchive: ${{ matrix.config.disable_libarchive }} + disable_mathsat: ${{ matrix.config.disable_mathsat }} + disable_soplex: ${{ matrix.config.disable_soplex }} + disable_spot: ${{ matrix.config.disable_spot }} + disable_sylvan: ${{ matrix.config.disable_sylvan }} + disable_xerces: ${{ matrix.config.disable_xerces }} + disable_z3: ${{ matrix.config.disable_z3 }} + Developer: ${{ matrix.config.Developer }} + ClnExact: ${{ matrix.config.ClnExact }} + ClnRatfunc: ${{ matrix.config.ClnRatfunc }} + AllSanitizers: ${{ matrix.config.AllSanitizers }} + cmakeArgs: ${{ matrix.config.cmakeArgs }} + + compilerTests: + if: | + github.event.label.name == 'run-all-tests' || + github.event.label.name == 'run-compiler-tests' + strategy: + matrix: + config: + - { name: "GCC", + buildType: "Debug", + Developer: "ON", + cmakeArgs: "-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DSTORM_WARNING_AS_ERROR=ON", + packages: "", + distro: "archlinux" + } + - { name: "Clang", + buildType: "Debug", + Developer: "ON", + cmakeArgs: "-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DSTORM_WARNING_AS_ERROR=ON", + packages: "clang", + distro: "archlinux" + } + - { name: "musl", + buildType: "Debug", + Developer: "ON", + cmakeArgs: "-DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DSTORM_WARNING_AS_ERROR=ON", + packages: "", + distro: "alpine" + } + uses: ./.github/workflows/test-compiler.yml + with: + NR_JOBS: "4" + name: ${{ matrix.config.name }} + buildType: ${{ matrix.config.buildType }} + Developer: ${{ matrix.config.Developer }} + cmakeArgs: ${{ matrix.config.cmakeArgs }} + packages: ${{ matrix.config.packages }} + distro: ${{ matrix.config.distro }} + + linuxTests: + if: | + github.event.label.name == 'run-all-tests' || + github.event.label.name == 'run-linux-tests' + uses: ./.github/workflows/test-linux.yml + strategy: + matrix: + distro: ["debian-12", "ubuntu-24.04", "debian-13"] + buildType: ["Release"] + runner: [ubuntu-latest, ubuntu-24.04-arm] + with: + NR_JOBS: "4" + distro: ${{ matrix.distro }} + buildType: ${{ matrix.buildType }} + runner: ${{ matrix.runner }} + + macTests: + if: | + github.event.label.name == 'run-all-tests' || + github.event.label.name == 'run-mac-tests' + strategy: + matrix: + config: + - { name: "Xcode 15.4, ARM", distro: "macos-14", xcode: "15.4", buildType: "Debug" } + - { name: "Xcode Latest, ARM", distro: "macos-15", xcode: "latest-stable", buildType: "Debug" } + - { name: "Xcode Latest, Intel", distro: "macos-15-intel", xcode: "latest-stable", buildType: "Debug" } + uses: ./.github/workflows/test-mac.yml + with: + NR_JOBS: "4" + name: ${{ matrix.config.name }} + distro: ${{ matrix.config.distro }} + xcode: ${{ matrix.config.xcode }} + buildType: ${{ matrix.config.buildType }} + + cleanup: + name: Remove trigger label + runs-on: ubuntu-latest + needs: [indepthTests, compilerTests, linuxTests, macTests] + if: always() + steps: + - uses: actions/github-script@v7 + with: + script: | + await github.rest.issues.removeLabel({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.payload.pull_request.number, + name: context.payload.label.name + }); diff --git a/.github/workflows/test-compiler.yml b/.github/workflows/test-compiler.yml new file mode 100644 index 000000000..c9b49b6df --- /dev/null +++ b/.github/workflows/test-compiler.yml @@ -0,0 +1,117 @@ +name: Compiler Tests + +on: + workflow_call: + inputs: + carl_tag: + description: "Carl git tag to use" + type: string + default: "master" + NR_JOBS: + description: "Number of parallel build jobs" + type: string + default: "4" + name: + description: "Compiler name (e.g. GCC, Clang, musl)" + type: string + required: true + buildType: + description: "CMake build type (Debug or Release)" + type: string + required: true + Developer: + description: "Enable developer mode (ON/OFF)" + type: string + default: "ON" + cmakeArgs: + description: "Extra CMake arguments" + type: string + default: "" + packages: + description: "Extra packages to install (e.g. clang)" + type: string + default: "" + distro: + description: "Distro for Dockerfile selection (archlinux or alpine)" + type: string + required: true + +jobs: + compilerTests: + # Build and run with different compilers (GCC, Clang) + # Run on latest Archlinux version to get most recent compiler versions + name: Compiler Tests (${{ inputs.name }} on ${{ inputs.distro }}, ${{ inputs.buildType }}) + runs-on: ubuntu-latest + env: + NR_JOBS: ${{ inputs.NR_JOBS }} + steps: + - name: Git clone + uses: actions/checkout@v6 + - name: Replace Dockerfile + run: cp .github/workflows/Dockerfile.${{ inputs.distro }} Dockerfile + - name: Restore ccache (Docker) + id: ccache-restore + if: github.ref != 'refs/heads/master' + uses: actions/cache/restore@v4 + with: + path: .ci-ccache + key: buildtest-ccache-compiler-${{ inputs.distro }}-${{ inputs.cmakeArgs }}-${{ inputs.buildType }}-${{ github.run_id }} + restore-keys: | + buildtest-ccache-compiler-${{ inputs.distro }}-${{ inputs.cmakeArgs }}-${{ inputs.buildType }}- + buildtest-ccache-compiler-${{ inputs.distro }}- + buildtest-ccache-compiler- + - name: Build storm from Dockerfile + run: | + mkdir -p .ci-ccache + docker build -t movesrwth/storm:ci . \ + --build-arg build_type="${{ inputs.buildType }}" \ + --build-arg carl_tag="${{ inputs.carl_tag }}" \ + --build-arg developer="${{ inputs.Developer }}" \ + --build-arg cmake_args="${{ inputs.cmakeArgs }}" \ + --build-arg packages="${{ inputs.packages }}" \ + --build-arg no_threads=${NR_JOBS} + # Omitting arguments disable_*, cln_exact, cln_ratfunc, all_sanitizers + - name: Export ccache from Docker image + run: | + rm -rf .ci-ccache + mkdir -p .ci-ccache + docker create --name ccache-extract movesrwth/storm:ci + docker cp ccache-extract:/root/.ccache/. .ci-ccache/ || true + docker rm ccache-extract + - name: Save ccache (Docker) + if: github.ref != 'refs/heads/master' && always() && steps.ccache-restore.outputs.cache-hit != 'true' + uses: actions/cache/save@v4 + with: + path: .ci-ccache + key: buildtest-ccache-compiler-${{ inputs.distro }}-${{ inputs.cmakeArgs }}-${{ inputs.buildType }}-${{ github.run_id }} + - name: Run Docker + run: docker run -d -it --name ci movesrwth/storm:ci + - name: Run storm + run: docker exec ci bash -c "/opt/storm/build/bin/storm --version" + - name: Check compile flags + uses: ./.github/actions/check-compile-flags-action + with: + buildType: ${{ inputs.buildType }} + docker: true + - name: Run tests + run: docker exec ci bash -c "cd /opt/storm/build; ctest test --output-on-failure" + - name: Build starter-project + uses: ./.github/actions/starter-project-action + with: + docker: true + stormDir: "/opt/storm/build" + command: "/opt/storm/resources/examples/testfiles/dtmc/brp-16-2.pm 'P=? [F s=5]'" + - name: Install storm + run: docker exec ci bash -c "cd /opt/storm/build; make install" + - name: Remove build dir + run: | + docker exec ci bash -c "rm -rf /opt/storm/build" + - name: Run installed storm + run: | + docker exec ci bash -c "/usr/local/bin/storm --version" + - name: Build starter-project on installed Storm + uses: ./.github/actions/starter-project-action + with: + docker: true + stormDir: "" + command: "/opt/storm/resources/examples/testfiles/dtmc/brp-16-2.pm 'P=? [F s=5]'" diff --git a/.github/workflows/test-deploy.yml b/.github/workflows/test-deploy.yml new file mode 100644 index 000000000..5b4b91baf --- /dev/null +++ b/.github/workflows/test-deploy.yml @@ -0,0 +1,108 @@ +name: Deploy + +on: + workflow_call: + inputs: + carl_tag: + description: "Carl git tag to use" + type: string + default: "master" + NR_JOBS: + description: "Number of parallel build jobs" + type: string + default: "4" + buildType: + description: "Build type name (Debug or Release)" + type: string + required: true + dockerTag: + description: "Docker image tag to use (e.g. ci-debug, ci)" + type: string + required: true + baseImg: + description: "Base image name (e.g. storm-dependencies:latest)" + type: string + default: "storm-dependencies:latest" + Developer: + description: "Enable developer mode (ON/OFF)" + type: string + default: "OFF" + cmakeArgs: + description: "Extra CMake arguments" + type: string + default: "" + secrets: + STORM_CI_DOCKER_USERNAME: + required: false + STORM_CI_DOCKER_TOKEN: + required: false + +jobs: + deploy: + name: Test and Deploy (${{ inputs.buildType }}) + runs-on: ubuntu-latest + env: + NR_JOBS: ${{ inputs.NR_JOBS }} + steps: + - name: Git clone + uses: actions/checkout@v6 + - name: Git describe + id: ghd + uses: proudust/gh-describe@v3 + - name: Set static Storm version + run: echo "set(STORM_VERSION_COMMITS_AHEAD ${{ steps.ghd.outputs.distance }})" >> version.cmake + - name: Build storm from Dockerfile + run: | + docker build -t movesrwth/storm:${{ inputs.dockerTag }} . \ + --build-arg BASE_IMAGE=movesrwth/${{ inputs.baseImg }} \ + --build-arg build_type="${{ inputs.buildType }}" \ + --build-arg carl_tag="${{ inputs.carl_tag }}" \ + --build-arg developer="${{ inputs.Developer }}" \ + --build-arg cmake_args="${{ inputs.cmakeArgs }}" \ + --build-arg no_threads=${NR_JOBS} + # Omitting arguments disable_*, cln_exact, cln_ratfunc, all_sanitizers + - name: Run Docker + run: docker run -d -it --name ci movesrwth/storm:${{ inputs.dockerTag }} + - name: Check compile flags + uses: ./.github/actions/check-compile-flags-action + with: + buildType: ${{ inputs.buildType }} + docker: true + - name: Run tests + run: docker exec ci bash -c "cd /opt/storm/build; ctest test --output-on-failure" + - name: Build starter-project + uses: ./.github/actions/starter-project-action + with: + docker: true + stormDir: "/opt/storm/build" + command: "/opt/storm/resources/examples/testfiles/dtmc/brp-16-2.pm 'P=? [F s=5]'" + - name: Install storm + run: docker exec ci bash -c "cd /opt/storm/build; make install" + - name: Temporarily move build dir + run: | + docker exec ci bash -c "mv /opt/storm/build /opt/storm/build-backup" + - name: Run installed storm + run: | + docker exec ci bash -c "/usr/local/bin/storm --version" + - name: Build starter-project on installed Storm + uses: ./.github/actions/starter-project-action + with: + docker: true + stormDir: "" + command: "/opt/storm/resources/examples/testfiles/dtmc/brp-16-2.pm 'P=? [F s=5]'" + - name: Restore build dir + run: | + docker exec ci bash -c "mv /opt/storm/build-backup /opt/storm/build" + - name: Login into docker + # Only login if using master on original repo (and not for pull requests or forks) + if: github.repository_owner == 'moves-rwth' && github.ref == 'refs/heads/master' + uses: docker/login-action@v4 + with: + username: ${{ secrets.STORM_CI_DOCKER_USERNAME }} + password: ${{ secrets.STORM_CI_DOCKER_TOKEN }} + - name: Deploy storm + # Only deploy if using master on original repo (and not for pull requests or forks) + if: github.repository_owner == 'moves-rwth' && github.ref == 'refs/heads/master' + run: | + docker commit ci movesrwth/storm:${{ inputs.dockerTag }} + docker push movesrwth/storm:${{ inputs.dockerTag }} diff --git a/.github/workflows/test-indepth.yml b/.github/workflows/test-indepth.yml new file mode 100644 index 000000000..836248f23 --- /dev/null +++ b/.github/workflows/test-indepth.yml @@ -0,0 +1,169 @@ +name: Indepth Tests + +on: + workflow_call: + inputs: + carl_tag: + description: "Carl git tag to use" + type: string + default: "master" + NR_JOBS: + description: "Number of parallel build jobs" + type: string + default: "4" + name: + description: "Display name for the test configuration" + type: string + required: true + baseImg: + description: "Base image name (e.g. storm-dependencies:latest)" + type: string + default: "storm-dependencies:latest" + buildType: + description: "CMake build type (Debug or Release)" + type: string + default: "Debug" + disable_cudd: + type: string + default: "OFF" + disable_glpk: + type: string + default: "OFF" + disable_gmm: + type: string + default: "OFF" + disable_gurobi: + type: string + default: "OFF" + disable_libarchive: + type: string + default: "OFF" + disable_mathsat: + type: string + default: "OFF" + disable_soplex: + type: string + default: "OFF" + disable_spot: + type: string + default: "OFF" + disable_sylvan: + type: string + default: "OFF" + disable_xerces: + type: string + default: "OFF" + disable_z3: + type: string + default: "OFF" + Developer: + description: "Enable developer mode (ON/OFF)" + type: string + default: "ON" + ClnExact: + description: "Use CLN for exact arithmetic (ON/OFF)" + type: string + default: "OFF" + ClnRatfunc: + description: "Use CLN for rational functions (ON/OFF)" + type: string + default: "OFF" + AllSanitizers: + description: "Enable all sanitizers (ON/OFF)" + type: string + default: "OFF" + cmakeArgs: + description: "Extra CMake arguments" + type: string + default: "-DSTORM_WARNING_AS_ERROR=ON" + +jobs: + indepthTests: + name: Indepth Tests (${{ inputs.name }}, ${{ inputs.buildType }}) + runs-on: ubuntu-latest + env: + NR_JOBS: ${{ inputs.NR_JOBS }} + steps: + - name: Git clone + uses: actions/checkout@v6 + - name: Restore ccache (Docker) + id: ccache-restore + if: github.ref != 'refs/heads/master' + uses: actions/cache/restore@v4 + with: + path: .ci-ccache + key: buildtest-ccache-indepth-${{ inputs.buildType }}-${{ inputs.ClnExact }}-${{ inputs.ClnRatfunc }}-${{ inputs.disable_cudd }}-${{ inputs.baseImg }}-${{ hashFiles('Dockerfile', 'CMakeLists.txt') }}-${{ github.run_id }} + restore-keys: | + buildtest-ccache-indepth-${{ inputs.buildType }}-${{ inputs.ClnExact }}-${{ inputs.ClnRatfunc }}-${{ inputs.disable_cudd }}-${{ inputs.baseImg }}- + buildtest-ccache-indepth-${{ inputs.buildType }}-${{ inputs.ClnExact }}-${{ inputs.ClnRatfunc }}-${{ inputs.disable_cudd }}- + buildtest-ccache-indepth- + - name: Build storm from Dockerfile + run: | + mkdir -p .ci-ccache + docker build -t movesrwth/storm:ci . \ + --build-arg BASE_IMAGE=movesrwth/${{ inputs.baseImg }} \ + --build-arg build_type="${{ inputs.buildType }}" \ + --build-arg carl_tag="${{ inputs.carl_tag }}" \ + --build-arg disable_cudd="${{ inputs.disable_cudd }}" \ + --build-arg disable_glpk="${{ inputs.disable_glpk }}" \ + --build-arg disable_gmm="${{ inputs.disable_gmm }}" \ + --build-arg disable_gurobi="${{ inputs.disable_gurobi }}" \ + --build-arg disable_libarchive="${{ inputs.disable_libarchive }}" \ + --build-arg disable_mathsat="${{ inputs.disable_mathsat }}" \ + --build-arg disable_soplex="${{ inputs.disable_soplex }}" \ + --build-arg disable_spot="${{ inputs.disable_spot }}" \ + --build-arg disable_sylvan="${{ inputs.disable_sylvan }}" \ + --build-arg disable_xerces="${{ inputs.disable_xerces }}" \ + --build-arg disable_z3="${{ inputs.disable_z3 }}" \ + --build-arg developer="${{ inputs.Developer }}" \ + --build-arg cln_exact="${{ inputs.ClnExact }}" \ + --build-arg cln_ratfunc="${{ inputs.ClnRatfunc }}" \ + --build-arg all_sanitizers="${{ inputs.AllSanitizers }}" \ + --build-arg cmake_args="${{ inputs.cmakeArgs }}" \ + --build-arg no_threads=${NR_JOBS} + - name: Export ccache from Docker image + run: | + rm -rf .ci-ccache + mkdir -p .ci-ccache + docker create --name ccache-extract movesrwth/storm:ci + docker cp ccache-extract:/root/.ccache/. .ci-ccache/ || true + docker rm ccache-extract + - name: Save ccache (Docker) + if: github.ref != 'refs/heads/master' && always() && steps.ccache-restore.outputs.cache-hit != 'true' + uses: actions/cache/save@v4 + with: + path: .ci-ccache + key: buildtest-ccache-indepth-${{ inputs.buildType }}-${{ inputs.ClnExact }}-${{ inputs.ClnRatfunc }}-${{ inputs.disable_cudd }}-${{ inputs.baseImg }}-${{ hashFiles('Dockerfile', 'CMakeLists.txt') }}-${{ github.run_id }} + - name: Run Docker + run: docker run -d -it --name ci movesrwth/storm:ci + - name: Run storm + run: docker exec ci bash -c "/opt/storm/build/bin/storm --version" + - name: Check compile flags + uses: ./.github/actions/check-compile-flags-action + with: + buildType: ${{ inputs.buildType }} + docker: true + - name: Run tests + # Disabled sanitizer checks for now + #run: docker exec ci bash -c "cd /opt/storm/build; ASAN_OPTIONS=detect_leaks=0,detect_odr_violation=0 ctest test --output-on-failure" + run: docker exec ci bash -c "cd /opt/storm/build; ctest test --output-on-failure" + - name: Build starter-project + uses: ./.github/actions/starter-project-action + with: + docker: true + stormDir: "/opt/storm/build" + command: "--help" # TODO using --help as running the starter-project requires Z3. + - name: Install storm + run: docker exec ci bash -c "cd /opt/storm/build; make install" + - name: Remove build dir + run: | + docker exec ci bash -c "rm -rf /opt/storm/build" + - name: Run installed storm + run: | + docker exec ci bash -c "/usr/local/bin/storm --version" + - name: Build starter-project on installed Storm + uses: ./.github/actions/starter-project-action + with: + docker: true + stormDir: "" + command: "--help" # TODO using --help as running the starter-project requires Z3. diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml new file mode 100644 index 000000000..bbf00b8a0 --- /dev/null +++ b/.github/workflows/test-linux.yml @@ -0,0 +1,99 @@ +name: Linux Tests + +on: + workflow_call: + inputs: + carl_tag: + description: "Carl git tag to use" + type: string + default: "master" + NR_JOBS: + description: "Number of parallel build jobs" + type: string + default: "4" + distro: + description: "distro to use as base image for the docker image" + type: string + required: true + buildType: + description: "build type to use for the docker image" + type: string + required: true + runner: + description: "runner to use for the job" + type: string + required: true + +jobs: + linuxTests: + name: Linux Tests (${{ inputs.distro }}, ${{ inputs.buildType }}) on ${{ inputs.runner }} + runs-on: ${{ inputs.runner }} + env: + NR_JOBS: ${{ inputs.NR_JOBS }} + steps: + - name: Git clone + uses: actions/checkout@v6 + - name: Restore ccache (Docker) + id: ccache-restore + if: github.ref != 'refs/heads/master' + uses: actions/cache/restore@v4 + with: + path: .ci-ccache + key: buildtest-ccache-linux-${{ inputs.distro }}-${{ inputs.buildType }}-${{ inputs.runner }}-${{ github.run_id }} + restore-keys: | + buildtest-ccache-linux-${{ inputs.distro }}-${{ inputs.buildType }}-${{ inputs.runner }}- + buildtest-ccache-linux- + - name: Build storm from Dockerfile + run: | + mkdir -p .ci-ccache + docker build -t movesrwth/storm:ci . \ + --build-arg BASE_IMAGE=movesrwth/storm-basesystem:${{ inputs.distro }} \ + --build-arg build_type="${{ inputs.buildType }}" \ + --build-arg carl_tag="${{ inputs.carl_tag }}" \ + --build-arg no_threads=${NR_JOBS} \ + --build-arg cmake_args="-DSTORM_WARNING_AS_ERROR=ON -DSTORM_COMPILE_WITH_PCH=OFF" + # Omitting arguments developer, disable_*, cln_exact, cln_ratfunc, all_sanitizers + - name: Export ccache from Docker image + run: | + rm -rf .ci-ccache + mkdir -p .ci-ccache + docker create --name ccache-extract movesrwth/storm:ci + docker cp ccache-extract:/root/.ccache/. .ci-ccache/ || true + docker rm ccache-extract + - name: Save ccache (Docker) + if: github.ref != 'refs/heads/master' && always() && steps.ccache-restore.outputs.cache-hit != 'true' + uses: actions/cache/save@v4 + with: + path: .ci-ccache + key: buildtest-ccache-linux-${{ inputs.distro }}-${{ inputs.buildType }}-${{ inputs.runner }}-${{ github.run_id }} + - name: Run Docker + run: docker run -d -it --name ci movesrwth/storm:ci + - name: Run storm + run: docker exec ci bash -c "/opt/storm/build/bin/storm --version" + - name: Check compile flags + uses: ./.github/actions/check-compile-flags-action + with: + buildType: ${{ inputs.buildType }} + docker: true + - name: Run tests + run: docker exec ci bash -c "cd /opt/storm/build; ctest test --output-on-failure" + - name: Build starter-project + uses: ./.github/actions/starter-project-action + with: + docker: true + stormDir: "/opt/storm/build" + command: "/opt/storm/resources/examples/testfiles/dtmc/brp-16-2.pm 'P=? [F s=5]'" + - name: Install storm + run: docker exec ci bash -c "cd /opt/storm/build; make install" + - name: Remove build dir + run: | + docker exec ci bash -c "rm -rf /opt/storm/build" + - name: Run installed storm + run: | + docker exec ci bash -c "/usr/local/bin/storm --version" + - name: Build starter-project on installed Storm + uses: ./.github/actions/starter-project-action + with: + docker: true + stormDir: "" + command: "/opt/storm/resources/examples/testfiles/dtmc/brp-16-2.pm 'P=? [F s=5]'" diff --git a/.github/workflows/test-mac.yml b/.github/workflows/test-mac.yml new file mode 100644 index 000000000..73f9ec844 --- /dev/null +++ b/.github/workflows/test-mac.yml @@ -0,0 +1,118 @@ +name: macOS Tests + +on: + workflow_call: + inputs: + NR_JOBS: + description: "Number of parallel build jobs" + type: string + default: "4" + name: + description: "Display name (e.g. Xcode 15.4, ARM)" + type: string + required: true + distro: + description: "macOS runner image (e.g. macos-14, macos-15)" + type: string + required: true + xcode: + description: "Xcode version (e.g. 15.4, latest-stable)" + type: string + required: true + buildType: + description: "CMake build type (Debug or Release)" + type: string + required: true + +jobs: + macTests: + name: macOS Tests (${{ inputs.name }}, ${{ inputs.buildType }}) + runs-on: ${{ inputs.distro }} + env: + CCACHE_DIR: /Users/runner/.ccache + NR_JOBS: ${{ inputs.NR_JOBS }} + steps: + - uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: ${{ inputs.xcode }} + - name: Git clone + uses: actions/checkout@v6 + - name: Cache Homebrew downloads + if: github.ref != 'refs/heads/master' + uses: actions/cache@v4 + with: + path: ~/Library/Caches/Homebrew + key: buildtest-brew-${{ inputs.distro }}-${{ hashFiles('.github/workflows/buildtest.yml') }} + restore-keys: | + buildtest-brew-${{ inputs.distro }}- + - name: Ensure ccache directory exists (macOS) + run: mkdir -p /Users/runner/.ccache + - name: Restore ccache (macOS) + id: ccache-restore-macos + if: github.ref != 'refs/heads/master' + uses: actions/cache/restore@v4 + with: + path: /Users/runner/.ccache + key: buildtest-ccache-macos-${{ inputs.distro }}-${{ inputs.buildType }}-${{ github.run_id }} + restore-keys: | + buildtest-ccache-macos-${{ inputs.distro }}-${{ inputs.buildType }}- + buildtest-ccache-macos-${{ inputs.distro }}- + - name: Install dependencies + # cmake and gmp are already installed + run: | + brew update + brew install automake boost ccache cln ginac glpk hwloc libarchive xerces-c z3 + - name: Prepare ccache + run: | + ccache --max-size=2G + ccache --zero-stats + ccache --show-stats --verbose + - name: Configure storm + run: | + mkdir build + cd build + cmake .. -DCMAKE_BUILD_TYPE="${{ inputs.buildType }}" -DSTORM_CARL_GIT_TAG="master" -DSTORM_WARNING_AS_ERROR=ON -DSTORM_COMPILE_WITH_PCH=OFF + - name: Build storm + working-directory: ./build + run: | + make -j ${NR_JOBS} + - name: Print ccache stats + run: ccache --show-stats --verbose + - name: Save ccache (macOS) + if: github.ref != 'refs/heads/master' && always() && steps.ccache-restore-macos.outputs.cache-hit != 'true' + uses: actions/cache/save@v4 + with: + path: /Users/runner/.ccache + key: buildtest-ccache-macos-${{ inputs.distro }}-${{ inputs.buildType }}-${{ github.run_id }} + - name: Run storm (build tree) + working-directory: ./build + run: ./bin/storm + - name: Check compile flags + uses: ./.github/actions/check-compile-flags-action + with: + buildType: ${{ inputs.buildType }} + docker: false + - name: Run tests + working-directory: ./build + run: ctest test --output-on-failure + - name: Build starter-project + uses: ./.github/actions/starter-project-action + with: + docker: false + stormDir: "${GITHUB_WORKSPACE}/build" + command: "${GITHUB_WORKSPACE}/resources/examples/testfiles/dtmc/brp-16-2.pm 'P=? [F s=5]'" + - name: Install storm + working-directory: ./build + run: sudo make install + - name: Remove build dir + run: | + rm -rf ${GITHUB_WORKSPACE}/build + - name: Run installed storm + run: | + /usr/local/bin/storm --version + - name: Build starter-project on installed Storm + uses: ./.github/actions/starter-project-action + with: + docker: false + stormDir: "" + command: "${GITHUB_WORKSPACE}/resources/examples/testfiles/dtmc/brp-16-2.pm 'P=? [F s=5]'"