Skip to content

Commit 5914f55

Browse files
committed
fix
Signed-off-by: Yuan <yuanzhou@apache.org>
1 parent ada5a71 commit 5914f55

2 files changed

Lines changed: 24 additions & 11 deletions

File tree

cpp/CMake/ConfigArrow.cmake

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,32 @@ function(FIND_ARROW_LIB LIB_NAME)
4444
endif()
4545
message(STATUS "Found Arrow library: ${ARROW_LIB_${LIB_NAME}}")
4646

47-
# Get the parent-parent directory of the lib file. For example:
48-
#
49-
# * ${ARROW_LIB_${LIB_NAME}}: /usr/local/lib/libarrow.a
50-
# * ${ARROW_LIB_INCLUDE_DIR}: /usr/local
51-
#
52-
# Then we can get our include directory: /usr/local/include
53-
get_filename_component(ARROW_LIB_INCLUDE_DIR "${ARROW_LIB_${LIB_NAME}}"
54-
PATH)
55-
get_filename_component(ARROW_LIB_INCLUDE_DIR "${ARROW_LIB_INCLUDE_DIR}"
56-
PATH)
47+
# Walk up from the library directory until we find a parent that contains
48+
# an "include/arrow/api.h" anchor file. This handles both conventional
49+
# layouts (/usr/local/lib/libarrow.a → /usr/local/include) and multi-arch
50+
# ones (/usr/lib/x86_64-linux-gnu/libarrow.a → /usr/include) without
51+
# hard-coding the number of directory levels to strip.
52+
get_filename_component(_arrow_search_dir "${ARROW_LIB_${LIB_NAME}}" PATH)
53+
set(ARROW_LIB_INCLUDE_DIR "")
54+
foreach(_level RANGE 5)
55+
if(EXISTS "${_arrow_search_dir}/include/arrow/api.h")
56+
set(ARROW_LIB_INCLUDE_DIR "${_arrow_search_dir}/include")
57+
break()
58+
endif()
59+
get_filename_component(_arrow_search_dir "${_arrow_search_dir}" PATH)
60+
endforeach()
61+
if(NOT ARROW_LIB_INCLUDE_DIR)
62+
message(
63+
FATAL_ERROR
64+
"Could not locate Arrow headers near ${ARROW_LIB_${LIB_NAME}}. "
65+
"Set ARROW_HOME to the Arrow installation prefix (the directory "
66+
"that contains lib/ and include/).")
67+
endif()
68+
message(STATUS "Found Arrow include: ${ARROW_LIB_INCLUDE_DIR}")
5769

5870
set_target_properties(
5971
Arrow::${LIB_NAME}
6072
PROPERTIES IMPORTED_LOCATION ${ARROW_LIB_${LIB_NAME}}
61-
INTERFACE_INCLUDE_DIRECTORIES ${ARROW_LIB_INCLUDE_DIR}/include)
73+
INTERFACE_INCLUDE_DIRECTORIES ${ARROW_LIB_INCLUDE_DIR})
6274
endif()
6375
endfunction()

ep/build-velox/src/get-velox.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ if [ "$VELOX_HOME" == "" ]; then
6565
fi
6666

6767
function process_setup_ubuntu {
68+
sed -i "s|run_and_time install_arrow||g" scripts/setup-centos9.sh
6869
echo "Using setup script from Velox"
6970
}
7071

0 commit comments

Comments
 (0)