-
Notifications
You must be signed in to change notification settings - Fork 188
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]: CCCL_INCLUDE_DIR
variables incorrect in CMake output
#526
Comments
Hi @cliffburdick! Thanks for submitting this issue - the CCCL team has been notified and we'll get back to you as soon as we can! |
@allisonvacanti or @robertmaynard could you take a look at this? I believe this is a result of the fact that we have to include CCCL headers as user includes instead of system includes. |
This is strange -- we don't define Since there aren't any CCCL headers, there is no CCCL include path, and you can just omit that from your targets. I believe this can be closed as NAB -- will that work for you, @cliffburdick? |
I think it's likely CPM. Do you think CCCL should export some variables people can use? The way I have it right now is a bit clunky since I'm hard-coding all the things CCCL includes, but if it ever adds another library I have to modify my CMakeLists. Maybe it should create a string that people can use? |
I'd be supportive of this. Obviously, the ideal solution would be to just use the Can |
I think you can provide |
CPM does not set any variables with the pattern Likewise variables like While CCCL could provide a |
@robertmaynard what is the recommendation for projects that follow a stricter set of warnings than CCCL and therefor cannot use their targets? |
By default all
So to workaround the above issues the CCCL have functions like The most consistent way to remove these warnings would be to patch CCCL ( maybe with the gcc pragma that says that this is a system header ). You could also look into futzing around with SYSTEM include order ( specifically Note: |
To summarize, the reason @cliffburdick wants to add CCCL headers As @robertmaynard mentioned, there are complex reasons with the way However, while looking into this issue, I've found that there is another solution to ensuring CCCL headers don't emit warnings that does not require using This would mean users like @cliffburdick could just link against the @cliffburdick if you agree, then I think we could close this issue as "Not Planned" and defer to #527 as the solution to the problem you ultimately care about. |
Yes, thanks. |
Is this a duplicate?
Type of Bug
Something else
Component
Not sure
Describe the bug
When adding CCCL through CPM the following variables are created:
Notably projects that have stricter warnings than CCCL projects enabled cannot use:
target_link_libraries(your_executable PRIVATE CCCL::CCCL)
as suggested here because
target_link_libraries
does not allow aSYSTEM
modifier for a transitive target. Instead, we must use the variables created above manually. The problem is thatCCCL_INCLUDE_DIR
should be an absolute path pointing to where CCCL resides. You can see in the output above/include
is wrong, soCCCL_INCLUDE_DIR
cannot be used. Instead as a workaround we have to do something like:How to Reproduce
Follow the example CMake instructions and print the variables:
https://github.com/NVIDIA/cccl/tree/main/examples/example_project
Expected behavior
In the example above
CCCL_INCLUDE_DIR
should be:$<BUILD_INTERFACE:${CCCL_SOURCE_DIR}/
Reproduction link
No response
Operating System
No response
nvidia-smi output
No response
NVCC version
No response
The text was updated successfully, but these errors were encountered: