Skip to content

Fix compilation of wheel on MacOS #187

Fix compilation of wheel on MacOS

Fix compilation of wheel on MacOS #187

Workflow file for this run

name: Build
on:
workflow_dispatch:
pull_request:
branches: [ "main" ]
jobs:
build_wheels:
name: Build wheels on ${{ matrix.job_name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
job_name: ubuntu-latest
artifact_suffix: ubuntu-latest
cibw_environment_macos_extra: ""
- os: ubuntu-24.04-arm
job_name: ubuntu-24.04-arm
artifact_suffix: ubuntu-24.04-arm
cibw_environment_macos_extra: ""
- os: windows-latest
job_name: windows-latest
artifact_suffix: windows-latest
cibw_environment_macos_extra: ""
- os: windows-11-arm
job_name: windows-11-arm
artifact_suffix: windows-11-arm
cibw_environment_macos_extra: ""
# Temporary macOS investigation matrix to isolate optimizer issues.
- os: macos-14
job_name: macos-14-baseline
artifact_suffix: macos-14-baseline
cibw_environment_macos_extra: ""
- os: macos-14
job_name: macos-14-o2
artifact_suffix: macos-14-o2
cibw_environment_macos_extra: "ITZI_OPT_LEVEL=O2"
- os: macos-14
job_name: macos-14-no-vectorize
artifact_suffix: macos-14-no-vectorize
cibw_environment_macos_extra: "ITZI_DISABLE_VECTORIZE=1"
steps:
- uses: actions/checkout@v4
- name: Set-up on MacOS
if: ${{ matrix.os == 'macos-14' }}
run: |
brew install libomp
- name: Build wheels
uses: pypa/cibuildwheel@v3.2.1
env:
CIBW_ARCHS: auto64 # Don't build 32 bits wheels
CIBW_SKIP: pp* # Don't build pypy wheels
CIBW_ENVIRONMENT: "ITZI_BDIST_WHEEL=1 NO_STABLE_ABI=1" # Trigger generic compiler flags
CIBW_ENVIRONMENT_MACOS: >
MACOSX_DEPLOYMENT_TARGET=14.0
ITZI_BDIST_WHEEL=1
NO_STABLE_ABI=1
${{ matrix.cibw_environment_macos_extra }}
CIBW_BEFORE_TEST: "pip install pytest pytest-benchmark pandas scipy"
CIBW_TEST_SOURCES: tests
CIBW_TEST_COMMAND: > # Fast tests which do not require GRASS
pytest -m "not slow and not cloud" tests/core/
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.artifact_suffix }}
path: ./wheelhouse/*.whl
build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build sdist
run: pipx run build --sdist
- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz