Skip to content

Commit

Permalink
Merge pull request #330 from OpenChemistry/build-arm
Browse files Browse the repository at this point in the history
aarch64 build wheel
  • Loading branch information
cjh1 authored Jan 9, 2025
2 parents 4314dce + 833bdae commit c8cfa63
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 18 deletions.
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=openchemistry/stempy_wheel_builder_${arch}

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: openchemistry/stempy_wheel_builder_x86_64
CIBW_MANYLINUX_AARCH64_IMAGE: openchemistry/stempy_wheel_builder_aarch64

# 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

0 comments on commit c8cfa63

Please sign in to comment.