Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes a CMake configuration failure when using RAFT's build dir as the package root, e.g.:
CMake fails with this mysterious error:
However the problem isn't
mdspan
.The error occurs when raft-dependencies.cmake tries and fails to find libcudacxx:
The cause of the failure is this:
CMakeLists.txt
addscuco
before addinglibcudacxx
(here)cuco
is added to theraft-distance-exports
export set (here)libcudacxx
, because it was declared beforelibcudacxx
in step 1:libcudacxx
is added to theraft-exports
export set (here)libcudacxx
has already been added bycuco
in step 2, afind_dependency(libcudacxx)
call (not aCPMFindPackage
call) is recorded inraft-dependencies.cmake
When someone uses the raft build dir as the package root, CMake runs
raft-dependencies.cmake
beforeraft-distance-dependencies.cmake
.raft-dependencies.cmake
fails atfind_dependency(libcudacxx)
, because theCPMFindPackage("NAME;cuco;...)
call that is expected to introducelibcudacxx
hasn't been executed yet.Alternative fix
There are two other possible fixes aside from the one in this PR:
CMakeLists.txt
.libcudacxx
BUILD_EXPORT_SET
andINSTALL_EXPORT_SET
toraft-distance-exports
sofind_dependency(libcudacxx)
is recorded inraft-distance-dependencies.cmake
aftercuco
(and cuco'slibcudacxx
dependency) has been found.I didn't see any references to
<cuda/std/...>
in RAFT itself, so the cleanest option is to delete RAFT'sget_libcudacxx.cmake
.