Skip to content

Commit

Permalink
Turn off cuco dependency in RAFT. Re-establish explicit cuco and `l…
Browse files Browse the repository at this point in the history
…ibcuxx` cmake dependencies (#2132)

Note: This PR depends on rapidsai/raft#540 and should work once it is merged.

Authors:
  - Corey J. Nolet (https://github.com/cjnolet)

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

URL: #2132
  • Loading branch information
cjnolet authored Apr 19, 2022
1 parent 886c724 commit eae7795
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 4 deletions.
10 changes: 8 additions & 2 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -135,16 +135,19 @@ rapids_cpm_init()
# following public header-only raft dependencies:
# * RMM
# * Thrust
# * libcu++
# * GTest/GMock
# * cuCollections
#
# The CMakeLists.txt for each of these projects are properly configured
# to generate a build and install export-set, so reimplementing finding or
# fetching those targets in cuGraph is redundant (at best), and potentially
# error-prone if something about those targets change and our implementation
# lags behind.
###

# Putting this before raft to override RAFT from pulling them in.
include(cmake/thirdparty/get_libcudacxx.cmake)
include(cmake/thirdparty/get_cuco.cmake)

include(cmake/thirdparty/get_raft.cmake)
include(cmake/thirdparty/get_libcugraphops.cmake)

Expand Down Expand Up @@ -290,6 +293,7 @@ target_link_libraries(cugraph
PUBLIC
cugraph-ops::cugraph-ops++
raft::raft
cuco::cuco
PRIVATE
cugraph::cuHornet
NCCL::NCCL
Expand Down Expand Up @@ -405,6 +409,8 @@ target_link_libraries(cugraph_c
CUDA::curand
CUDA::cusolver
CUDA::cusparse
raft::raft
cuco::cuco
PRIVATE
cugraph::cugraph
)
Expand Down
34 changes: 34 additions & 0 deletions cpp/cmake/thirdparty/get_cuco.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#=============================================================================
# Copyright (c) 2021-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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#=============================================================================

function(find_and_configure_cuco VERSION)

rapids_cpm_find(cuco ${VERSION}
GLOBAL_TARGETS cuco::cuco
BUILD_EXPORT_SET cugraph-exports
CPM_ARGS
EXCLUDE_FROM_ALL TRUE
GIT_REPOSITORY https://github.com/NVIDIA/cuCollections.git
GIT_TAG 0ca860b824f5dc22cf8a41f09912e62e11f07d82
OPTIONS "BUILD_TESTS OFF"
"BUILD_BENCHMARKS OFF"
"BUILD_EXAMPLES OFF"
)

endfunction()

# cuCollections doesn't have a version yet
find_and_configure_cuco(0.0)
24 changes: 24 additions & 0 deletions cpp/cmake/thirdparty/get_libcudacxx.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# =============================================================================
# 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under
# the License.
# =============================================================================

# This function finds libcudacxx and sets any additional necessary environment variables.
function(find_and_configure_libcudacxx)
include(${rapids-cmake-dir}/cpm/libcudacxx.cmake)

rapids_cpm_libcudacxx(BUILD_EXPORT_SET cugraph-exports
INSTALL_EXPORT_SET cugraph-exports)

endfunction()

find_and_configure_libcudacxx()
6 changes: 4 additions & 2 deletions cpp/cmake/thirdparty/get_raft.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,15 @@ function(find_and_configure_raft)
BUILD_EXPORT_SET cugraph-exports
INSTALL_EXPORT_SET cugraph-exports
CPM_ARGS
EXCLUDE_FROM_ALL TRUE
GIT_REPOSITORY https://github.com/${PKG_FORK}/raft.git
GIT_TAG ${PKG_PINNED_TAG}
SOURCE_SUBDIR cpp
OPTIONS
"RAFT_COMPILE_LIBRARIES OFF"
"BUILD_TESTS OFF"
"BUILD_BENCH OFF"
"RAFT_ENABLE_cuco_DEPENDENCY OFF"
)

if(raft_ADDED)
Expand All @@ -53,8 +55,8 @@ endfunction()
# To use a different RAFT locally, set the CMake variable
# 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}
FORK cjnolet
PINNED_TAG build_2206_cuco_distance_component

# When PINNED_TAG above doesn't match cugraph,
# force local raft clone in build directory
Expand Down

0 comments on commit eae7795

Please sign in to comment.