Skip to content

Commit 7078d4c

Browse files
ax3lclaude
andauthored
Wheels: ARM64 builders for Linux & Windows (#1909)
* Wheels: ARM64 builders for Linux (aarch64) & Windows (ARM64) Travis-CI is dead; it was the only builder for Linux aarch64 (and ppc64le) wheels. GitHub now offers free native ARM runners for public repos, so move Linux ARM wheel production into build.yml and add Windows ARM64 (new platform). build.yml: - Linux aarch64 on ubuntu-24.04-arm: full parity with x86_64 (cp310-cp314, many+musl, ADIOS2 ON), reuses library_builders.sh unchanged (native aarch64 needs no SIMD/cross tweaks; blosc2 auto-selects NEON, HDF5 builds natively). - Windows ARM64 on windows-11-arm: cp311-cp314 (CPython win_arm64 exists only from 3.11+, no PyPy). First cut ships HDF5 + JSON only (ADIOS2 OFF), like the win32/i686 legs, to avoid an unproven ADIOS2-on-ARM64 build. - Smoke test: derive the ADIOS2 expectation from matrix.env.ADIOS2 instead of process bitness, so a 64-bit ARM wheel without ADIOS2 passes; also makes the i686/win32 legs explicit. - Retarget the retired Travis aarch64/ppc64le matrix comments. library_builders.bat: - Gate the ADIOS2 dependency chain (SQLite3, ZFP, C-Blosc2, ADIOS2) behind openPMD_CMAKE_openPMD_USE_ADIOS2==ON (visible in the before-build step); keep zlib + HDF5 unconditional. Windows ARM64 builds only zlib + HDF5; AMD64 unchanged (win32 stops building the ADIOS2 stack it already discarded). .travis.yml: - Sync to the current post4 patch and cibuildwheel 4.1.0 (kept as reference; Travis no longer runs). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Remove Inline Comments Historic character comments are confusing and unnecessary. Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * Wheels: fix Windows ARM64 CMake platform (-A ARM64) The first windows-11-arm run failed: openPMD's setup.py picks the Visual Studio generator platform from interpreter bitness only (`if sys.maxsize > 2**32: -A x64`), so on win-arm64 (64-bit interpreter, ARM arch) it passed `-A x64`. That mis-targeted the build and find_package (Python) then failed ("Could NOT find Python ... Interpreter"). The explicit -A also overrode any CMAKE_GENERATOR_PLATFORM env (which is why win32 works: its 32-bit interpreter skips the branch and lets the env drive -A). - setup-py-windows-arm64-platform.patch: honor CMAKE_GENERATOR_PLATFORM from the environment for -A, falling back to the existing x64/interpreter logic. - build.yml: add the patch to COMMON_PATCHES and set CMAKE_GENERATOR_PLATFORM=ARM64 on the windows-11-arm leg. Dependency builds (zlib + HDF5) and the ADIOS2-chain gating already worked on ARM64; this only fixes the openPMD wheel's own configure step. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Wheels: valid artifact name for Windows ARM64 leg With the -A ARM64 fix the windows-11-arm wheels build and pass tests (HDF5 + JSON round-trip, 0 external deps), but the job failed at upload: the artifact name wheels-${os}-${build||arch} interpolated this leg's build glob ("cp311-* cp312-* ..."), and '*'/spaces are invalid in an artifact name. Add an optional matrix.artifact override (default: build || arch) and set it to "ARM64" for the windows-11-arm leg -> wheels-windows-11-arm-ARM64. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> * Artifact name Update Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 2c5886f commit 7078d4c

4 files changed

Lines changed: 49 additions & 16 deletions

File tree

.github/workflows/build.yml

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ env:
77
COMMON_PATCHES: >
88
.github/setup-py-version-post4.patch
99
.github/setup-py-windows-cmake-options.patch
10+
.github/setup-py-windows-arm64-platform.patch
1011
.github/python-hide-symbols.patch
1112
.github/python-wasm-side-module.patch
1213
.github/hdf5-dont-atexit-emscripten.patch
@@ -24,6 +25,7 @@ jobs:
2425
# platform CIBW_PLATFORM (default auto)
2526
# build CIBW_BUILD (default *, i.e. all)
2627
# patches space-separated setup patches (default: Windows one)
28+
# artifact artifact-name suffix override (default: build || arch)
2729
# sdist also build + upload the sdist artifact (default: off)
2830
include:
2931
- os: ubuntu-22.04
@@ -38,11 +40,11 @@ jobs:
3840
env:
3941
ADIOS2: "OFF"
4042

41-
# builds faster on Travis-CI:
42-
#- os: ubuntu-20.04
43-
# arch: "aarch64"
43+
- os: ubuntu-24.04-arm
44+
arch: "aarch64"
4445

45-
# builds faster on Travis-CI:
46+
# ppc64le was only ever built on the (now retired) Travis-CI; there is no
47+
# free GitHub-hosted ppc64le runner, so these wheels are no longer produced.
4648
#- os: ubuntu-20.04
4749
# arch: "ppc64le"
4850

@@ -63,6 +65,14 @@ jobs:
6365
CMAKE_GENERATOR_PLATFORM: "Win32"
6466
ADIOS2: "OFF" # 32-bit: no 32-bit ADIOS2 CI; BP read segfaults (see i686)
6567

68+
- os: windows-11-arm
69+
arch: "ARM64"
70+
build: "cp311-* cp312-* cp313-* cp314-*"
71+
artifact: "WinArm64"
72+
env:
73+
ADIOS2: "OFF"
74+
CMAKE_GENERATOR_PLATFORM: "ARM64"
75+
6676
- os: macos-15-intel
6777
arch: "x86_64"
6878
env:
@@ -235,8 +245,8 @@ jobs:
235245
CIBW_TEST_REQUIRES_PYODIDE: numpy
236246
CIBW_TEST_COMMAND: >
237247
python {project}/.github/check_wheel_libs.py &&
238-
python -c "import sys, openpmd_api as io; v = io.variants;
239-
need_adios2 = sys.maxsize > 2**32;
248+
python -c "import openpmd_api as io; v = io.variants;
249+
need_adios2 = '${{ matrix.env.ADIOS2 || 'ON' }}' == 'ON';
240250
assert v['hdf5'] and v['json'] and (v['adios2'] or not need_adios2), v;
241251
print('openPMD', io.__version__, dict(v))" &&
242252
python {project}/.github/smoke_roundtrip.py
@@ -257,8 +267,9 @@ jobs:
257267
name: Publish as GitHub artifact
258268
with:
259269
# Include matrix.build so the two wasm legs (cp313 / cp314, which share
260-
# os=ubuntu-24.04 + arch=wasm32) get DISTINCT artifact names.
261-
name: wheels-${{ matrix.os }}-${{ matrix.build || matrix.arch }}
270+
# os=ubuntu-24.04 + arch=wasm32) get DISTINCT artifact names. matrix.artifact
271+
# overrides it where build holds glob chars invalid in a name (Windows ARM64).
272+
name: wheels-${{ matrix.os }}-${{ matrix.artifact || matrix.build || matrix.arch }}
262273
path: ./wheelhouse
263274
overwrite: true
264275

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,12 @@ install:
134134
- git clone --branch ${OPENPMD_GIT_REF} --depth 1 https://github.com/openPMD/openPMD-api.git src
135135
- cp library_builders.sh list_library_deps.py check_wheel_libs.py smoke_roundtrip.py src/.github/
136136
# Wheels-only re-release: bump the package version (same source).
137-
- (cd src && git apply ../setup-py-version-post2.patch)
137+
- (cd src && git apply ../setup-py-version-post4.patch)
138138
# Keep statically-embedded deps (HDF5/ADIOS2/openPMD) private so the wheel can
139139
# be co-loaded with another extension that also embeds them (ImpactX/WarpX).
140140
- (cd src && git apply ../python-hide-symbols.patch)
141141
- python -m pip install --upgrade pip setuptools wheel
142-
- python -m pip install cibuildwheel==3.2.1
142+
- python -m pip install cibuildwheel==4.1.0
143143
# twine & cryptography: see
144144
# https://github.com/scikit-build/cmake-python-distributions/blob/4730aeee240917303f293dffc89a8d8d5a4787c4/requirements-deploy.txt
145145
# https://github.com/pyca/cryptography/issues/6086

library_builders.bat

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -288,10 +288,14 @@ exit /b 0
288288
:main
289289
call :install_buildessentials
290290
call :build_zlib
291-
call :build_sqlite
292-
:: build_bzip2
293-
:: build_szip
294-
call :build_zfp
295-
call :build_blosc2
296291
call :build_hdf5
297-
call :build_adios2
292+
293+
rem ADIOS2 and its exclusive dependencies
294+
if /I "%openPMD_CMAKE_openPMD_USE_ADIOS2%"=="ON" (
295+
call :build_sqlite
296+
rem build_bzip2
297+
rem build_szip
298+
call :build_zfp
299+
call :build_blosc2
300+
call :build_adios2
301+
)
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
diff --git a/setup.py b/setup.py
2+
index e44e942..0000001 100644
3+
--- a/setup.py
4+
+++ b/setup.py
5+
@@ -104,8 +104,11 @@
6+
os.path.join(extdir, "openpmd_api")
7+
)
8+
]
9+
- if sys.maxsize > 2**32:
10+
- cmake_args += ['-A', 'x64']
11+
+ generator_platform = os.environ.get("CMAKE_GENERATOR_PLATFORM")
12+
+ if generator_platform:
13+
+ cmake_args += ['-A', generator_platform]
14+
+ elif sys.maxsize > 2**32:
15+
+ cmake_args += ['-A', 'x64']
16+
build_args += ['--', '/m']
17+
else:
18+
cmake_args += ['-DCMAKE_BUILD_TYPE=' + cfg]

0 commit comments

Comments
 (0)