From 3773295d4cd2d399ba0ad845214e8092119fce58 Mon Sep 17 00:00:00 2001 From: Jordy Aaldering <33897257+JordyAaldering@users.noreply.github.com> Date: Thu, 30 Apr 2026 11:41:00 +0200 Subject: [PATCH 01/11] build with ninja --- .github/workflows/main.yml | 19 ++++++------------- Makefile | 8 +++++--- README.md | 14 ++++++++++---- 3 files changed, 21 insertions(+), 20 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f88bd2cb..aaee21e5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,18 +26,14 @@ jobs: make release -j2 cp build_p/sac2c_p /usr/local/bin/sac2c sac2c -V - - name: Create build dir - run: | - cmake -E make_directory ${{runner.workspace}}/build - name: Configure build-system shell: bash - working-directory: ${{runner.workspace}}/build - run: cmake -DLINKSETSIZE=200 $GITHUB_WORKSPACE + run: | + cmake -S . -B build -G Ninja - name: Build shell: bash - working-directory: ${{runner.workspace}}/build run: | - cmake --build . -j4 2>&1 | tee build.log + cmake --build build -j4 2>&1 | tee build.log if [ ${PIPESTATUS[0]} -ne 0 ]; then echo "!!! ERROR detected in build !!!"; exit 1; @@ -75,18 +71,15 @@ jobs: make release -j2 cp build_p/sac2c_p /usr/local/bin/sac2c sac2c -V - - name: Create build dir - run: | - cmake -E make_directory ${{runner.workspace}}/build - name: Configure build-system shell: bash - working-directory: ${{runner.workspace}}/build - run: cmake ${GITHUB_WORKSPACE} + run: | + cmake -S . -B build -G Ninja - name: Build shell: bash working-directory: ${{runner.workspace}}/build run: | - cmake --build . -j3 2>&1 | tee build.log + cmake --build build -j4 2>&1 | tee build.log if [ ${PIPESTATUS[0]} -ne 0 ]; then echo "!!! ERROR detected in build !!!"; exit 1; diff --git a/Makefile b/Makefile index 2affcfb4..b39316a8 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,7 @@ BUILD_DIR ?= build -TARGETS ?= seq;mt_pth;seq_checks +TARGETS ?= seq;mt_pth;seq_checks + +GENERATOR ?= "Unix Makefiles" .PHONY: all build clean @@ -7,8 +9,8 @@ all: build build: git submodule update --init --recursive - mkdir -p $(BUILD_DIR) && cd $(BUILD_DIR) && \ - cmake -DTARGETS="$(TARGETS)" .. && $(MAKE) + cmake -S . -B $(BUILD_DIR) -G ${GENERATOR} -DTARGETS="$(TARGETS)" + +cmake --build $(BUILD_DIR_RELEASE) clean: $(RM) -r $(BUILD_DIR) diff --git a/README.md b/README.md index 535b7353..9f491c3d 100644 --- a/README.md +++ b/README.md @@ -15,13 +15,19 @@ To build the system one requires an operational [CMake](https://cmake.org/) >= 3 The quick and dirty option is just -``` +```sh make -j4 ``` -You can also use the `cmake` build system for more control +To build with Ninja, change the `GENERATOR` environment variable. +```sh +GENERATOR=Ninja make -jN ``` + +You can also use the `cmake` build system for more control + +```sh mkdir build cd build cmake .. @@ -31,8 +37,8 @@ make -j4 **NOTE:** *When pulling the latest commit, remember to run `git submodule update` or you will be missing changes to the `cmake-common` repository.* -> [!TIP] -> An advantage of doing a cmake build is that the generated Makefile will get targets to build individual standard library modules. +> [!TIP] +> An advantage of doing a cmake build is that the generated Makefile will get targets to build individual standard library modules. > For instance `make seq-module-File` will then only build the File module for sequential code. Variables that can be passed to CMake From a5b5964199297f1a94e5dda6a82b89e7b0d4071b Mon Sep 17 00:00:00 2001 From: Jordy Aaldering <33897257+JordyAaldering@users.noreply.github.com> Date: Thu, 30 Apr 2026 12:11:52 +0200 Subject: [PATCH 02/11] fix wrong working directory --- .github/workflows/main.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index aaee21e5..4ca05fe9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-24.04 steps: - name: Get HEAD and submodules - uses: actions/checkout@v2 + uses: actions/checkout@v6 with: fetch-depth: 0 submodules: 'recursive' @@ -26,7 +26,7 @@ jobs: make release -j2 cp build_p/sac2c_p /usr/local/bin/sac2c sac2c -V - - name: Configure build-system + - name: Configure build system shell: bash run: | cmake -S . -B build -G Ninja @@ -41,7 +41,6 @@ jobs: ${GITHUB_WORKSPACE}/ci/fail-on-warning.sh build.log - name: Test shell: bash - working-directory: ${{runner.workspace}}/build run: | git clone --single-branch https://github.com/SacBase/IntegrationTests.git cd IntegrationTests @@ -52,7 +51,7 @@ jobs: runs-on: macos-latest steps: - name: Get HEAD and submodules - uses: actions/checkout@v2 + uses: actions/checkout@v6 with: fetch-depth: 0 submodules: 'recursive' @@ -71,13 +70,12 @@ jobs: make release -j2 cp build_p/sac2c_p /usr/local/bin/sac2c sac2c -V - - name: Configure build-system + - name: Configure build system shell: bash run: | cmake -S . -B build -G Ninja - name: Build shell: bash - working-directory: ${{runner.workspace}}/build run: | cmake --build build -j4 2>&1 | tee build.log if [ ${PIPESTATUS[0]} -ne 0 ]; then @@ -87,7 +85,6 @@ jobs: ${GITHUB_WORKSPACE}/ci/fail-on-warning.sh build.log - name: Test shell: bash - working-directory: ${{runner.workspace}}/build run: | git clone --single-branch https://github.com/SacBase/IntegrationTests.git cd IntegrationTests From f1bf5ababf926a27e4e1b117e71cacb9cbd2c116 Mon Sep 17 00:00:00 2001 From: Jordy Aaldering <33897257+JordyAaldering@users.noreply.github.com> Date: Thu, 30 Apr 2026 12:22:18 +0200 Subject: [PATCH 03/11] also build sac with ninja --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4ca05fe9..fbe30eb8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -23,7 +23,7 @@ jobs: run: | git clone --single-branch --recursive https://gitlab.sac-home.org/sac-group/sac2c.git cd sac2c - make release -j2 + GENERATOR=Ninja make release -j2 cp build_p/sac2c_p /usr/local/bin/sac2c sac2c -V - name: Configure build system @@ -67,7 +67,7 @@ jobs: run: | git clone --single-branch --recursive https://gitlab.sac-home.org/sac-group/sac2c.git cd sac2c - make release -j2 + GENERATOR=Ninja make release -j2 cp build_p/sac2c_p /usr/local/bin/sac2c sac2c -V - name: Configure build system From 82a5dd70a5a7680d8e781b8e641a0a3aad64d675 Mon Sep 17 00:00:00 2001 From: Jordy Aaldering <33897257+JordyAaldering@users.noreply.github.com> Date: Thu, 30 Apr 2026 13:50:14 +0200 Subject: [PATCH 04/11] also build sac with ninja --- .github/workflows/main.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fbe30eb8..c3df3336 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -23,7 +23,7 @@ jobs: run: | git clone --single-branch --recursive https://gitlab.sac-home.org/sac-group/sac2c.git cd sac2c - GENERATOR=Ninja make release -j2 + GENERATOR=Ninja make release -j4 cp build_p/sac2c_p /usr/local/bin/sac2c sac2c -V - name: Configure build system @@ -42,8 +42,8 @@ jobs: - name: Test shell: bash run: | - git clone --single-branch https://github.com/SacBase/IntegrationTests.git - cd IntegrationTests + git clone --single-branch --recursive https://github.com/SacBase/IntegrationTests.git inttest + cd inttest make all ./test.sh @@ -67,7 +67,7 @@ jobs: run: | git clone --single-branch --recursive https://gitlab.sac-home.org/sac-group/sac2c.git cd sac2c - GENERATOR=Ninja make release -j2 + GENERATOR=Ninja make release -j4 cp build_p/sac2c_p /usr/local/bin/sac2c sac2c -V - name: Configure build system @@ -86,7 +86,7 @@ jobs: - name: Test shell: bash run: | - git clone --single-branch https://github.com/SacBase/IntegrationTests.git - cd IntegrationTests + git clone --single-branch --recursive https://github.com/SacBase/IntegrationTests.git inttest + cd inttest make all ./test.sh From 9de14e68889a6c2b628cd7f4f4dd3bc2abd62d3d Mon Sep 17 00:00:00 2001 From: Jordy Aaldering <33897257+JordyAaldering@users.noreply.github.com> Date: Fri, 1 May 2026 10:12:44 +0200 Subject: [PATCH 05/11] macos runner has 3 threads --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c3df3336..0a5596c9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -67,7 +67,7 @@ jobs: run: | git clone --single-branch --recursive https://gitlab.sac-home.org/sac-group/sac2c.git cd sac2c - GENERATOR=Ninja make release -j4 + GENERATOR=Ninja make release -j3 cp build_p/sac2c_p /usr/local/bin/sac2c sac2c -V - name: Configure build system @@ -77,7 +77,7 @@ jobs: - name: Build shell: bash run: | - cmake --build build -j4 2>&1 | tee build.log + cmake --build build -j3 2>&1 | tee build.log if [ ${PIPESTATUS[0]} -ne 0 ]; then echo "!!! ERROR detected in build !!!"; exit 1; From a8a9e9080867ff3e61986df1ff606a0f0820a6eb Mon Sep 17 00:00:00 2001 From: Jordy Aaldering <33897257+JordyAaldering@users.noreply.github.com> Date: Fri, 1 May 2026 10:22:27 +0200 Subject: [PATCH 06/11] use variables for urls --- .github/workflows/main.yml | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0a5596c9..54232fad 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,6 +6,10 @@ name: Build On Changes on: [pull_request] +variables: + SAC2C_URL: https://gitlab.sac-home.org/sac-group/sac2c.git + INTTEST_URL: https://github.com/SacBase/IntegrationTests.git + jobs: build-ubuntu24: runs-on: ubuntu-24.04 @@ -13,7 +17,6 @@ jobs: - name: Get HEAD and submodules uses: actions/checkout@v6 with: - fetch-depth: 0 submodules: 'recursive' - name: Install dependencies run: | @@ -21,13 +24,12 @@ jobs: sudo apt install xsltproc -y - name: Install sac2c run: | - git clone --single-branch --recursive https://gitlab.sac-home.org/sac-group/sac2c.git + git clone --single-branch --recursive ${SAC2C_URL} sac2c cd sac2c GENERATOR=Ninja make release -j4 - cp build_p/sac2c_p /usr/local/bin/sac2c + make symlink-release sac2c -V - name: Configure build system - shell: bash run: | cmake -S . -B build -G Ninja - name: Build @@ -42,7 +44,7 @@ jobs: - name: Test shell: bash run: | - git clone --single-branch --recursive https://github.com/SacBase/IntegrationTests.git inttest + git clone --single-branch --recursive ${INTTEST_URL} inttest cd inttest make all ./test.sh @@ -53,7 +55,6 @@ jobs: - name: Get HEAD and submodules uses: actions/checkout@v6 with: - fetch-depth: 0 submodules: 'recursive' - name: Install dependencies run: | @@ -65,13 +66,12 @@ jobs: xcode-version: latest-stable - name: Install sac2c run: | - git clone --single-branch --recursive https://gitlab.sac-home.org/sac-group/sac2c.git + git clone --single-branch --recursive ${SAC2C_URL} sac2c cd sac2c GENERATOR=Ninja make release -j3 - cp build_p/sac2c_p /usr/local/bin/sac2c + make symlink-release sac2c -V - name: Configure build system - shell: bash run: | cmake -S . -B build -G Ninja - name: Build @@ -86,7 +86,7 @@ jobs: - name: Test shell: bash run: | - git clone --single-branch --recursive https://github.com/SacBase/IntegrationTests.git inttest + git clone --single-branch --recursive ${INTTEST_URL} inttest cd inttest make all ./test.sh From d802263687858e5607421e460a5a54cb31e5dd10 Mon Sep 17 00:00:00 2001 From: Jordy Aaldering <33897257+JordyAaldering@users.noreply.github.com> Date: Fri, 1 May 2026 10:29:15 +0200 Subject: [PATCH 07/11] avoid potential duplicate " --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index b39316a8..583b511d 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ BUILD_DIR ?= build -TARGETS ?= seq;mt_pth;seq_checks +TARGETS ?= "seq;mt_pth;seq_checks" GENERATOR ?= "Unix Makefiles" @@ -9,7 +9,7 @@ all: build build: git submodule update --init --recursive - cmake -S . -B $(BUILD_DIR) -G ${GENERATOR} -DTARGETS="$(TARGETS)" + cmake -S . -B $(BUILD_DIR) -G ${GENERATOR} -DTARGETS=$(TARGETS) +cmake --build $(BUILD_DIR_RELEASE) clean: From 64b25f9eed26cdad5692b339566fd77c213d1122 Mon Sep 17 00:00:00 2001 From: Jordy Aaldering <33897257+JordyAaldering@users.noreply.github.com> Date: Mon, 4 May 2026 13:25:43 +0200 Subject: [PATCH 08/11] variables is named env in github CI --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 54232fad..0504747d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,7 +6,7 @@ name: Build On Changes on: [pull_request] -variables: +env: SAC2C_URL: https://gitlab.sac-home.org/sac-group/sac2c.git INTTEST_URL: https://github.com/SacBase/IntegrationTests.git From fdfbd1c5fa43b714fbf784afe9254e08cfb1308c Mon Sep 17 00:00:00 2001 From: Jordy Aaldering <33897257+JordyAaldering@users.noreply.github.com> Date: Mon, 4 May 2026 13:40:12 +0200 Subject: [PATCH 09/11] is fetch depth needed to get the tags? --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0504747d..7802aa1a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -17,6 +17,7 @@ jobs: - name: Get HEAD and submodules uses: actions/checkout@v6 with: + fetch-depth: 0 submodules: 'recursive' - name: Install dependencies run: | @@ -55,6 +56,7 @@ jobs: - name: Get HEAD and submodules uses: actions/checkout@v6 with: + fetch-depth: 0 submodules: 'recursive' - name: Install dependencies run: | From 8921cecd2b75da3fb76fa6cc2f1193dd481036ce Mon Sep 17 00:00:00 2001 From: Jordy Aaldering <33897257+JordyAaldering@users.noreply.github.com> Date: Mon, 4 May 2026 14:15:05 +0200 Subject: [PATCH 10/11] manually call cmake to avoid error on makefile changes --- .github/workflows/main.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7802aa1a..b4fede01 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,8 +27,9 @@ jobs: run: | git clone --single-branch --recursive ${SAC2C_URL} sac2c cd sac2c - GENERATOR=Ninja make release -j4 - make symlink-release + cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=RELEASE + cmake --build build -j4 + ln -s $(PWD)/build/sac2c_p /usr/local/bin/sac2c sac2c -V - name: Configure build system run: | @@ -70,8 +71,9 @@ jobs: run: | git clone --single-branch --recursive ${SAC2C_URL} sac2c cd sac2c - GENERATOR=Ninja make release -j3 - make symlink-release + cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=RELEASE + cmake --build build -j3 + ln -s $(PWD)/build/sac2c_p /usr/local/bin/sac2c sac2c -V - name: Configure build system run: | From b92f227ea7dd002ce8a50d4dbead1ff3ffb28aaa Mon Sep 17 00:00:00 2001 From: Jordy Aaldering <33897257+JordyAaldering@users.noreply.github.com> Date: Mon, 4 May 2026 14:21:47 +0200 Subject: [PATCH 11/11] oops, $ should not have () --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b4fede01..7227a2f1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -29,7 +29,7 @@ jobs: cd sac2c cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=RELEASE cmake --build build -j4 - ln -s $(PWD)/build/sac2c_p /usr/local/bin/sac2c + ln -s $PWD/build/sac2c_p /usr/local/bin/sac2c sac2c -V - name: Configure build system run: | @@ -73,7 +73,7 @@ jobs: cd sac2c cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=RELEASE cmake --build build -j3 - ln -s $(PWD)/build/sac2c_p /usr/local/bin/sac2c + ln -s $PWD/build/sac2c_p /usr/local/bin/sac2c sac2c -V - name: Configure build system run: |