kou commented on code in PR #35637:
URL: https://github.com/apache/arrow/pull/35637#discussion_r1274390765


##########
dev/tasks/conda-recipes/arrow-cpp/build-arrow.sh:
##########
@@ -30,27 +30,21 @@ fi
 # Enable CUDA support
 if [[ ! -z "${cuda_compiler_version+x}" && "${cuda_compiler_version}" != 
"None" ]]
 then
-    if [[ -z "${CUDA_HOME+x}" ]]
-    then
-        echo "cuda_compiler_version=${cuda_compiler_version} 
CUDA_HOME=$CUDA_HOME"
-        CUDA_GDB_EXECUTABLE=$(which cuda-gdb || exit 0)
-        if [[ -n "$CUDA_GDB_EXECUTABLE" ]]
-        then
-            CUDA_HOME=$(dirname $(dirname $CUDA_GDB_EXECUTABLE))
-        else
-            echo "Cannot determine CUDA_HOME: cuda-gdb not in PATH"
-            return 1
-        fi
-    fi
-    EXTRA_CMAKE_ARGS=" ${EXTRA_CMAKE_ARGS} -DARROW_CUDA=ON 
-DCUDA_TOOLKIT_ROOT_DIR=${CUDA_HOME} 
-DCMAKE_LIBRARY_PATH=${CUDA_HOME}/lib64/stubs"
+    EXTRA_CMAKE_ARGS=" ${EXTRA_CMAKE_ARGS} -DARROW_CUDA=ON 
-DCUDA_TOOLKIT_ROOT_DIR=${CUDA_HOME} 
-DCMAKE_LIBRARY_PATH=${CONDA_BUILD_SYSROOT}/lib"
 else
     EXTRA_CMAKE_ARGS=" ${EXTRA_CMAKE_ARGS} -DARROW_CUDA=OFF"
 fi
 
-if [[ "${target_platform}" == "osx-arm64" ]]; then
-    EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS} 
-DCLANG_EXECUTABLE=${BUILD_PREFIX}/bin/clang 
-DLLVM_LINK_EXECUTABLE=${BUILD_PREFIX}/bin/llvm-link"
+if [[ "${build_platform}" != "${target_platform}" ]]; then
+    # point to a usable protoc/grpc_cpp_plugin if we're cross-compiling
+    EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS} 
-DProtobuf_PROTOC_EXECUTABLE=$BUILD_PREFIX/bin/protoc"
+    if [[ ! -f ${BUILD_PREFIX}/bin/${CONDA_TOOLCHAIN_HOST}-clang ]]; then
+        ln -sf ${BUILD_PREFIX}/bin/clang 
${BUILD_PREFIX}/bin/${CONDA_TOOLCHAIN_HOST}-clang
+    fi
+    EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS} 
-DCLANG_EXECUTABLE=${BUILD_PREFIX}/bin/${CONDA_TOOLCHAIN_HOST}-clang"
+    EXTRA_CMAKE_ARGS="${EXTRA_CMAKE_ARGS} 
-DLLVM_LINK_EXECUTABLE=${BUILD_PREFIX}/bin/llvm-link"
     sed -ie 
"s;protoc-gen-grpc.*$;protoc-gen-grpc=${BUILD_PREFIX}/bin/grpc_cpp_plugin\";g" 
../src/arrow/flight/CMakeLists.txt
-    sed -ie 
's;"--with-jemalloc-prefix\=je_arrow_";"--with-jemalloc-prefix\=je_arrow_" 
"--with-lg-page\=14";g' ../cmake_modules/ThirdpartyToolchain.cmake
+    sed -ie 
's;"--with-jemalloc-prefix\=je_arrow_";"--with-jemalloc-prefix\=je_arrow_" 
"--with-lg-page\=16";g' ../cmake_modules/ThirdpartyToolchain.cmake

Review Comment:
   We can use `-DARROW_JEMALLOC_LG_PAGE=16` instead of rewriting 
`ThirdpartyToolchain.cmake`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to