-
Notifications
You must be signed in to change notification settings - Fork 758
Allow Thrust and CUB headers to be nested in a custom directory #1541
Comments
I think I am running into the same issue when compiling my project on Windows. My workflow fetches https://github.com/gunrock/essentials/blob/master/cmake/FetchThrustCUB.cmake#L21-L22
And then finally, I link to those includes for my project; https://github.com/gunrock/essentials/blob/master/CMakeLists.txt#L89-L92
Now, the first complaint on windows was (full log)
Which, I think it is trying to link an incorrect CUB version. What's weird is my actions is trying to compile with the latest cuda version, which I thought would mean equivalent latest thrust/cub versions, but I guess that is not a thing. I tried fixing it by defining
but now, I see: (full log)
|
This is likely the main issue -- that For cross-platform projects, the CUB include path should be That said...there is a better way :)
We have CMake packages that provide easier ways to use Thrust and CUB from other CMake projects. See this file for details. If you configure a Thrust target to use CUDA using You may also want to look into the CMakePackageManager, which provides a nicer interface around
The version of Thrust/CUB shipped with CTK is usually a couple of versions behind what's available on Github. You can find out which version of Thrust/CUB is in your CTK by referencing this table.
This is unlikely to work reliably. Thrust and CUB are tightly coupled these days, and different versions of the libraries are often incompatible with each other. Your best bet is to use the CMake packages -- those are configured to avoid most of these issues. |
Sweet, thank you for the resources! That solved my issue. |
RAPIDS recently ran into a bug where the Thrust headers from a custom install were hidden by the Thrust headers in CTK, despite following the usual advice of including non-CTK Thrust headers with
-I
to override the implicit-isystem <CTK_INCLUDE_PATH>
.This is due to the custom include prefix being used by multiple projects, some of which are
-isystem
, and apparently compilers will use-isystem
when the same path is specified with both-I
and-isystem
. A more detailed description of the issue is in rapidsai/rapids-cmake#98.Currently, rapids-cmake is working around this by reproducing a copy our install rules, adjusted so that thrust/cub headers are installed to
<prefix>/include/thrust/thrust
and<prefix>/include/cub/cub
.We should provide a more robust solution, since it's likely that other users will also encounter this issue, and I don't want to break rapids if our install rules change. We should add some CMake variables to specify this extra directory, something like
THRUST_INSTALL_HEADER_INFIX=thrust
andCUB_INSTALL_HEADER_INFIX=cub
, or something similar (I'm not sure if there's a more idiomatic way to say "infix" in CMake).The text was updated successfully, but these errors were encountered: