diff --git a/cpp/cmake/thirdparty/get_dlpack.cmake b/cpp/cmake/thirdparty/get_dlpack.cmake index 252d50c7af8..65b5f4ff2eb 100644 --- a/cpp/cmake/thirdparty/get_dlpack.cmake +++ b/cpp/cmake/thirdparty/get_dlpack.cmake @@ -1,5 +1,5 @@ # ============================================================================= -# Copyright (c) 2020-2021, NVIDIA CORPORATION. +# Copyright (c) 2020-2022, NVIDIA CORPORATION. # # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except # in compliance with the License. You may obtain a copy of the License at @@ -15,6 +15,7 @@ # This function finds dlpack and sets any additional necessary environment variables. function(find_and_configure_dlpack VERSION) + include(${rapids-cmake-dir}/find/generate_module.cmake) rapids_find_generate_module(DLPACK HEADER_NAMES dlpack.h) rapids_cpm_find( diff --git a/python/cudf/CMakeLists.txt b/python/cudf/CMakeLists.txt index 8a3224237b6..1c8bef42e4c 100644 --- a/python/cudf/CMakeLists.txt +++ b/python/cudf/CMakeLists.txt @@ -51,6 +51,12 @@ if(FIND_CUDF_CPP) endif() find_package(cudf ${cudf_version} REQUIRED) + + # an installed version of libcudf doesn't provide the dlpack headers so we need to download dlpack + # for the interop.pyx + include(rapids-cpm) + rapids_cpm_init() + include(../../cpp/cmake/thirdparty/get_dlpack.cmake) else() set(cudf_FOUND OFF) endif() diff --git a/python/cudf/cudf/_lib/CMakeLists.txt b/python/cudf/cudf/_lib/CMakeLists.txt index df17b8f2032..d58bdee02ad 100644 --- a/python/cudf/cudf/_lib/CMakeLists.txt +++ b/python/cudf/cudf/_lib/CMakeLists.txt @@ -69,6 +69,11 @@ foreach(target IN LISTS targets_using_numpy) target_include_directories(${target} PRIVATE "${Python_NumPy_INCLUDE_DIRS}") endforeach() +set(targets_using_dlpack interop) +foreach(target IN LISTS targets_using_dlpack) + target_include_directories(${target} PRIVATE "${DLPACK_INCLUDE_DIR}") +endforeach() + add_subdirectory(io) add_subdirectory(nvtext) add_subdirectory(strings)