Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build aarch64 wheels #563

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 26 additions & 2 deletions .github/workflows/wheel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,22 @@ concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true


env:
# Build all wheels on either:
# - tagged release
# - pull request opened with "test all wheels" label
# - pull requests when "test all wheels" label is added
BUILD_ALL: |
${{
(github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v'))
|| contains(github.event.pull_request.labels.*.name, 'test all wheels')
|| (github.event.action == 'labeled' && github.event.label.name == 'test all wheels')
}}

jobs:
build_wheels:
name: Build wheel on ${{ matrix.os }}
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
Expand All @@ -18,14 +31,25 @@ jobs:
env:
CIBW_TEST_COMMAND: python -c "import numcodecs"
CIBW_BUILD: "cp310-* cp311-* cp312-*"
CIBW_SKIP: "pp* *-musllinux_* *win32 *_i686 *_s390x"
CIBW_ARCHS_MACOS: native
CIBW_ARCHS_WINDOWS: native
CIBW_ARCHS_LINUX: "x86_64 aarch64"
# note: CIBW_ENVIRONMENT is now set in pyproject.toml

steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: Restrict number of wheel builds on PRs
if: ${{ !env.BUILD_ALL }}
run: |
echo "CIBW_BUILD=cp310-win_amd64 cp311-manylinux_x86_64 cp312-macosx_x86_64 cp312-macosx_arm64" >> $GITHUB_ENV

- name: Set up QEMU
if: ${{ matrix.os == 'ubuntu-latest' }}
uses: docker/setup-qemu-action@v3

- uses: pypa/[email protected]

- uses: actions/upload-artifact@v4
Expand Down
10 changes: 9 additions & 1 deletion docs/release.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ Unreleased

Enhancements
~~~~~~~~~~~~

* Build aarch64 wheels on linuxL
By :user:`David Stansby <dstansby>`, :issue:`531`

Fix
~~~
Expand All @@ -27,6 +28,13 @@ Maintenance
* Remove pin on Sphinx
By :user:`Elliott Sales de Andrade <QuLogic>`, :issue:`552`.

* Restrict the number of wheels built on pull requests.
By :user:`David Stansby <dstansby>`, :issue:`531`

* Add an option to build all wheels on pull requests by adding
the 'build all wheels' label.
By :user:`David Stansby <dstansby>`, :issue:`531`


.. _release_0.13.0:

Expand Down
8 changes: 4 additions & 4 deletions notebooks/benchmark_vlen.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@
" enc = codec.encode(a)\n",
" print('decode')\n",
" %timeit codec.decode(enc)\n",
" print('size : {:,}'.format(len(enc)))\n",
" print('size (zstd 1): {:,}'.format(len(zstd1.encode(enc))))\n",
" print('size (zstd 5): {:,}'.format(len(zstd5.encode(enc))))\n",
" print('size (zstd 9): {:,}'.format(len(zstd9.encode(enc))))"
" print(f'size : {len(enc):,}')\n",
" print(f'size (zstd 1): {len(zstd1.encode(enc)):,}')\n",
" print(f'size (zstd 5): {len(zstd5.encode(enc)):,}')\n",
" print(f'size (zstd 9): {len(zstd9.encode(enc)):,}')"
]
},
{
Expand Down
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
if have_cflags:
# respect compiler options set by user
pass
elif os.name == 'posix':
elif os.name == 'posix' and os.uname()[4] != 'aarch64':
# These flags aren't recognised by gcc on aarch64
# (at least when we build the aarch64 wheens on GitHub actions)
if disable_sse2:
base_compile_args.append('-mno-sse2')
elif have_sse2:
Expand Down