From 6a0a35f1cacc3a26ccf5a261d790c28a886edcd7 Mon Sep 17 00:00:00 2001 From: JP Lehr Date: Fri, 14 Nov 2025 12:48:50 +0100 Subject: [PATCH 1/3] [CMake] Add cache files for convenience Adding two CMake cache files to make building MetaCG more convenient. One cache is a full build that requires the external dependencies to be installed via the build_submodules.sh script. The other cache is a build of the "new" graph tools that does not depend on the external components. --- cmake/caches/FullBuild.cmake | 12 ++++++++++++ cmake/caches/GraphTools.cmake | 7 +++++++ 2 files changed, 19 insertions(+) create mode 100644 cmake/caches/FullBuild.cmake create mode 100644 cmake/caches/GraphTools.cmake diff --git a/cmake/caches/FullBuild.cmake b/cmake/caches/FullBuild.cmake new file mode 100644 index 00000000..14c946e3 --- /dev/null +++ b/cmake/caches/FullBuild.cmake @@ -0,0 +1,12 @@ +# This is a CMake cache file for a full build +set(CMAKE_BUILD_TYPE Release CACHE STRING "") + +# Get external dependencies +set(CUBE_DIR "extern/install/cubelib" CACHE STRING "") +set(EXTRAP_INCLUDE "extern/install/extrap/include" CACHE STRING "") +set(EXTRAP_LIB "extern/install/extrap/lib" CACHE STRING "") + +# Enable all features from MetaCG +set(METACG_BUILD_CGCOLLECTOR ON CACHE BOOL "") +set(METACG_BUILD_PGIS ON CACHE BOOL "") +set(METACG_BUILD_GRAPH_TOOLS ON CACHE BOOL "") diff --git a/cmake/caches/GraphTools.cmake b/cmake/caches/GraphTools.cmake new file mode 100644 index 00000000..79ff2879 --- /dev/null +++ b/cmake/caches/GraphTools.cmake @@ -0,0 +1,7 @@ +# This is a CMake cache file for a full build +set(CMAKE_BUILD_TYPE Release CACHE STRING "") + +# Enable all features from MetaCG +set(METACG_BUILD_CGCOLLECTOR OFF CACHE BOOL "") +set(METACG_BUILD_PGIS OFF CACHE BOOL "") +set(METACG_BUILD_GRAPH_TOOLS ON CACHE BOOL "") From 6b440a9e654a66260fdb7e3c721042413c5618f5 Mon Sep 17 00:00:00 2001 From: JP Lehr Date: Fri, 14 Nov 2025 12:56:45 +0100 Subject: [PATCH 2/3] Fix linting errors --- cmake/caches/FullBuild.cmake | 35 ++++++++++++++++++++++++++++------- cmake/caches/GraphTools.cmake | 20 ++++++++++++++++---- 2 files changed, 44 insertions(+), 11 deletions(-) diff --git a/cmake/caches/FullBuild.cmake b/cmake/caches/FullBuild.cmake index 14c946e3..867a26e5 100644 --- a/cmake/caches/FullBuild.cmake +++ b/cmake/caches/FullBuild.cmake @@ -1,12 +1,33 @@ # This is a CMake cache file for a full build -set(CMAKE_BUILD_TYPE Release CACHE STRING "") +set(CMAKE_BUILD_TYPE + Release + CACHE STRING "" +) # Get external dependencies -set(CUBE_DIR "extern/install/cubelib" CACHE STRING "") -set(EXTRAP_INCLUDE "extern/install/extrap/include" CACHE STRING "") -set(EXTRAP_LIB "extern/install/extrap/lib" CACHE STRING "") +set(CUBE_DIR + "extern/install/cubelib" + CACHE STRING "" +) +set(EXTRAP_INCLUDE + "extern/install/extrap/include" + CACHE STRING "" +) +set(EXTRAP_LIB + "extern/install/extrap/lib" + CACHE STRING "" +) # Enable all features from MetaCG -set(METACG_BUILD_CGCOLLECTOR ON CACHE BOOL "") -set(METACG_BUILD_PGIS ON CACHE BOOL "") -set(METACG_BUILD_GRAPH_TOOLS ON CACHE BOOL "") +set(METACG_BUILD_CGCOLLECTOR + ON + CACHE BOOL "" +) +set(METACG_BUILD_PGIS + ON + CACHE BOOL "" +) +set(METACG_BUILD_GRAPH_TOOLS + ON + CACHE BOOL "" +) diff --git a/cmake/caches/GraphTools.cmake b/cmake/caches/GraphTools.cmake index 79ff2879..3d4c394a 100644 --- a/cmake/caches/GraphTools.cmake +++ b/cmake/caches/GraphTools.cmake @@ -1,7 +1,19 @@ # This is a CMake cache file for a full build -set(CMAKE_BUILD_TYPE Release CACHE STRING "") +set(CMAKE_BUILD_TYPE + Release + CACHE STRING "" +) # Enable all features from MetaCG -set(METACG_BUILD_CGCOLLECTOR OFF CACHE BOOL "") -set(METACG_BUILD_PGIS OFF CACHE BOOL "") -set(METACG_BUILD_GRAPH_TOOLS ON CACHE BOOL "") +set(METACG_BUILD_CGCOLLECTOR + OFF + CACHE BOOL "" +) +set(METACG_BUILD_PGIS + OFF + CACHE BOOL "" +) +set(METACG_BUILD_GRAPH_TOOLS + ON + CACHE BOOL "" +) From 8a2d17514fd0ffa00d38d2d6b37fb4324b22e717 Mon Sep 17 00:00:00 2001 From: JP Lehr Date: Fri, 14 Nov 2025 13:11:40 +0100 Subject: [PATCH 3/3] Adds cache file build to CI --- .github/workflows/mcg-ci.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/mcg-ci.yml b/.github/workflows/mcg-ci.yml index ed3eb898..afd8a3a9 100644 --- a/.github/workflows/mcg-ci.yml +++ b/.github/workflows/mcg-ci.yml @@ -64,7 +64,18 @@ jobs: stat $MCG_CFG [[ "$($MCG_CFG --prefix)" == "$(cd install; pwd)" ]] || exit 1 [[ "$($MCG_CFG --revision)" == "$(git rev-parse HEAD)" ]] || exit 1 - + + # Make sure the cache file builds + graph-tools-cache-build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: cmake + run: cmake -B build -S . -C cmake/caches/GraphTools.cmake + - name: build + run: cmake --build build --parallel + build-container: runs-on: ubuntu-latest steps: