From 2e8349ceb53541a4ba1046669e97bdeedb879b5b Mon Sep 17 00:00:00 2001 From: Sveinung Rundhovde Date: Tue, 3 Oct 2023 15:08:15 +0200 Subject: [PATCH] Build wheels for Apple arm64 architecture --- .github/workflows/build.yaml | 3 +++ .github/workflows/wheels.yaml | 6 ++++-- python/pyproject.toml | 17 +++++++++++++++++ requirements.txt | 2 +- 4 files changed, 25 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 3cc1fbc83..27408f221 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -23,6 +23,9 @@ jobs: analyzers: "cppcheck" scan: "scan-build --status-bugs" mkdoc: "-DBUILD_DOC=ON -DSPHINX_ARGS=-WT" + - os: macos-13-xlarge + privledges: "sudo" + arch: arm64 steps: - uses: actions/checkout@v2 diff --git a/.github/workflows/wheels.yaml b/.github/workflows/wheels.yaml index 30d6bb33b..87e6e0295 100644 --- a/.github/workflows/wheels.yaml +++ b/.github/workflows/wheels.yaml @@ -25,6 +25,8 @@ jobs: arch: i686 - os: macOS-10.15 arch: x86_64 + - os: macos-13-xlarge + arch: arm64 steps: - uses: actions/checkout@v2 @@ -37,14 +39,14 @@ jobs: name: Set up QEMU - name: Install cibuildwheel - run: python -m pip install cibuildwheel + run: python -m pip install cibuildwheel==2.12.1 - name: Build wheels env: CIBW_ENVIRONMENT_WINDOWS: > CMAKE_GENERATOR="${{ matrix.cmake_generator }}" CMAKE_GENERATOR_PLATFORM="${{ matrix.cmake_generator_platform }}" - CIBW_SKIP: pp* *-musllinux_* + CIBW_SKIP: pp* *-musllinux_* cp312-* CIBW_ARCHS: ${{ matrix.arch }} run: | python -m cibuildwheel --output-dir wheelhouse python/ diff --git a/python/pyproject.toml b/python/pyproject.toml index 1f1f5c1a8..c11f1aee1 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -62,4 +62,21 @@ select = "cp311*" manylinux-x86_64-image = "manylinux2014" [tool.cibuildwheel.macos] +before-build = [ + """sudo cmake \ + -S . \ + -B build \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ + -DBUILD_TESTING=OFF \ + -DBUILD_PYTHON=OFF \ + -DBUILD_BIN=OFF \ + """, + """sudo cmake \ + --build build \ + --parallel \ + --target install \ + --config Release \ + """, +] environment = { CXXFLAGS="-L/usr/local/lib" } diff --git a/requirements.txt b/requirements.txt index 421cf6d4a..24ce15ab7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ -numpy >= 1.10 +numpy