From 54102077ff3e27fa913e142ff17a2f1a82d60310 Mon Sep 17 00:00:00 2001 From: Allison Piper Date: Mon, 28 Oct 2024 22:53:01 -0400 Subject: [PATCH] Add installation presets and update README with install steps (#2643) * Don't install cudax by default. * Add installation presets and instructions to README. --- CMakePresets.json | 23 +++++++++++++++++++++++ README.md | 15 +++++++++++++++ cmake/install/cudax.cmake | 2 +- 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/CMakePresets.json b/CMakePresets.json index 8650c9b1290..083590ba533 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -28,6 +28,29 @@ "cudax_ENABLE_INSTALL_RULES": true } }, + { + "name": "install", + "displayName": "Installation / Packaging (only stable libraries)", + "inherits": "base", + "cacheVariables": { + "cudax_ENABLE_INSTALL_RULES": false + } + }, + { + "name": "install-unstable", + "displayName": "Installation / Packaging (includes experimental libraries)", + "inherits": "base" + }, + { + "name": "install-unstable-only", + "displayName": "Installation / Packaging (*only* experimental libraries)", + "inherits": "base", + "cacheVariables": { + "libcudacxx_ENABLE_INSTALL_RULES": false, + "CUB_ENABLE_INSTALL_RULES": false, + "Thrust_ENABLE_INSTALL_RULES": false + } + }, { "name": "all-dev", "inherits": "base", diff --git a/README.md b/README.md index bde08f2ac6c..6a3c6c7c596 100644 --- a/README.md +++ b/README.md @@ -138,6 +138,21 @@ nvcc -Icccl/thrust -Icccl/libcudacxx/include -Icccl/cub main.cu -o main > **Note** > Use `-I` and not `-isystem` to avoid collisions with the CCCL headers implicitly included by `nvcc` from the CUDA Toolkit. All CCCL headers use `#pragma system_header` to ensure warnings will still be silenced as if using `-isystem`, see https://github.com/NVIDIA/cccl/issues/527 for more information. +##### Installation + +A minimal build that only generates installation rules can be configured using the `install` CMake preset: +```bash +git clone https://github.com/NVIDIA/cccl.git +cd cccl +cmake --preset install -DCMAKE_INSTALL_PREFIX=/usr/local/ +cd build/install +ninja install +``` + +To include experimental libraries in the installation, use the `install-unstable` preset and build directory. + +To install **only** the experimental libraries, use the `install-unstable-only` preset and build directory. + #### Conda CCCL also provides conda packages of each release via the `conda-forge` channel: diff --git a/cmake/install/cudax.cmake b/cmake/install/cudax.cmake index 2367f070e95..63d3e980169 100644 --- a/cmake/install/cudax.cmake +++ b/cmake/install/cudax.cmake @@ -1,4 +1,4 @@ -cccl_generate_install_rules(cudax ${CCCL_TOPLEVEL_PROJECT} +cccl_generate_install_rules(cudax ${CCCL_ENABLE_CUDAX} HEADERS_SUBDIRS "include/cuda" HEADERS_INCLUDE "*.cuh" PACKAGE