From 83763ac0b5856aeba38a248f1a02da4dfcae7239 Mon Sep 17 00:00:00 2001 From: sayed Date: Mon, 20 Apr 2026 15:00:19 +0200 Subject: [PATCH 1/3] Use clang and try exporting OpenMP_ROOT --- .github/workflows/build-and-test-workflow.yml | 33 +++++++++++-------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build-and-test-workflow.yml b/.github/workflows/build-and-test-workflow.yml index 1fe2fc9a..9f9805e2 100644 --- a/.github/workflows/build-and-test-workflow.yml +++ b/.github/workflows/build-and-test-workflow.yml @@ -21,13 +21,6 @@ jobs: # Build steps steps: - # Step: Install GCC (macOS only) - - name: Install GCC - if: startsWith(runner.os, 'macOS') - run: | - brew install gcc@12 - echo "CC=$(brew --prefix)/bin/gcc-12" >> $GITHUB_ENV - echo "CXX=$(brew --prefix)/bin/g++-12" >> $GITHUB_ENV # Step: Checkout - name: Checkout @@ -36,6 +29,15 @@ jobs: with: fetch-depth: 0 + # Step: Set compiler (use system Clang for all macOS versions) + - name: Set compiler (macOS Clang) + if: runner.os == 'macOS' + run: | + echo "Using system Clang for ${{ inputs.platform }}" + echo "CC=clang" >> "$GITHUB_ENV" + echo "CXX=clang++" >> "$GITHUB_ENV" + echo "Configured Clang toolchain: $(clang --version | head -n 1)" + # Step: Set up Python - name: Set up Python uses: actions/setup-python@v6 @@ -50,8 +52,7 @@ jobs: # macOS - name: Install backend dependencies run: | # brew update - brew install boost - brew install doxygen + brew install boost doxygen libomp - name: Process branch name id: process_branch_name @@ -71,15 +72,19 @@ jobs: echo "BACK_END_BRANCH=$str" >> $GITHUB_ENV # Step: Build Wheel - # The default compiler on macos is clang, switch to gcc 11. Specifying the version is necessary. - # It seems like gcc and g++ are symbolic links to the default clang and clang++ compilers, respectively. - # CMAKE_CXX_COMPILER_ID will evaluate to AppleClang rather than GNU on macos. - name: Build Wheel env: - CC: gcc-12 - CXX: g++-12 + CC: clang + CXX: clang++ run: | export MACOSX_DEPLOYMENT_TARGET=$(sw_vers -productVersion) + # Detect Homebrew prefix based on runner architecture + if [ "${{ runner.arch }}" = "ARM64" ]; then + HOMEBREW_PREFIX="/opt/homebrew" + else + HOMEBREW_PREFIX="/usr/local" + fi + export OpenMP_ROOT="$HOMEBREW_PREFIX/opt/libomp" python setup.py build_ext python setup.py sdist python setup.py bdist_wheel From cc8a5b79ccb7ad723d6c53fc5ac596f7581f2692 Mon Sep 17 00:00:00 2001 From: sayed Date: Mon, 20 Apr 2026 23:14:14 +0200 Subject: [PATCH 2/3] bump version of actions/upload-artifact to latest because current will cause issue as of june 2026 --- .github/workflows/build-and-test-workflow.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-test-workflow.yml b/.github/workflows/build-and-test-workflow.yml index 9f9805e2..9d1d7dc5 100644 --- a/.github/workflows/build-and-test-workflow.yml +++ b/.github/workflows/build-and-test-workflow.yml @@ -115,7 +115,7 @@ jobs: # Step: Upload artifact - name: Upload artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 if: always() with: name: meshkernel-${{ inputs.platform }}-${{ inputs.build_type }} From 32d7ec7778ec88917956fd335fe4db370dcc11f9 Mon Sep 17 00:00:00 2001 From: sayed Date: Tue, 21 Apr 2026 10:04:29 +0200 Subject: [PATCH 3/3] remove redundant CC and CXX env var settings, will this affect the tests step? --- .github/workflows/build-and-test-workflow.yml | 9 --------- 1 file changed, 9 deletions(-) diff --git a/.github/workflows/build-and-test-workflow.yml b/.github/workflows/build-and-test-workflow.yml index 9d1d7dc5..52f99d9b 100644 --- a/.github/workflows/build-and-test-workflow.yml +++ b/.github/workflows/build-and-test-workflow.yml @@ -29,15 +29,6 @@ jobs: with: fetch-depth: 0 - # Step: Set compiler (use system Clang for all macOS versions) - - name: Set compiler (macOS Clang) - if: runner.os == 'macOS' - run: | - echo "Using system Clang for ${{ inputs.platform }}" - echo "CC=clang" >> "$GITHUB_ENV" - echo "CXX=clang++" >> "$GITHUB_ENV" - echo "Configured Clang toolchain: $(clang --version | head -n 1)" - # Step: Set up Python - name: Set up Python uses: actions/setup-python@v6