Skip to content

Commit

Permalink
Use rapids_find_package to get cugraph-ops (#2148)
Browse files Browse the repository at this point in the history
Depends on rapidsai/raft#583 and rapidsai/cugraph-ops#70

This PR uses `CPMFindPackage` to find (or build) `cugraph-ops`.

This enables building from source against a local `cugraph-ops` build via `-D cugraph-ops_ROOT=/cugraph-ops/build`.

Authors:
  - Paul Taylor (https://github.com/trxcllnt)

Approvers:
  - Rick Ratzel (https://github.com/rlratzel)

URL: #2148
  • Loading branch information
trxcllnt authored Mar 27, 2022
1 parent f1636a8 commit ad770d2
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 19 deletions.
2 changes: 1 addition & 1 deletion cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ target_include_directories(cugraph
# - link libraries -------------------------------------------------------------
target_link_libraries(cugraph
PUBLIC
cugraphops::cugraphops
cugraph-ops::cugraph-ops++
raft::raft
PRIVATE
cugraph::cuHornet
Expand Down
30 changes: 13 additions & 17 deletions cpp/cmake/thirdparty/get_libcugraphops.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,22 @@
# limitations under the License.
#=============================================================================

function(find_and_configure_cugraphops)
set(CUGRAPH_MIN_VERSION_cugraph_ops "${CUGRAPH_VERSION_MAJOR}.${CUGRAPH_VERSION_MINOR}.00")

if(TARGET cugraphops::cugraphops)
return()
endif()
function(find_and_configure_cugraph_ops)

rapids_find_generate_module(cugraphops
HEADER_NAMES graph/sampling.hpp
LIBRARY_NAMES cugraph-ops++
INCLUDE_SUFFIXES cugraph-ops
BUILD_EXPORT_SET cugraph-exports
INSTALL_EXPORT_SET cugraph-exports
)
set(oneValueArgs VERSION)
cmake_parse_arguments(PKG "" "${oneValueArgs}" "" ${ARGN})

rapids_find_package(cugraphops
REQUIRED
BUILD_EXPORT_SET cugraph-exports
INSTALL_EXPORT_SET cugraph-exports
rapids_find_package(cugraph-ops ${PKG_VERSION} REQUIRED
GLOBAL_TARGETS cugraph-ops::cugraph-ops++
BUILD_EXPORT_SET cugraph-exports
INSTALL_EXPORT_SET cugraph-exports
)

endfunction()

find_and_configure_cugraphops()
###
# To use a locally-built cugraph-ops package, set the CMake variable
# `-D cugraph-ops_ROOT=/path/to/cugraph-ops/build`
###
find_and_configure_cugraph_ops(VERSION ${CUGRAPH_MIN_VERSION_cugraph_ops})
2 changes: 1 addition & 1 deletion cpp/cmake/thirdparty/get_raft.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ endfunction()

# Change pinned tag and fork here to test a commit in CI
# To use a different RAFT locally, set the CMake variable
# RPM_raft_SOURCE=/path/to/local/raft
# CPM_raft_SOURCE=/path/to/local/raft
find_and_configure_raft(VERSION ${CUGRAPH_MIN_VERSION_raft}
FORK rapidsai
PINNED_TAG branch-${CUGRAPH_BRANCH_VERSION_raft}
Expand Down

0 comments on commit ad770d2

Please sign in to comment.