Skip to content
This repository was archived by the owner on Mar 21, 2024. It is now read-only.

Provide proper CMake module support #209

Closed
harrism opened this issue Oct 12, 2021 · 1 comment · Fixed by #242
Closed

Provide proper CMake module support #209

harrism opened this issue Oct 12, 2021 · 1 comment · Fixed by #242

Comments

@harrism
Copy link
Collaborator

harrism commented Oct 12, 2021

Prompted by discussion in rapidsai/rmm: rapidsai/rmm#883 (review)

Projects that use RMM along with other libraries that depend on libcudacxx can end up with multiple installs of libcudacxx. Proper cmake module support can avoid this problem and make the library easier to depend on for CMake projects.

I'm not an expert on CMake module support, so I'm not exactly sure what work this entails. CC @robertmaynard

@alliepiper
Copy link
Collaborator

It's going to be tricky to figure out how libcudacxx will fit in with CMake's FindCUDAToolkit:

For instance, what namespace should libcu++'s exported targets live in? Should they be CUDA::libcudacxx, like the FindCUDAToolkit targets? Or libcudacxx::libcudacxx like a standalone project?


There are also many issues with being both standalone and a CTK project, mainly due to the implicit inclusion of ${CTK_PREFIX}/include. By default, the include directories of IMPORTED CMake targets are added with -isystem, which is checked after the implicit CTK include path during lookup.

It's possible to work around this. Thrust/CUB do some nasty hacks, and CMake is adding a property to allow IMPORTED targets to use -I in the next version. There are also more subtle issues that can make life difficult for users caused by this include.

We may want to consider moving CCCL headers from ${CTK_PREFIX}/include to ${CTK_PREFIX}/include/${project}. It would make life much easier for standalone users. CTK users would have to add an extra include dir, and maybe we could ask for an -ictk option (e.g. nvcc -ictk=libcudacxx == nvcc -isystem=${CTK_PREFIX}/include/libcudacxx) to simplify things for users.

@alliepiper alliepiper linked a pull request Feb 7, 2022 that will close this issue
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants