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

Utilize MFEM's petsc/ slepc wrappers #1138

Merged
merged 48 commits into from
Jul 1, 2024

Conversation

chapman39
Copy link
Contributor

@chapman39 chapman39 commented Jun 12, 2024

  • Let MFEM manage petsc/ slepc TPLs
  • Build MFEM with petsc/ slepc wrappers
  • Change smoke tests to use MFEM's examples instead

@chapman39 chapman39 added build Build system TPL Third-party libraries labels Jun 12, 2024
@chapman39 chapman39 self-assigned this Jun 12, 2024
src/tests/CMakeLists.txt Outdated Show resolved Hide resolved
@chapman39 chapman39 changed the title WIP: Utilize MFEM's petsc/ slepc wrappers Utilize MFEM's petsc/ slepc wrappers Jun 27, 2024
Copy link
Contributor

@zatkins-work zatkins-work 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 to me! I'm building now to make sure it all builds locally.

scripts/spack/packages/serac/package.py Show resolved Hide resolved
src/tests/mfem_petsc_smoketest.cpp Show resolved Hide resolved
src/tests/mfem_petsc_smoketest.cpp Show resolved Hide resolved
src/tests/mfem_petsc_smoketest.cpp Outdated Show resolved Hide resolved
@chapman39

This comment was marked as outdated.


foreach(_lib_dir ${ARPACK_DIR}/lib;${ARPACK_DIR}/lib64)
if (EXISTS ${_lib_dir})
set(ARPACK_LIBRARIES "${_lib_dir}/libparpack.so")
Copy link
Contributor

Choose a reason for hiding this comment

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

This line is an issue for MacOS builds -- I need set(ARPACK_LIBRARIES "${_lib_dir}/libparpack.dylib")

Copy link
Contributor

Choose a reason for hiding this comment

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

Can we not use the pkgconfig files generated by ARPACK?

Copy link
Contributor

Choose a reason for hiding this comment

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

Other than this minor issue, this builds fine locally!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, good point.

Copy link
Contributor Author

@chapman39 chapman39 Jul 1, 2024

Choose a reason for hiding this comment

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

@zatkins-work Let me know if my recent changes resolves your build issues on mac

Copy link
Member

@white238 white238 Jul 1, 2024

Choose a reason for hiding this comment

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

You should be using find_library:

https://cmake.org/cmake/help/latest/command/find_library.html

This will toggle lib and lib64 and the file extension as well:

find_library(_arpack_library parpack PATHS ${ARPACK_DIR}/lib)

Copy link
Member

Choose a reason for hiding this comment

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

You should also search for a specific header so you know that the installation works. Here is an example:

https://github.com/LLNL/axom/blob/develop/src/cmake/thirdparty/FindC2C.cmake

Copy link
Contributor Author

Choose a reason for hiding this comment

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

just fixed that, thanks

@chapman39 chapman39 marked this pull request as ready for review July 1, 2024 20:42
#------------------------------------------------------------------------------
# SLEPc
#------------------------------------------------------------------------------
if (SLEPC_DIR AND SERAC_USE_PETSC)
Copy link
Member

Choose a reason for hiding this comment

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

Should this also be inside of the if(PETSC_DIR) section like below?

Copy link
Member

Choose a reason for hiding this comment

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

I guess that is what the SERAC_USE_PETSC does...

# List of MFEM dependencies, that require the *_LIB variable to be non-empty
MFEM_REQ_LIB_DEPS = ENZYME SUPERLU MUMPS METIS FMS CONDUIT SIDRE LAPACK SUNDIALS\
- SUITESPARSE STRUMPACK GINKGO GNUTLS NETCDF PETSC SLEPC MPFR PUMI HIOP\
+ SUITESPARSE STRUMPACK GINKGO GNUTLS NETCDF SLEPC PETSC MPFR PUMI HIOP\
Copy link
Member

Choose a reason for hiding this comment

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

Does this need to go into spack or mfem?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

MFEM. I have a PR for it here mfem/mfem#4363

@@ -204,6 +206,8 @@ class Serac(CachedCMakePackage, CudaPackage):
# Conflicts
#

conflicts("~petsc", when="+slepc", msg="PETSc must be built when building with SLEPc!")
Copy link
Member

Choose a reason for hiding this comment

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

👍

@chapman39 chapman39 enabled auto-merge July 1, 2024 21:53
@chapman39 chapman39 merged commit 8355ddb into develop Jul 1, 2024
2 checks passed
@chapman39 chapman39 deleted the feature/chapman39/mfem-petsc-wrapper branch July 2, 2024 00:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Build system TPL Third-party libraries
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants