Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VL] Set Arrow_SOURCE to AUTO to allow using system arrow libs #6325

Merged
merged 1 commit into from
Jul 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 4 additions & 13 deletions cpp/CMake/ConfigArrow.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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()
4 changes: 4 additions & 0 deletions dev/build_arrow.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
3 changes: 1 addition & 2 deletions ep/build-velox/src/build_velox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion ep/build-velox/src/get_velox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Loading