-
Notifications
You must be signed in to change notification settings - Fork 54
Make rrtmgp explicitly find kokkos #2993
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
Conversation
If an existing install of Kokkos is used, the imported target has local scope, so following calls to cmake's target_link_libraries won't recognize Kokkos if the first call to find_package was in a subdir. In EAMxx, that's the case (it's found while parsing the ekat subdir). However, subsequent calls to find_package are virtually no-op, so it doesn't hurt to call it again
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice find, thanks!
Status Flag 'Pull Request AutoTester' - Testing Jenkins Projects: Pull Request Auto Testing STARTING (click to expand)Build InformationTest Name: SCREAM_PullRequest_Autotester_Mappy
Jenkins Parameters
Build InformationTest Name: SCREAM_PullRequest_Autotester_Weaver
Jenkins Parameters
Using Repos:
Pull Request Author: bartgol |
Status Flag 'Pull Request AutoTester' - Jenkins Testing: 1 or more Jobs FAILED Note: Testing will normally be attempted again in approx. 2 Hrs. If a change to the PR source branch occurs, the testing will be attempted again on next available autotester run. Pull Request Auto Testing has FAILED (click to expand)Build InformationTest Name: SCREAM_PullRequest_Autotester_Mappy
Jenkins Parameters
Build InformationTest Name: SCREAM_PullRequest_Autotester_Weaver
Jenkins Parameters
SCREAM_PullRequest_Autotester_Mappy # 5830 FAILED (click to see last 100 lines of console output)
SCREAM_PullRequest_Autotester_Weaver # 6054 FAILED (click to see last 100 lines of console output)
|
Status Flag 'Pull Request AutoTester' - Testing Jenkins Projects: Pull Request Auto Testing STARTING (click to expand)Build InformationTest Name: SCREAM_PullRequest_Autotester_Mappy
Jenkins Parameters
Build InformationTest Name: SCREAM_PullRequest_Autotester_Weaver
Jenkins Parameters
Using Repos:
Pull Request Author: bartgol |
Status Flag 'Pull Request AutoTester' - Jenkins Testing: all Jobs PASSED Pull Request Auto Testing has PASSED (click to expand)Build InformationTest Name: SCREAM_PullRequest_Autotester_Mappy
Jenkins Parameters
Build InformationTest Name: SCREAM_PullRequest_Autotester_Weaver
Jenkins Parameters
|
Status Flag 'Pre-Merge Inspection' - - This Pull Request Requires Inspection... The code must be inspected by a member of the Team before Testing/Merging |
All Jobs Finished; status = PASSED, target_sha=5e3f6f345fc48900cb061ab123d3e4bb0e5e8f09, However Inspection must be performed before merge can occur... |
This PR fixes a nano bug that only shows if you try to use an existing Kokkos installation, by setting the env var Kokkos_ROOT.
In particular, in that case, Ekat finds the installation via find_package. But the imported target has local scope, so following calls to cmake's
target_link_libraries
won't recognize Kokkos , since the package was found while parsing the ekat subdir. Hence, we must call find_package again to make the imported target available in the current scope.Also, subsequent calls to find_package are virtually no-op (once the package was found the first time), so it doesn't even cost to call it again and again.
NOTE: there's also the option of making the imported target via find_package GLOBAL, so that CMake can use the imported target even after exiting the scope where find_package was called. However, that's conceptually wrong, imho, since it doesn't encapsulate specific needs.