Skip to content

Commit c4deb39

Browse files
BLD/RLS: add aarch64 linux wheels (#243)
1 parent 5759f65 commit c4deb39

File tree

5 files changed

+103
-1
lines changed

5 files changed

+103
-1
lines changed

.circleci/config.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
version: 2.1
2+
3+
jobs:
4+
linux-aarch64-wheels:
5+
working_directory: ~/linux-aarch64-wheels
6+
machine:
7+
image: ubuntu-2004:2022.04.1
8+
docker_layer_caching: true
9+
# resource_class is what tells CircleCI to use an ARM worker for native arm builds
10+
# https://circleci.com/product/features/resource-classes/
11+
resource_class: arm.medium
12+
environment:
13+
CIBUILDWHEEL: 1
14+
CIBW_BUILD: "cp*-manylinux_aarch64"
15+
steps:
16+
- checkout
17+
- run:
18+
name: Build docker image with GDAL install
19+
command: docker build -f ci/manylinux_2_28_aarch64-vcpkg-gdal.Dockerfile -t manylinux-aarch64-vcpkg-gdal:latest .
20+
- run:
21+
name: Build the Linux aarch64 wheels.
22+
command: |
23+
python3 -m pip install --user cibuildwheel==2.12.1
24+
python3 -m cibuildwheel --output-dir wheelhouse
25+
- run:
26+
name: Test the wheels
27+
command: |
28+
python3 -m pip install -r ci/requirements-wheel-test.txt
29+
python3 -m pip install --no-deps geopandas
30+
python3 -m pip install --pre --find-links wheelhouse pyogrio
31+
python3 -m pip list
32+
cd ..
33+
python3 -c "import pyogrio; print(f'GDAL version: {pyogrio.__gdal_version__}\nGEOS version: {pyogrio.__gdal_geos_version__}')"
34+
python3 -m pytest --pyargs pyogrio.tests -v
35+
- store_artifacts:
36+
path: wheelhouse/
37+
38+
workflows:
39+
wheel-build:
40+
jobs:
41+
- linux-aarch64-wheels:
42+
filters:
43+
branches:
44+
only:
45+
- main
46+
- wheels-linux-aarch64
47+
tags:
48+
only: /.*/

CHANGES.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
### Packaging
2828

2929
- The GDAL library included in the wheels is updated from 3.6.2 to GDAL 3.6.4.
30+
- Wheels are now available for Linux aarch64 / arm64.
3031

3132
## 0.5.1 (2023-01-26)
3233

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
set(VCPKG_TARGET_ARCHITECTURE arm64)
2+
set(VCPKG_CRT_LINKAGE dynamic)
3+
set(VCPKG_CMAKE_SYSTEM_NAME Linux)
4+
set(VCPKG_BUILD_TYPE release)
5+
6+
set(VCPKG_LIBRARY_LINKAGE static)
7+
if(PORT MATCHES "gdal")
8+
set(VCPKG_LIBRARY_LINKAGE dynamic)
9+
endif()
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
FROM quay.io/pypa/manylinux_2_28_aarch64:2023-04-16-157f52a
2+
3+
# building openssl needs IPC-Cmd (https://github.com/microsoft/vcpkg/issues/24988)
4+
RUN dnf -y install curl zip unzip tar ninja-build perl-IPC-Cmd
5+
6+
# require python >= 3.7 (python 3.6 is default on base image) for meson
7+
RUN ln -s /opt/python/cp38-cp38/bin/python3 /usr/bin/python3
8+
9+
RUN git clone https://github.com/Microsoft/vcpkg.git /opt/vcpkg && \
10+
git -C /opt/vcpkg checkout 580f143d123ce6abb5c135b11d6402c9a54bc9b9
11+
12+
ENV VCPKG_INSTALLATION_ROOT="/opt/vcpkg"
13+
ENV PATH="${PATH}:/opt/vcpkg"
14+
15+
ENV VCPKG_DEFAULT_TRIPLET="arm64-linux-dynamic-release"
16+
# pkgconf fails to build with default debug mode of arm64-linux host
17+
ENV VCPKG_DEFAULT_HOST_TRIPLET="arm64-linux-release"
18+
19+
# Must be set when building on arm
20+
ENV VCPKG_FORCE_SYSTEM_BINARIES=1
21+
22+
# mkdir & touch -> workaround for https://github.com/microsoft/vcpkg/issues/27786
23+
RUN bootstrap-vcpkg.sh && \
24+
mkdir -p /root/.vcpkg/ $HOME/.vcpkg && \
25+
touch /root/.vcpkg/vcpkg.path.txt $HOME/.vcpkg/vcpkg.path.txt && \
26+
vcpkg integrate install && \
27+
vcpkg integrate bash
28+
29+
COPY ci/custom-triplets/arm64-linux-dynamic-release.cmake opt/vcpkg/custom-triplets/arm64-linux-dynamic-release.cmake
30+
COPY ci/vcpkg-custom-ports/ opt/vcpkg/custom-ports/
31+
COPY ci/vcpkg.json opt/vcpkg/
32+
33+
ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/opt/vcpkg/installed/arm64-linux-dynamic-release/lib"
34+
RUN vcpkg install --overlay-triplets=opt/vcpkg/custom-triplets \
35+
--overlay-ports=opt/vcpkg/custom-ports \
36+
--feature-flags="versions,manifests" \
37+
--x-manifest-root=opt/vcpkg \
38+
--x-install-root=opt/vcpkg/installed && \
39+
vcpkg list
40+
41+
# setting git safe directory is required for properly building wheels when
42+
# git >= 2.35.3
43+
RUN git config --global --add safe.directory "*"

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ requires = [
1414
skip = ["cp36-*", "cp37-*", "pp*", "*musllinux*"]
1515
archs = ["auto64"]
1616
manylinux-x86_64-image = "manylinux-vcpkg-gdal:latest"
17+
manylinux-aarch64-image = "manylinux-aarch64-vcpkg-gdal:latest"
1718
build-verbosity = 3
1819

1920
[tool.cibuildwheel.linux.environment]
20-
VCPKG_INSTALL = "$VCPKG_INSTALLATION_ROOT/installed/x64-linux-dynamic"
21+
VCPKG_INSTALL = "$VCPKG_INSTALLATION_ROOT/installed/$VCPKG_DEFAULT_TRIPLET"
2122
GDAL_INCLUDE_PATH = "$VCPKG_INSTALL/include"
2223
GDAL_LIBRARY_PATH = "$VCPKG_INSTALL/lib"
2324
GDAL_VERSION = "3.6.4"

0 commit comments

Comments
 (0)