This is an automated email from the ASF dual-hosted git repository.

yibocai pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new 973dbae  ARROW-13635: [Packaging][Python] Define --with-lg-page for 
jemalloc in the arm manylinux builds
973dbae is described below

commit 973dbaea39d1c2b71dcc1c7e0aba52cfdd133c64
Author: Krisztián Szűcs <szucs.kriszt...@gmail.com>
AuthorDate: Wed Aug 18 02:30:36 2021 +0000

    ARROW-13635: [Packaging][Python] Define --with-lg-page for jemalloc in the 
arm manylinux builds
    
    Closes #10940 from kszucs/jemalloc-lg-page
    
    Authored-by: Krisztián Szűcs <szucs.kriszt...@gmail.com>
    Signed-off-by: Yibo Cai <yibo....@arm.com>
---
 ci/scripts/python_wheel_manylinux_build.sh  | 8 ++++++++
 cpp/cmake_modules/ThirdpartyToolchain.cmake | 5 +++++
 2 files changed, 13 insertions(+)

diff --git a/ci/scripts/python_wheel_manylinux_build.sh 
b/ci/scripts/python_wheel_manylinux_build.sh
index 312e1c3..434605c 100755
--- a/ci/scripts/python_wheel_manylinux_build.sh
+++ b/ci/scripts/python_wheel_manylinux_build.sh
@@ -71,6 +71,13 @@ echo "=== (${PYTHON_VERSION}) Building Arrow C++ libraries 
==="
 : ${VCPKG_FEATURE_FLAGS:=-manifests}
 : 
${VCPKG_TARGET_TRIPLET:=${VCPKG_DEFAULT_TRIPLET:-x64-linux-static-${CMAKE_BUILD_TYPE}}}
 
+if [[ "$(uname -m)" == arm* ]] || [[ "$(uname -m)" == aarch* ]]; then
+    # Build jemalloc --with-lg-page=16 in order to make the wheel work on both
+    # 4k and 64k page arm64 systems. For more context see
+    # https://github.com/apache/arrow/issues/10929
+    export ARROW_EXTRA_CMAKE_FLAGS="-DARROW_JEMALLOC_LG_PAGE=16"
+fi
+
 mkdir /tmp/arrow-build
 pushd /tmp/arrow-build
 cmake \
@@ -109,6 +116,7 @@ cmake \
     -DOPENSSL_USE_STATIC_LIBS=ON \
     -DVCPKG_MANIFEST_MODE=OFF \
     -DVCPKG_TARGET_TRIPLET=${VCPKG_TARGET_TRIPLET} \
+    ${ARROW_EXTRA_CMAKE_FLAGS} \
     -G ${CMAKE_GENERATOR} \
     /arrow/cpp
 cmake --build . --target install
diff --git a/cpp/cmake_modules/ThirdpartyToolchain.cmake 
b/cpp/cmake_modules/ThirdpartyToolchain.cmake
index 0631d27..c3f13e2 100644
--- a/cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ b/cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -1502,6 +1502,11 @@ if(ARROW_JEMALLOC)
   if(CMAKE_OSX_SYSROOT)
     list(APPEND JEMALLOC_CONFIGURE_COMMAND "SDKROOT=${CMAKE_OSX_SYSROOT}")
   endif()
+  if(DEFINED ARROW_JEMALLOC_LG_PAGE)
+    # Used for arm64 manylinux wheels in order to make the wheel work on both
+    # 4k and 64k page arm64 systems.
+    list(APPEND JEMALLOC_CONFIGURE_COMMAND 
"--with-lg-page=${ARROW_JEMALLOC_LG_PAGE}")
+  endif()
   list(APPEND
        JEMALLOC_CONFIGURE_COMMAND
        "--prefix=${JEMALLOC_PREFIX}"

Reply via email to