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

Fix errors when find_package(CCCL) is called twice. #1157

Merged
merged 1 commit into from
Nov 28, 2023

Conversation

alliepiper
Copy link
Collaborator

Fixes #1156.

Description

When calling find_package(CCCL) a second time, a missing TARGET keyword in a CMake conditional caused the CCCL::Thrust target to be added twice.

This corrects the issue and extends our cmake package tests to call find_package twice.

Checklist

  • New or existing tests cover these changes.

@miscco miscco added backport branch/2.3.x For backporting to the 2.3.x release branch thrust For all items related to Thrust. bug Something isn't working right. infrastructure Shared CMake, github, etc infrastructure labels Nov 28, 2023
@jrhemstad jrhemstad merged commit bc4f2e3 into NVIDIA:main Nov 28, 2023
517 checks passed
Copy link
Contributor

GitHub Actions is not permitted to create or approve pull requests.

@alliepiper alliepiper deleted the fix_double_find_package_CCCL/1156 branch November 29, 2023 16:48
rapids-bot bot pushed a commit to rapidsai/rapids-cmake that referenced this pull request Dec 14, 2023
CCCL's CMake is currently set up to exit early whenever it's added via `add_subdirectory`, which inadvertently prevents the install rules of its components (Thrust/CUB/libcudacxx) from being called. We don't currently have a way to tell CCCL not to do this because preventing that early exit leads to other undesirable outcomes (such as the CCCL::CCCL targets not being created correctly). Therefore, to work around this we must include the various install rule modules directly until this can be fixed upstream in CCCL.

In addition, we require a couple of patches to CCCL's CMake so that 1) the correct config files are installed, and 2) so that multiple invocations of `find_package(CCCL)` will work. These patches have already been fixed on the latest CCCL, see NVIDIA/cccl#298 and NVIDIA/cccl#1157.

Authors:
  - Vyas Ramasubramani (https://github.com/vyasr)

Approvers:
  - Bradley Dice (https://github.com/bdice)

URL: #505
miscco pushed a commit to miscco/cccl that referenced this pull request Jan 18, 2024
jrhemstad added a commit that referenced this pull request Jan 22, 2024
Fixes #1156.

Co-authored-by: Allison Vacanti <[email protected]>
Co-authored-by: Jake Hemstad <[email protected]>
@miscco miscco added backport done This PR has been backported to the relevant branch and removed backport branch/2.3.x For backporting to the 2.3.x release branch labels Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport done This PR has been backported to the relevant branch bug Something isn't working right. infrastructure Shared CMake, github, etc infrastructure thrust For all items related to Thrust.
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

[BUG]: find_package(CCCL) cannot be called twice
3 participants