From 15e7166458427f1f642240e43a1156b31bc99974 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Tue, 5 Dec 2023 23:03:39 +0000 Subject: [PATCH] Make sure libcudf exports its pyarrow dependency --- cpp/cmake/thirdparty/get_arrow.cmake | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/cpp/cmake/thirdparty/get_arrow.cmake b/cpp/cmake/thirdparty/get_arrow.cmake index c0646e44f4b..0530e5dfd85 100644 --- a/cpp/cmake/thirdparty/get_arrow.cmake +++ b/cpp/cmake/thirdparty/get_arrow.cmake @@ -40,6 +40,21 @@ function(find_libarrow_in_python_wheel PYARROW_VERSION) OUTPUT_STRIP_TRAILING_WHITESPACE ) list(APPEND CMAKE_PREFIX_PATH "${CUDF_PYARROW_WHEEL_DIR}") + + string( + APPEND + initial_code_block + [=[ +find_package(Python 3.9 REQUIRED COMPONENTS Interpreter) +execute_process( + COMMAND "${Python_EXECUTABLE}" -c "import pyarrow; print(pyarrow.get_library_dirs()[0])" + OUTPUT_VARIABLE CUDF_PYARROW_WHEEL_DIR + OUTPUT_STRIP_TRAILING_WHITESPACE + COMMAND_ERROR_IS_FATAL ANY +) +list(APPEND CMAKE_PREFIX_PATH "${CUDF_PYARROW_WHEEL_DIR}") +]=] + ) rapids_find_generate_module( Arrow NO_CONFIG VERSION "${PYARROW_VERSION}" @@ -47,6 +62,7 @@ function(find_libarrow_in_python_wheel PYARROW_VERSION) BUILD_EXPORT_SET cudf-exports INSTALL_EXPORT_SET cudf-exports HEADER_NAMES arrow/python/arrow_to_pandas.h + INITIAL_CODE_BLOCK initial_code_block ) find_package(Arrow ${PYARROW_VERSION} MODULE REQUIRED GLOBAL)