From 26de7de1ee3cad566e8987deaba79e3270a6bc4b Mon Sep 17 00:00:00 2001 From: PHILO-HE Date: Wed, 3 Jul 2024 17:22:19 +0800 Subject: [PATCH] Initial --- cpp/CMake/ConfigArrow.cmake | 17 ++++------------- dev/build_arrow.sh | 4 ++++ ep/build-velox/src/build_velox.sh | 3 +-- ep/build-velox/src/get_velox.sh | 3 ++- 4 files changed, 11 insertions(+), 16 deletions(-) diff --git a/cpp/CMake/ConfigArrow.cmake b/cpp/CMake/ConfigArrow.cmake index ed1b0f2fd38c..1de4ba40633f 100644 --- a/cpp/CMake/ConfigArrow.cmake +++ b/cpp/CMake/ConfigArrow.cmake @@ -24,15 +24,14 @@ set(ARROW_BUNDLED_DEPS "arrow_bundled_dependencies") set(ARROW_INSTALL_DIR "${ARROW_HOME}/install") set(ARROW_LIB_DIR "${ARROW_INSTALL_DIR}/lib") set(ARROW_LIB64_DIR "${ARROW_INSTALL_DIR}/lib64") -set(ARROW_INCLUDE_DIR "${ARROW_INSTALL_DIR}/include") function(FIND_ARROW_LIB LIB_NAME) if(NOT TARGET Arrow::${LIB_NAME}) set(ARROW_LIB_FULL_NAME ${CMAKE_SHARED_LIBRARY_PREFIX}${LIB_NAME}${ARROW_STATIC_LIBRARY_SUFFIX}) add_library(Arrow::${LIB_NAME} STATIC IMPORTED) - # Firstly find the lib from velox's arrow build path. If not found, try to - # find it from system. + # Firstly find the lib from bundled path in Velox. If not found, try to find + # it from system. find_library( ARROW_LIB_${LIB_NAME} NAMES ${ARROW_LIB_FULL_NAME} @@ -45,15 +44,7 @@ function(FIND_ARROW_LIB LIB_NAME) message(FATAL_ERROR "Arrow library Not Found: ${ARROW_LIB_FULL_NAME}") endif() message(STATUS "Found Arrow library: ${ARROW_LIB_${LIB_NAME}}") - if(LIB_NAME STREQUAL ${ARROW_BUNDLED_DEPS}) - set_target_properties( - Arrow::${LIB_NAME} PROPERTIES IMPORTED_LOCATION - ${ARROW_LIB_${LIB_NAME}}) - else() - set_target_properties( - Arrow::${LIB_NAME} - PROPERTIES IMPORTED_LOCATION ${ARROW_LIB_${LIB_NAME}} - INTERFACE_INCLUDE_DIRECTORIES ${ARROW_HOME}/install/include) - endif() + set_target_properties(Arrow::${LIB_NAME} + PROPERTIES IMPORTED_LOCATION ${ARROW_LIB_${LIB_NAME}}) endif() endfunction() diff --git a/dev/build_arrow.sh b/dev/build_arrow.sh index d6606341a0d7..19d5627146b1 100755 --- a/dev/build_arrow.sh +++ b/dev/build_arrow.sh @@ -58,6 +58,10 @@ function build_arrow_cpp() { -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ -DARROW_BUILD_SHARED=OFF \ -DARROW_BUILD_STATIC=ON + + # Install thrift. + cd _build/thrift_ep-prefix/src/thrift_ep-build + sudo cmake --install ./ --prefix /usr/local/ popd } diff --git a/ep/build-velox/src/build_velox.sh b/ep/build-velox/src/build_velox.sh index 747eec3f8b6f..af3c192917bb 100755 --- a/ep/build-velox/src/build_velox.sh +++ b/ep/build-velox/src/build_velox.sh @@ -150,8 +150,7 @@ function compile { echo "NUM_THREADS_OPTS: $NUM_THREADS_OPTS" export simdjson_SOURCE=AUTO - # Quick fix for CI error due to velox rebase - export Arrow_SOURCE=BUNDLED + export Arrow_SOURCE=AUTO if [ $ARCH == 'x86_64' ]; then make $COMPILE_TYPE $NUM_THREADS_OPTS EXTRA_CMAKE_FLAGS="${COMPILE_OPTION}" elif [[ "$ARCH" == 'arm64' || "$ARCH" == 'aarch64' ]]; then diff --git a/ep/build-velox/src/get_velox.sh b/ep/build-velox/src/get_velox.sh index 6defe7e107f3..45ac22505f32 100755 --- a/ep/build-velox/src/get_velox.sh +++ b/ep/build-velox/src/get_velox.sh @@ -111,7 +111,8 @@ function process_setup_ubuntu { sed -i '/^ run_and_time install_folly/a \ \ export AZURE_SDK_DISABLE_AUTO_VCPKG=ON \n '${VELOX_HOME}/scripts'/setup-adapters.sh abfs' scripts/setup-ubuntu.sh fi sed -i '/run_and_time install_conda/d' scripts/setup-ubuntu.sh - + # Just depends on Gluten to install arrow libs since Gluten will apply some patches to Arrow source and uses different build options. + sed -i '/run_and_time install_arrow/d' scripts/setup-ubuntu.sh } function process_setup_centos8 {