-
Notifications
You must be signed in to change notification settings - Fork 374
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
Cleanup petsc cmake stuff #5959
Conversation
Cleanup petsc cmake stuff Also remove a lot of unused stuff. [BFB] * jgfouca/cmake_petsc: Cleanup petsc cmake stuff
endif() | ||
if (COMP_NAME STREQUAL "elm") | ||
if (USE_PETSC) | ||
target_link_libraries(${TARGET_NAME} PRIVATE "${PETSC_LIBRARIES}") |
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.
Does find_package(PETSc REQUIRED)
not import PETSc targets? Does it simply provide PETSC_LIBRARIES
and PETSC_INCLUDES
? :/
Would be nicer to simply link targets, and avoid having to take care of libs and include dirs manually...
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.
@bartgol , unfortunately I think the answer is yes. The Petsc-find.cmake was written many years ago.
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.
@jgfouca -- I've also been testing a more recent version of find_petsc and I'm pretty sure we could move to that as well. If that's any improvement....
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.
@jonbob , that would be great. We have a few of them lying around our repos:
./components/elm/src/external_models/mpp/cmake/Modules/FindPETSc.cmake
./components/elm/src/external_models/emi/src/cmake/Modules/FindPETSc.cmake
./cime/CIME/non_py/src/CMake/FindPETSc.cmake
Would be nice to agree on one location and update it.
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.
I'll make sure the one I've been testing is the updated one and let you know. And I always end up using the cime/CIME location, since the mpas build finds it
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.
Looks good. I had a comment on how we link petsc, but either way, it's fine.
Also remove a lot of unused stuff.
[BFB]