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

aarch64 build wheel #330

Merged
merged 4 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from 3 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
14 changes: 2 additions & 12 deletions .github/scripts/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,4 @@
ARG BASE_IMAGE=quay.io/pypa/manylinux2014_x86_64
ARG BASE_IMAGE=quay.io/pypa/manylinux_2_28_x86_64
FROM ${BASE_IMAGE}

RUN yum install -y \
git \
wget \
eigen3-devel \
hdf5-devel

# Install the latest cmake
RUN VERSION=3.19.4 && \
wget -q https://github.com/Kitware/CMake/releases/download/v$VERSION/cmake-$VERSION-Linux-x86_64.sh && \
bash cmake-$VERSION-Linux-x86_64.sh --skip-license --prefix=/usr/local && \
rm cmake-$VERSION-Linux-x86_64.sh
RUN dnf install wget eigen3-devel hdf5-devel cmake -y
15 changes: 12 additions & 3 deletions .github/scripts/docker/build_and_push.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
#!/usr/bin/env bash

image_base=quay.io/pypa/manylinux2014_x86_64
tag=openchemistry/stempy_wheel_builder
# arch=x86_64
arch=aarch64

docker build . -t $tag --build-arg BASE_IMAGE=$image_base
if [ "$arch" = "x86_64" ]; then
platform=linux/amd64
elif [ "$arch" = "aarch64" ]; then
platform=linux/arm64
fi

image_base=quay.io/pypa/manylinux_2_28_${arch}
tag=samwelborn/stempy_wheel_builder_${arch}
swelborn marked this conversation as resolved.
Show resolved Hide resolved

docker build . --platform=$platform -t $tag --build-arg BASE_IMAGE=$image_base --build-arg ARCH=$arch
docker push $tag
13 changes: 11 additions & 2 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ env:
CIBW_SKIP: "cp36-* pp* *-manylinux_i686 *-musllinux_* *-win32 cp313-*"

# This has some of the software we need pre-installed on it
CIBW_MANYLINUX_X86_64_IMAGE: openchemistry/stempy_wheel_builder
CIBW_MANYLINUX_X86_64_IMAGE: samwelborn/stempy_wheel_builder_x86_64
CIBW_MANYLINUX_AARCH64_IMAGE: samwelborn/stempy_wheel_builder_aarch64
swelborn marked this conversation as resolved.
Show resolved Hide resolved

# Need to do some setup before repairing the wheel on linux...
CIBW_REPAIR_WHEEL_COMMAND_LINUX: bash .github/scripts/repair_command_linux.sh
Expand All @@ -32,6 +33,8 @@ env:

CIBW_TEST_COMMAND: pytest {project}/tests

CIBW_ARCHS_LINUX: auto aarch64

CIBW_ARCHS_MACOS: x86_64 arm64

CIBW_BEFORE_ALL_MACOS: . .github/scripts/install_hdf5_macos.sh
Expand Down Expand Up @@ -63,11 +66,17 @@ jobs:
with:
python-version: '3.10'

- name: Set up QEMU
if: runner.os == 'Linux'
uses: docker/setup-qemu-action@v3
with:
platforms: all

- name: Install dependencies
run: . .github/scripts/install.sh

- name: Build wheels
run: cibuildwheel --output-dir wheelhouse
run: cibuildwheel --output-dir wheelhouse

- uses: actions/upload-artifact@v3
with:
Expand Down
4 changes: 3 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
numpy
# Tests fail with numpy v2.0.4 py39 aarch64, pin here
numpy<2.0; (python_version <= "3.9" and platform_machine == "aarch64")
numpy; python_version > "3.9" or platform_machine != "aarch64"
h5py
deprecation
Loading