diff --git a/README.md b/README.md index 34545c27e..e1d78458f 100644 --- a/README.md +++ b/README.md @@ -137,7 +137,7 @@ Done! You are ready to develop for the RMM OSS project. ### Caching third-party dependencies -RMM uses [CPM.cmake](https://github.com/TheLartians/CPM.cmake) to +RMM uses [CPM.cmake](https://github.com/cpm-cmake/CPM.cmake) to handle third-party dependencies like spdlog, Thrust, GoogleTest, GoogleBenchmark. In general you won't have to worry about it. If CMake finds an appropriate version on your system, it uses it (you can @@ -157,7 +157,7 @@ integrate RMM into your own CMake project. In your `CMakeLists.txt`, just add ```cmake find_package(rmm [VERSION]) # ... -target_link_libraries( (PRIVATE|PUBLIC) rmm::rmm) +target_link_libraries( (PRIVATE|PUBLIC|INTERFACE) rmm::rmm) ``` Since RMM is a header-only library, this does not actually link RMM, @@ -172,6 +172,27 @@ Thrust. If you want to customize it, you can set the variables `THRUST_HOST_SYSTEM` and `THRUST_DEVICE_SYSTEM`; see [Thrust's CMake documentation](https://github.com/NVIDIA/cccl/blob/main/thrust/thrust/cmake/README.md). +### Using CPM to manage RMM + +RMM uses [CPM.cmake](https://github.com/cpm-cmake/CPM.cmake) to manage +its dependencies, including [CCCL](https://github.com/nvidia/cccl), and you can +use CPM for your project's dependency on RMM. + +There is an issue with using CPM's *single-argument compact syntax* for +RMM/CCCL as it transitively marks targets as `SYSTEM` dependencies. +This causes the CCCL headers pulled in through CPM to be of lower priority +to the preprocessor than the (potentially outdated) CCCL headers provided +by the CUDA SDK. To avoid this issue, use CPM's *multi-argument syntax* +instead: + +```cmake +CPMAddPackage(NAME rmm [VERSION] + GITHUB_REPOSITORY rapidsai/rmm + SYSTEM Off) +# ... +target_link_libraries( (PRIVATE|PUBLIC|INTERFACE) rmm::rmm) +``` + # Using RMM in C++ The first goal of RMM is to provide a common interface for device and host memory allocation.