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

Commit f7b9e50

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

2 files changed

Lines changed: 23 additions & 2 deletions

File tree

.github/workflows/build.yml

Lines changed: 12 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,12 +27,19 @@ 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"

cibuild/linux_steps.sh

Lines changed: 11 additions & 1 deletion
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
@@ -52,7 +55,14 @@ ln -sf $(pwd)/libosmium pyosmium/contrib/libosmium
5255
ln -sf $(pwd)/protozero pyosmium/contrib/protozero
5356

5457

55-
yum install -y sparsehash-devel expat-devel boost-devel zlib-devel
58+
if [ "$(uname -m)" == "aarch64" ]
59+
then
60+
yum install -y expat-devel boost-devel zlib-devel
61+
wget https://download-ib01.fedoraproject.org/pub/epel/7/aarch64/Packages/g/geos-3.4.2-2.el7.aarch64.rpm
62+
rpm -i geos-3.4.2-2.el7.aarch64.rpm
63+
else
64+
yum install -y sparsehash-devel expat-devel boost-devel zlib-devel
65+
fi
5666

5767

5868
# install bzip2

0 commit comments

Comments
 (0)