PyMFEM icon indicating copy to clipboard operation
PyMFEM copied to clipboard

Build PyMFEM against Spack MFEM install

Open mdavids-cfs opened this issue 11 months ago • 1 comments

Hi all, I was wondering if it's possible to install PyMFEM against a Spack install of MFEM? The current setup.py works pretty well for a basic build version (MPI, Hypre, METIS) but I think it would be fantastic too add a more flexible/adjustable way of installing building PyMFEM. One specific example that drove me to install MFEM using Spack (rather than a lot of manual fun with cmake) was difficulty building MFEM with MUMPS (which needs a fortran compiler), and Spack handled that really well.

So, I guess, the question would be:

  1. Is it possible to build against a Spack install, and if so is there any guidelines somewhere on this repo?
  2. If this is not possible yet, would it be worth considering?

If you say it's possible but not currently supported I may be able to take a shot at that, but wanted to hear your thoughts, if there is significant barriers to making this happen.

Thanks a bunch! Mathias

PS: This is somewhat related to https://github.com/mfem/PyMFEM/issues/36

mdavids-cfs avatar Jan 22 '25 21:01 mdavids-cfs

@mdavids-cfs I am aware that this is a slow response. I myself don't use Spack, but my previous interaction with developer indicated that Spack does not install the source code. If this is the case, it may not be so easy, since generating PyMFEM needs some of C++ codes that are not installed as a part of libmfem.so. As for using MUMPS, one could either add an option to build MFEM with MUMPS when building PyMFEM, as you suggested, or extract matrix data from HypreParMatrix and call MUMPS (or other direct solvers such as STRUMPACK, SuperLU) separately. I took the second one in other projects. So it is feasible. MFEM supports only dmumps. If your problem is complex number and want to use zmumps, the second one is the way (but it is more work)

sshiraiwa avatar Sep 18 '25 15:09 sshiraiwa