Skip to content

Commit e7ade41

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

3 files changed

Lines changed: 26 additions & 12 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 an
48+
# "include/arrow/api.h" anchor file. This handles both conventional layouts
49+
# (/usr/local/lib/libarrow.a → /usr/local/include) and multi-arch ones
50+
# (/usr/lib/x86_64-linux-gnu/libarrow.a → /usr/include) without hard-coding
51+
# 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()

dev/build-thirdparty.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ function process_setup_ubuntu_2004 {
3232

3333
function process_setup_ubuntu_2204 {
3434
cp /usr/lib/${ARCH}-linux-gnu/{libre2.so.9,libdouble-conversion.so.3,libglog.so.0,libgflags.so.2.2,libevent-2.1.so.7,libsnappy.so.1,libunwind.so.8,libcurl.so.4,libxml2.so.2,libicui18n.so.70,libicuuc.so.70,libnghttp2.so.14,libldap-2.5.so.0,liblber-2.5.so.0,librtmp.so.1,libsasl2.so.2,libssh.so.4,libicudata.so.70} $THIRDPARTY_LIB/
35-
cp /usr/local/lib/{libboost_context.so.1.84.0,libboost_regex.so.1.84.0} $THIRDPARTY_LIB/
35+
find /usr/local/lib /usr/local/lib64 -name "libboost_context.so.1.84.0" -exec cp {} $THIRDPARTY_LIB/ \; 2>/dev/null
36+
find /usr/local/lib /usr/local/lib64 -name "libboost_regex.so.1.84.0" -exec cp {} $THIRDPARTY_LIB/ \; 2>/dev/null
3637
}
3738

3839
function process_setup_centos_9 {

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)