Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New cmake infrastructure #43

Closed
27 of 28 tasks
jrhemstad opened this issue Apr 20, 2023 · 2 comments · Fixed by #112
Closed
27 of 28 tasks

New cmake infrastructure #43

jrhemstad opened this issue Apr 20, 2023 · 2 comments · Fixed by #112
Assignees
Labels
infrastructure Shared CMake, github, etc infrastructure

Comments

@jrhemstad
Copy link
Collaborator

jrhemstad commented Apr 20, 2023

General

  • Bump minimum CMake version for developer build to 3.21. Enables cmake_path and other QoL fixes. Does not affect user packages (CPM, find_package, and add_subdirectory usecases are unaffected and remain at 3.15).
  • Write CCCL monorepo top layer CMakeLists.txt.
  • Update subproject minimum CMake version for developer builds.
  • Enable TOPLEVEL subproject logic when using when included from CCCL monorepo builds.
  • Verify/update subproject install rules.
  • Verify/update subproject CMake package configs.
  • Update user docs to reflect changes to configuration options.

Use native CMake support for CUDA:

  • Remove nvc++ hacks from Thrust/CUB CMake implementation
  • Rewrite architecture logic to use CMAKE_CUDA_ARCHITECTURES instead of per-arch boolean options.
  • Update logic for setting architectures on RDC vs non-RDC builds.
  • Set CUDA architecture and RDC state using per-target properties, rather than directory-wide modifications to CMAKE_CUDA_FLAGS.
  • Replace the existing RDC enable/disable options with ${PROJ}_ENABLE_RDC_TESTS (enables tests/examples that require RDC) and ${PROJ}_FORCE_RDC (Enable RDC for all targets, except those that explicit test RDC=off).

CMake Package Implementation

  • Create cccl-config.cmake and cccl-config-version.cmake in ${CCCL_SOURCE_DIR}/share/cmake/cccl/
  • Implement semantic version checks.
  • Install the CCCL CMake package to ${CMAKE_INSTALL_LIBDIR}/cmake/cccl
  • find_package(CCCL) finds all subprojects using existing subproject infrastructure.
  • find_package(CCCL COMPONENTS [Thrust] [CUB] [libcudacxx]) only loads requested components and their dependencies using existing subproject infrastructure.
  • add_subdirectory(${CCCL_SOURCE_DIR}) is effectively identical to find_package(CCCL) for users.
  • CCCL_REQUIRED_COMPONENTS and CCCL_OPTIONAL_COMPONENTS variables equivalent to the COMPONENT options in find_package.
  • add_subdirectory will continue to work directly on subproject directories (i.e. add_subdirectory(${CCCL_SOURCE_DIR}/thrust) is equivalent to find_package(CCCL COMPONENT Thrust)). This will reuse existing infrastructure.
  • find_package(Thrust|CUB|libcudacxx) will continue to work using existing infrastructure.

CMake Package Testing

  • Add automated tests for validating find_package(CCCL [COMPONENTS Thrust|CUB|libcudacxx]) for both installed CCCL and the source repo.
  • Add automated tests for validating find_package(Thrust|CUB|libcudacxx) for both installed CCCL and the source repo.
  • Add automated tests for validating add_subdirectory usecase for CCCL and all subprojects, source tree only.
  • Add automated tests for validating the CCCL_(REQUIRED|OPTIONAL)_COMPONENTS options for add_subdirectory.

Next Steps

After the monorepo is in place, the following tasks are worth considering:

  • Explore costs/benefits of using rapids-cmake across all projects.
  • Move shared infra to the CCCL repo (Thrust/CUB have a lot of redundant CMake infra).
  • Move Thrust/CUB/libcudacxx cmake packages into the same location as the CCCL package.
  • Further CDP/RDC cleanup -- FORCE_RDC should be able to build with RDC on all arches, but the CDP tests require restricted arches. This will also involve updating our CUDA/C++ implementations.

Thrust

Tasks

  • Update libcudacxx dependency to always require the same version as CUB
@jrhemstad jrhemstad added this to CCCL Apr 20, 2023
@jarmak-nv jarmak-nv moved this to Todo in CCCL Apr 24, 2023
@alliepiper alliepiper added the infrastructure Shared CMake, github, etc infrastructure label Apr 26, 2023
@jrhemstad jrhemstad moved this from Todo to In Progress in CCCL Apr 26, 2023
@alliepiper alliepiper linked a pull request May 16, 2023 that will close this issue
@jrhemstad jrhemstad linked a pull request Jun 28, 2023 that will close this issue
@jrhemstad jrhemstad moved this from In Progress to In Review in CCCL Jun 28, 2023
@alliepiper
Copy link
Collaborator

Adding to current sprint -- some lingering low-priority review comments need to be updated.

@github-project-automation github-project-automation bot moved this from In Review to Done in CCCL Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infrastructure Shared CMake, github, etc infrastructure
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants