Skip to content
This repository was archived by the owner on Dec 1, 2023. It is now read-only.

Commit 9292637

Browse files
committed
Add linux aarch64 wheel build support
Signed-off-by: odidev <odidev@puresoftware.com>
1 parent 0322f18 commit 9292637

3 files changed

Lines changed: 26 additions & 4 deletions

File tree

.github/workflows/build.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,16 @@ on: push
44

55
jobs:
66
build_wheels:
7-
name: Build wheels on ${{ matrix.os }}
7+
name: Build wheels on ${{matrix.arch}} for ${{ matrix.os }}
88
runs-on: ${{ matrix.os }}
99
strategy:
1010
matrix:
1111
# os: [ubuntu-18.04, windows-latest, macos-latest] # skip windows
1212
os: [ubuntu-20.04, macos-11]
13+
arch: [auto, aarch64]
14+
exclude:
15+
- os: macos-11
16+
arch: aarch64
1317

1418
steps:
1519
- uses: actions/checkout@v2
@@ -23,15 +27,23 @@ jobs:
2327
with:
2428
python-version: '3.7'
2529

30+
#cibuildwheel support aarch64, via emulation.
31+
#Please refer - https://cibuildwheel.readthedocs.io/en/stable/faq/#emulation
32+
- uses: docker/setup-qemu-action@v1
33+
if: ${{ matrix.arch == 'aarch64' }}
34+
name: Set up QEMU
35+
2636
- name: Install cibuildwheel
2737
run: |
2838
python -m pip install cibuildwheel==2.1.1
2939
3040
- name: Build wheels
3141
env:
42+
CIBW_ARCHS_LINUX: ${{matrix.arch}}
3243
CIBW_SKIP: "pp* *-manylinux_i686"
3344
CIBW_BEFORE_BUILD_LINUX: "/bin/bash cibuild/linux_steps.sh"
3445
CIBW_BEFORE_BUILD_MACOS: "/bin/bash cibuild/macos_steps.sh"
46+
CIBW_BEFORE_TEST_LINUX: "/bin/bash cibuild/aarch64_extra_steps.sh"
3547
CIBW_TEST_COMMAND: "cd {project}/pyosmium && rm -rf build && pytest test"
3648
CIBW_TEST_REQUIRES: pytest shapely
3749
CIBW_TEST_SKIP: "cp310-macosx*" # missing libgeos

cibuild/aarch64_extra_steps.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/sh
2+
3+
if [ "$(uname -m)" == "aarch64" ]
4+
then
5+
yum install -y wget
6+
wget https://download-ib01.fedoraproject.org/pub/epel/7/aarch64/Packages/g/geos-3.4.2-2.el7.aarch64.rpm
7+
rpm -i geos-3.4.2-2.el7.aarch64.rpm
8+
rm geos-3.4.2-2.el7.aarch64.rpm
9+
fi

cibuild/linux_steps.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ echo "Running Linux steps"
66

77
CMAKE_BIN_URL_64=https://cmake.org/files/v3.6/cmake-3.6.3-Linux-x86_64.sh
88
CMAKE_BIN_URL_32=https://cmake.org/files/v3.6/cmake-3.6.3-Linux-i386.sh
9+
CMAKE_BIN_URL_aarch64=https://cmake.org/files/v3.21/cmake-3.21.0-linux-aarch64.sh
910

1011
function build_boost {
1112
mkdir -p boost
@@ -27,6 +28,8 @@ function build_boost {
2728
function build_cmake {
2829
if [ "x${AUDITWHEEL_ARCH}" == "xi686" ] ; then
2930
curl -o /tmp/cmake.sh "${CMAKE_BIN_URL_32}"
31+
elif [ "x${AUDITWHEEL_ARCH}" == "xaarch64" ] ; then
32+
curl -o /tmp/cmake.sh "${CMAKE_BIN_URL_aarch64}"
3033
else
3134
curl -o /tmp/cmake.sh "${CMAKE_BIN_URL_64}"
3235
fi
@@ -51,9 +54,7 @@ ln -sf $(pwd)/pybind11 pyosmium/contrib/pybind11
5154
ln -sf $(pwd)/libosmium pyosmium/contrib/libosmium
5255
ln -sf $(pwd)/protozero pyosmium/contrib/protozero
5356

54-
55-
yum install -y sparsehash-devel expat-devel boost-devel zlib-devel
56-
57+
yum install -y expat-devel boost-devel zlib-devel
5758

5859
# install bzip2
5960
build_new_zlib

0 commit comments

Comments
 (0)