From 839525e619738f665034c83a11c3fcf2e75eeb20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roberto=20Di=20Remigio=20Eik=C3=A5s?= Date: Thu, 21 Sep 2023 10:03:44 +0200 Subject: [PATCH] Build wheel for aarch64 on Linux --- .github/workflows/ci.yml | 37 +++++++++++++++++++++++++++---------- 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 374590f41..fb630cb54 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,15 +29,15 @@ jobs: fail-fast: false matrix: os_dist: [ - {os: ubuntu-latest, dist: cp36-manylinux_x86_64}, - {os: ubuntu-latest, dist: cp37-manylinux_x86_64}, - {os: ubuntu-latest, dist: cp38-manylinux_x86_64}, - {os: ubuntu-latest, dist: cp39-manylinux_x86_64}, - {os: ubuntu-latest, dist: cp310-manylinux_x86_64}, - {os: ubuntu-latest, dist: cp311-manylinux_x86_64}, + {os: ubuntu-latest, dist: cp36-manylinux_x86_64, linuxarch: x86_64}, + {os: ubuntu-latest, dist: cp37-manylinux_x86_64, linuxarch: x86_64}, + {os: ubuntu-latest, dist: cp38-manylinux_x86_64, linuxarch: x86_64}, + {os: ubuntu-latest, dist: cp39-manylinux_x86_64, linuxarch: x86_64}, + {os: ubuntu-latest, dist: cp310-manylinux_x86_64, linuxarch: x86_64}, + {os: ubuntu-latest, dist: cp311-manylinux_x86_64, linuxarch: x86_64}, - {os: ubuntu-latest, dist: cp36-manylinux_i686}, - {os: ubuntu-latest, dist: cp37-manylinux_i686}, + {os: ubuntu-latest, dist: cp36-manylinux_i686, linuxarch: i686}, + {os: ubuntu-latest, dist: cp37-manylinux_i686, linuxarch: i686}, # cp38-manylinux_i686 disabled because pandas isn't prebuilt and takes 20 minutes to build. # {os: ubuntu-latest, dist: cp38-manylinux_i686}, # cp39-manylinux_i686 disabled because pandas isn't prebuilt and takes 20 minutes to build. @@ -86,6 +86,13 @@ jobs: # {os: ubuntu-latest, dist: cp39-musllinux_i686}, # {os: ubuntu-latest, dist: cp310-musllinux_i686}, + {os: ubuntu-latest, dist: cp36-manylinux_aarch64, linuxarch: aarch64}, + {os: ubuntu-latest, dist: cp37-manylinux_aarch64, linuxarch: aarch64}, + {os: ubuntu-latest, dist: cp38-manylinux_aarch64, linuxarch: aarch64}, + {os: ubuntu-latest, dist: cp39-manylinux_aarch64, linuxarch: aarch64}, + {os: ubuntu-latest, dist: cp310-manylinux_aarch64, linuxarch: aarch64}, + {os: ubuntu-latest, dist: cp311-manylinux_aarch64, linuxarch: aarch64}, + {os: macos-latest, dist: cp36-macosx_x86_64, macosarch: x86_64}, {os: macos-latest, dist: cp37-macosx_x86_64, macosarch: x86_64}, {os: macos-latest, dist: cp38-macosx_x86_64, macosarch: x86_64}, @@ -142,17 +149,27 @@ jobs: ] env: CIBW_BUILD: "${{ matrix.os_dist.dist }}" + CIBW_ARCHS_LINUX: "${{ matrix.os_dist.linuxarch }}" CIBW_ARCHS_MACOS: "${{ matrix.os_dist.macosarch }}" CIBW_TEST_REQUIRES: cirq-core pytest CIBW_TEST_COMMAND: pytest {project}/src {project}/glue/cirq && stim help steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v3 + - uses: actions/checkout@v4 + - uses: actions/setup-python@v4 - run: python dev/overwrite_dev_versions_with_date.py - run: mkdir -p output/stim - run: mkdir -p output/stimcirq - run: mkdir -p output/sinter + - name: Set up QEMU + if: runner.os == 'Linux' + uses: docker/setup-qemu-action@v3 + with: + platforms: all - run: python -m pip install pybind11==2.9.2 cibuildwheel==2.11.1 + - name: Patch setup.py (comment out build of SSE2 vectorized code) + if: matrix.os_dist.linuxarch == 'aarch64' + run: | + sed -i -e 's/stim_sse2,/#stim_sse2,/g' setup.py - run: python -m cibuildwheel --print-build-identifiers - run: python -m cibuildwheel --output-dir output/stim - run: python setup.py sdist