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

Cleanup petsc cmake stuff #5959

Merged
merged 1 commit into from
Sep 27, 2023
Merged

Cleanup petsc cmake stuff #5959

merged 1 commit into from
Sep 27, 2023

Conversation

jgfouca
Copy link
Member

@jgfouca jgfouca commented Sep 26, 2023

Also remove a lot of unused stuff.

[BFB]

@jgfouca jgfouca added BFB PR leaves answers BFB CMake build system labels Sep 26, 2023
@jgfouca jgfouca requested a review from bartgol September 26, 2023 22:26
@jgfouca jgfouca self-assigned this Sep 26, 2023
jgfouca added a commit that referenced this pull request Sep 26, 2023
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}")
Copy link
Contributor

@bartgol bartgol Sep 26, 2023

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...

Copy link
Member Author

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.

Copy link
Contributor

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....

Copy link
Member Author

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.

Copy link
Contributor

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

Copy link
Contributor

@bartgol bartgol left a 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.

@jgfouca jgfouca merged commit 614d911 into master Sep 27, 2023
@jgfouca jgfouca deleted the jgfouca/cmake_petsc branch September 27, 2023 15:41
@jgfouca jgfouca mentioned this pull request Sep 27, 2023
49 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BFB PR leaves answers BFB CMake build system
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants