CUDA Feature: Explicitly mark the cuda toolkit includes as system includes
Background:
- nvcc implicit includes for the cuda headers are done via user include ( -I ) instead of ( -isystem ).
- CMake
find_package( CONFIG)
targets mark includes as system includes - nvcc / gcc select user includes over system includes
This means that for packages such as Thrust
or libcudacxx
that are provided both from a package manager ( conda / distro ) and the CUDA Toolkit only the CUDA Toolkit version will be used.
Previously work around this issue include !6627 (merged) which allow projects to mark them selves as a user include instead of system. This fix works in isolation but fails when multiple find_package( CONFIG)
specify the same include directory. This occurs frequently with distro packages ( and conda ) where a path will be marked as non-system by Thrust, and system by another package.
Proposal:
The most robust solution is to have CMake explicitly add the nvcc implicit includes to the compile line as the last system include. This will ensure that other user includes or system includes ( find_packages
) continue to take priority.
Related Issues: