Skip to content

Commit

Permalink
BLD/RLS: fix aarch64 wheel building (#352)
Browse files Browse the repository at this point in the history
  • Loading branch information
jorisvandenbossche authored Feb 10, 2024
1 parent 65d92e9 commit 1f1620e
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 4 deletions.
7 changes: 4 additions & 3 deletions ci/manylinux_2_28_aarch64-vcpkg-gdal.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ FROM quay.io/pypa/manylinux_2_28_aarch64:2024-01-23-12ffabc
# building openssl needs IPC-Cmd (https://github.com/microsoft/vcpkg/issues/24988)
RUN dnf -y install curl zip unzip tar ninja-build perl-IPC-Cmd

# require python >= 3.7 (python 3.6 is default on base image) for meson
RUN ln -s /opt/python/cp38-cp38/bin/python3 /usr/bin/python3

RUN git clone https://github.com/Microsoft/vcpkg.git /opt/vcpkg && \
git -C /opt/vcpkg checkout 6df4d4f49866212aa00fcd85fde5356503dafed1

Expand All @@ -30,6 +27,10 @@ COPY ci/custom-triplets/arm64-linux-dynamic-release.cmake opt/vcpkg/custom-tripl
COPY ci/vcpkg-custom-ports/ opt/vcpkg/custom-ports/
COPY ci/vcpkg.json opt/vcpkg/

# temporary workaround for https://github.com/microsoft/vcpkg/issues/36094
COPY ci/vcpkg_linux_crosscompiling.patch opt/vcpkg/
RUN git -C /opt/vcpkg apply vcpkg_linux_crosscompiling.patch

ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/opt/vcpkg/installed/arm64-linux-dynamic-release/lib"
RUN vcpkg install --overlay-triplets=opt/vcpkg/custom-triplets \
--overlay-ports=opt/vcpkg/custom-ports \
Expand Down
3 changes: 2 additions & 1 deletion ci/requirements-wheel-test.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
pytest
# pytest 8.0 gives permission error (https://github.com/pytest-dev/pytest/issues/11904)
pytest<8
# dependencies of geopandas (installed separately with --no-deps to avoid fiona)
pandas
pyproj ; (python_version < '3.12') or (python_full_version >= '3.12.1')
Expand Down
22 changes: 22 additions & 0 deletions ci/vcpkg_linux_crosscompiling.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
diff --git a/scripts/toolchains/linux.cmake b/scripts/toolchains/linux.cmake
index f22c71076..a68d6cbe8 100644
--- a/scripts/toolchains/linux.cmake
+++ b/scripts/toolchains/linux.cmake
@@ -13,7 +13,7 @@ elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
string(APPEND VCPKG_LINKER_FLAGS " -m32")
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm")
set(CMAKE_SYSTEM_PROCESSOR armv7l CACHE STRING "")
- if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
+ if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64")
if(NOT DEFINED CMAKE_CXX_COMPILER)
set(CMAKE_CXX_COMPILER "arm-linux-gnueabihf-g++")
endif()
@@ -30,7 +30,7 @@ elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm")
endif()
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
set(CMAKE_SYSTEM_PROCESSOR aarch64 CACHE STRING "")
- if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux")
+ if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux" AND CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64")
if(NOT DEFINED CMAKE_CXX_COMPILER)
set(CMAKE_CXX_COMPILER "aarch64-linux-gnu-g++")
endif()

0 comments on commit 1f1620e

Please sign in to comment.