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

Change to use find_package(CUDAToolkit) and some other changes (trilinos/Trilinos#10954) #528

Merged

Conversation

bartlettroscoe
Copy link
Member

Description

The main purpose of this PR is to change FindTPLCUDA.cmake to use find_package(CUDAToolkit) instead of find_package(CUDA) (see trilinos/Trilinos#10954 and especially trilinos/Trilinos#10954 (comment)).

This PR also contains some come commit to address some other issues I noticed while working on this PR (related to #299).

Instructions for Reviewers

Please review each commit independently.

@bartlettroscoe bartlettroscoe added this to In Progress in TriBITS Refactor via automation Oct 3, 2022
@bartlettroscoe bartlettroscoe moved this from In Progress to In Review in TriBITS Refactor Oct 3, 2022
When find_package(<externalPkg>) uses a find module Find<exteranlPkg>.cmake
instead of a package config file <externalPkg>Config.cmake, the variable.
<externalPkg>_DIR is not set.  Therefore, it is best to not set
<externalPkg>_DIR in the TriBITS-geneated <tplName>Config.cmake file since
that is just confusing.

NOTE: The case where TriBITS a FindTPL<tplName>.cmake module calls
find_package(<externalPkg>) is the only a situation where this is the case.
When one TriBITS TPL is calling find_dependency() on an upstream TriBITS TPL,
the <upstreamDepTpl>_DIR variable is always set.
This allows configuring with:

  -D "CTEST_BUILD_FLAGS=-j<n> -k 9999999"

and having these arguments work correctly.
This is needed in order to avoid namespace classes with downstream CMake
projects that call find_package(CUDAToolkit) (e.g. like Nalu-Wind, see
trilinos/Trilinos#10954).

NOTE: This has matching changes in the downstream Trilinos TPL files
FindTPLCUBLAS.cmake and FindTPLCUSPARSE.cmake.  You can't use this updated
TriBITS version with Trilinos without those matching Trilinos
FindTPL<tplName>.cmake changes (see trilinos/Trilinos#10954).
Copy link
Collaborator

@rabartlett1972 rabartlett1972 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am going to allow this to merge so I can snapshot to Trilinos and get trilinos/Trilinos#10954 fixed. I will then set up for a post-merge review.

@bartlettroscoe bartlettroscoe merged commit 6d3bb5b into TriBITSPub:master Oct 3, 2022
TriBITS Refactor automation moved this from In Review to Done Oct 3, 2022
@bartlettroscoe bartlettroscoe moved this from Done to In Review in TriBITS Refactor Oct 3, 2022
@bartlettroscoe
Copy link
Member Author

Hello @KyleFromKitware, can you please perform a post-merge review of this PR? Please review the commits individually.

@KyleFromKitware
Copy link
Collaborator

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants