From 922130d6db7d75dca80d06cb59b8af3f22d7aac2 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Wed, 4 May 2022 11:32:16 -0700 Subject: [PATCH] Update build to use newest rapids-cython code. --- python/pylibraft/CMakeLists.txt | 3 ++- python/pylibraft/pylibraft/distance/CMakeLists.txt | 8 +++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/python/pylibraft/CMakeLists.txt b/python/pylibraft/CMakeLists.txt index a4dd2e1e33..3df5c7f5de 100644 --- a/python/pylibraft/CMakeLists.txt +++ b/python/pylibraft/CMakeLists.txt @@ -20,7 +20,6 @@ set(raft_version 22.06.00) file(DOWNLOAD https://raw.githubusercontent.com/vyasr/rapids-cmake/rapids-cython/RAPIDS.cmake ${CMAKE_BINARY_DIR}/RAPIDS.cmake) include(${CMAKE_BINARY_DIR}/RAPIDS.cmake) -include(rapids-cython) project( raft-python @@ -58,4 +57,6 @@ if(NOT RAFT_FOUND) add_subdirectory(../../cpp raft-cpp) endif() +include(rapids-cython) +rapids_cython_init() add_subdirectory(pylibraft/distance) diff --git a/python/pylibraft/pylibraft/distance/CMakeLists.txt b/python/pylibraft/pylibraft/distance/CMakeLists.txt index 8688f74c59..4281a983dd 100644 --- a/python/pylibraft/pylibraft/distance/CMakeLists.txt +++ b/python/pylibraft/pylibraft/distance/CMakeLists.txt @@ -13,9 +13,11 @@ # ============================================================================= # Set the list of Cython files to build -set(cython_modules pairwise_distance) +set(cython_modules pairwise_distance.pyx) set(linked_libraries raft::raft raft::distance) # Build all of the Cython targets -# TODO: Depending on how project calls interact we can't rely on variables like CMAKE_PROJECT_NAME, otherwise we could use that to get the _SOURCE_DIR and it wouldn't have to be a parameter. Can we find an alternate approach here? -create_cython_modules("${cython_modules}" "${linked_libraries}" ${raft-python_SOURCE_DIR}) +rapids_cython_create_modules( + SOURCE_FILES "${cython_modules}" + LINKED_LIBRARIES "${linked_libraries}" + CXX)