-
Notifications
You must be signed in to change notification settings - Fork 202
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG]: find_package(CCCL)
cannot be called twice
#1156
Comments
Hi @ptheywood! Thanks for submitting this issue - the CCCL team has been notified and we'll get back to you as soon as we can! |
The offending call is: cccl/thrust/thrust/cmake/thrust-config.cmake Line 183 in e79b13c
Wrapping with |
Hey @ptheywood, thanks for reaching out. I'll page our resident cmake experts to weigh in here (@allisonvacanti and @robertmaynard) |
I'll take this one. We need to check for the existence of |
The check already exists in line 74, it's just missing the
|
Fixes #1156. Co-authored-by: Allison Vacanti <[email protected]> Co-authored-by: Jake Hemstad <[email protected]>
Is this a duplicate?
Type of Bug
Something else
Component
Thrust
Describe the bug
If
find_package(CCCL)
is invoked multiple times during configuration, the second occurance will trigger a CMake Error asCCCL::Thrust
already exists, i.e. it's creation is unguarded by anif(TARGET ...)
.This occurs if the
find_package
calls are in the sameCMakeLists.txt
, or in separateCMakeLists.txt
with anadd_subdirectory(subdir)
relationship (i.e. if a dependency and a parent package both require CCCL, or if multiple targets in a parent project wish to include/link against CCCL::cccl).This occurs with the CCCL 2.2.0 distribtued with CUDA 12.2 &* 12.3, and with current
main
(e79b13c).I can work around this by guarding the
find_package
call myself, but that would rely on dependencies also guarding that call in a complex enough project. It can also be avoided by not requesting the thrust component.How to Reproduce
find_target(CCCL)
twice, with the appropriate location of CCCL on theCMAKE_PREFIX_PATH
, or setCCCL_DIR
, or provide appropriate hints.e.g. in a completley fresh directory with CUDA 12.2 or 12.3 installed
Or in a subdirectory of the
cccl
repositoryExpected behavior
Cmake should configure successfully
Reproduction link
No response
Operating System
Ubuntu Linux 22.04
nvidia-smi output
No response
NVCC version
No response
The text was updated successfully, but these errors were encountered: