Skip to content

Commit

Permalink
Merge pull request #9785 from rapidsai/branch-21.12
Browse files Browse the repository at this point in the history
[gpuCI] Forward-merge branch-21.12 to branch-22.02 [skip gpuci]
  • Loading branch information
GPUtester authored Nov 29, 2021
2 parents d1811b5 + 8d9d222 commit 0f7c532
Show file tree
Hide file tree
Showing 2 changed files with 100 additions and 17 deletions.
21 changes: 21 additions & 0 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -734,6 +734,27 @@ set(install_code_string
[=[
set(ArrowCUDA_DIR "${Arrow_DIR}")
find_dependency(ArrowCUDA)
]=]
)

if(CUDF_ENABLE_ARROW_PARQUET)
string(
APPEND
install_code_string
[=[
if(NOT Parquet_DIR)
set(Parquet_DIR "${Arrow_DIR}")
endif()
set(ArrowDataset_DIR "${Arrow_DIR}")
find_dependency(ArrowDataset)
]=]
)
endif()

string(
APPEND
install_code_string
[=[
if(testing IN_LIST cudf_FIND_COMPONENTS)
enable_language(CUDA)
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/cudf-testing-dependencies.cmake")
Expand Down
96 changes: 79 additions & 17 deletions cpp/cmake/thirdparty/get_arrow.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ function(find_and_configure_arrow VERSION BUILD_STATIC ENABLE_S3 ENABLE_ORC ENAB

rapids_cpm_find(
Arrow ${VERSION}
GLOBAL_TARGETS arrow_shared arrow_cuda_shared
GLOBAL_TARGETS arrow_shared parquet_shared arrow_cuda_shared arrow_dataset_shared
CPM_ARGS
GIT_REPOSITORY https://github.com/apache/arrow.git
GIT_TAG apache-arrow-${VERSION}
Expand Down Expand Up @@ -142,6 +142,15 @@ function(find_and_configure_arrow VERSION BUILD_STATIC ENABLE_S3 ENABLE_ORC ENAB
set(ArrowCUDA_DIR "${Arrow_DIR}")
find_package(Arrow REQUIRED QUIET)
find_package(ArrowCUDA REQUIRED QUIET)
if(ENABLE_PARQUET)
if(NOT Parquet_DIR)
# Set this to enable `find_package(Parquet)`
set(Parquet_DIR "${Arrow_DIR}")
endif()
# Set this to enable `find_package(ArrowDataset)`
set(ArrowDataset_DIR "${Arrow_DIR}")
find_package(ArrowDataset REQUIRED QUIET)
endif()
elseif(Arrow_ADDED)
# Copy these files so we can avoid adding paths in Arrow_BINARY_DIR to
# target_include_directories. That defeats ccache.
Expand Down Expand Up @@ -182,24 +191,15 @@ function(find_and_configure_arrow VERSION BUILD_STATIC ENABLE_S3 ENABLE_ORC ENAB
endif()

if(Arrow_ADDED)

set(arrow_code_string
[=[
if (TARGET cudf::arrow_shared AND (NOT TARGET arrow_shared))
add_library(arrow_shared ALIAS cudf::arrow_shared)
endif()
if (TARGET cudf::arrow_static AND (NOT TARGET arrow_static))
add_library(arrow_static ALIAS cudf::arrow_static)
endif()
]=]
)
set(arrow_cuda_code_string
[=[
if (TARGET cudf::arrow_cuda_shared AND (NOT TARGET arrow_cuda_shared))
add_library(arrow_cuda_shared ALIAS cudf::arrow_cuda_shared)
endif()
if (TARGET cudf::arrow_cuda_static AND (NOT TARGET arrow_cuda_static))
add_library(arrow_cuda_static ALIAS cudf::arrow_cuda_static)
endif()
if (TARGET cudf::arrow_shared AND (NOT TARGET arrow_shared))
add_library(arrow_shared ALIAS cudf::arrow_shared)
endif()
if (TARGET cudf::arrow_static AND (NOT TARGET arrow_static))
add_library(arrow_static ALIAS cudf::arrow_static)
endif()
]=]
)

Expand All @@ -212,6 +212,17 @@ function(find_and_configure_arrow VERSION BUILD_STATIC ENABLE_S3 ENABLE_ORC ENAB
FINAL_CODE_BLOCK arrow_code_string
)

set(arrow_cuda_code_string
[=[
if (TARGET cudf::arrow_cuda_shared AND (NOT TARGET arrow_cuda_shared))
add_library(arrow_cuda_shared ALIAS cudf::arrow_cuda_shared)
endif()
if (TARGET cudf::arrow_cuda_static AND (NOT TARGET arrow_cuda_static))
add_library(arrow_cuda_static ALIAS cudf::arrow_cuda_static)
endif()
]=]
)

rapids_export(
BUILD ArrowCUDA
VERSION ${VERSION}
Expand All @@ -220,6 +231,49 @@ function(find_and_configure_arrow VERSION BUILD_STATIC ENABLE_S3 ENABLE_ORC ENAB
NAMESPACE cudf::
FINAL_CODE_BLOCK arrow_cuda_code_string
)

if(ENABLE_PARQUET)

set(arrow_dataset_code_string
[=[
if (TARGET cudf::arrow_dataset_shared AND (NOT TARGET arrow_dataset_shared))
add_library(arrow_dataset_shared ALIAS cudf::arrow_dataset_shared)
endif()
if (TARGET cudf::arrow_dataset_static AND (NOT TARGET arrow_dataset_static))
add_library(arrow_dataset_static ALIAS cudf::arrow_dataset_static)
endif()
]=]
)

rapids_export(
BUILD ArrowDataset
VERSION ${VERSION}
EXPORT_SET arrow_dataset_targets
GLOBAL_TARGETS arrow_dataset_shared arrow_dataset_static
NAMESPACE cudf::
FINAL_CODE_BLOCK arrow_dataset_code_string
)

set(parquet_code_string
[=[
if (TARGET cudf::parquet_shared AND (NOT TARGET parquet_shared))
add_library(parquet_shared ALIAS cudf::parquet_shared)
endif()
if (TARGET cudf::parquet_static AND (NOT TARGET parquet_static))
add_library(parquet_static ALIAS cudf::parquet_static)
endif()
]=]
)

rapids_export(
BUILD Parquet
VERSION ${VERSION}
EXPORT_SET parquet_targets
GLOBAL_TARGETS parquet_shared parquet_static
NAMESPACE cudf::
FINAL_CODE_BLOCK parquet_code_string
)
endif()
endif()
# We generate the arrow-config and arrowcuda-config files when we built arrow locally, so always
# do `find_dependency`
Expand All @@ -230,10 +284,18 @@ function(find_and_configure_arrow VERSION BUILD_STATIC ENABLE_S3 ENABLE_ORC ENAB
# ArrowCUDA_DIR to be where Arrow was found, since Arrow packages ArrowCUDA.config in a
# non-standard location
rapids_export_package(BUILD ArrowCUDA cudf-exports)
if(ENABLE_PARQUET)
rapids_export_package(BUILD Parquet cudf-exports)
rapids_export_package(BUILD ArrowDataset cudf-exports)
endif()

include("${rapids-cmake-dir}/export/find_package_root.cmake")
rapids_export_find_package_root(BUILD Arrow [=[${CMAKE_CURRENT_LIST_DIR}]=] cudf-exports)
rapids_export_find_package_root(BUILD ArrowCUDA [=[${CMAKE_CURRENT_LIST_DIR}]=] cudf-exports)
if(ENABLE_PARQUET)
rapids_export_find_package_root(BUILD Parquet [=[${CMAKE_CURRENT_LIST_DIR}]=] cudf-exports)
rapids_export_find_package_root(BUILD ArrowDataset [=[${CMAKE_CURRENT_LIST_DIR}]=] cudf-exports)
endif()

set(ARROW_FOUND
"${ARROW_FOUND}"
Expand Down

0 comments on commit 0f7c532

Please sign in to comment.