CUDA CCCL integration

I recently tried to upgrade my CUDA version from 12.8.0 to 13.1 (then dropped back to 12.9.1). Apparently I’ve been hit by the upgrade to the CCCL. My immediate symptom is that <thrust/xxx> is no longer found.

At the same time, I downgraded CMake to 3.26.5, since a package was available for RHEL9. If this is fixed in a later version, I can upgrade.

As usual, CUDA code compiled by nvcc builds just fine, but C++ code built by the native compiler (in my case g++ 13.3.1) can’t find the thrust headers.

It seems that I need to add CCCL::CCCL as a link-library to my target, but I haven’t come across any examples of how to just use it. I don’t understand why this isn’t part of

The CCCL has an example project that talks about including CCCL as an external project; I don’t need to do that, since it is part of the CUDA Toolkit in my nvidia base image.

Can anyone (and I’m hoping @robert.maynard will read this) give me the “proper” way to add CCCL to a project that uses CUDA?

Did you read through these instructions?

I had not found those instructions, but I stumbled into most of it. The

thrust_create_target(Thrust)

part I did not do (although I found it in the Thrust cmake file; I wasn’t sure what to do with it). That was the ticket. Thanks!

Also see the CCCL migration guide: CCCL 2.x ‐ CCCL 3.0 migration guide — CUDA Core Compute Libraries

I did see that, but it was missing the critical README buried down in cmake/lib/thrust (I poked around that tree and that’s the only README down there).