Issue with loading MUMPS plugin in FreeFEM (develop branch) on macOS Apple Silicon after PETSc build

Dear FreeFEM Development Team,
I am writing to report an issue I’m encountering with loading the MUMPS plugin in FreeFEM on my macOS Apple Silicon system.
I have followed the official compilation guide and, per previous advice (from Pierre Jolivet regarding CMake compatibility), I switched to the develop branch of FreeFEM to use PETSc 3.23.2, which should be compatible with my CMake 4.0.2.
Summary of my installation process:

  1. Cleaned previous attempts.
  2. Cloned FreeFem-sources, checked out the develop branch, and ran autoreconf -i.
  3. Ran a basic FreeFEM ./configure for the main program.
  4. Successfully ran make petsc-slepc in the 3rdparty/ff-petsc/ directory. This step downloaded and compiled PETSc 3.23.2 and its dependencies (including MUMPS, METIS, ParMETIS, SLEPc, HPDDM, etc.). The PETSc make check within its own build directory (petsc-3.23.2/ARCH_NAME/) passed successfully.
  5. Returned to the FreeFEM root directory, ran ./configure (or ./reconfigure) for FreeFEM, which seemed to complete.
  6. Ran make -j8 and sudo make install for FreeFEM, which also seemed to complete, installing files to /Users/zhangpingrui/my_freefem_install/.
  7. I can successfully run FreeFem++-mpi and it reports version 4.15 (git v4.15-66-gf2864243).

The Issue:
When I try to run example scripts that explicitly load the MUMPS plugin, such as testsolver_MUMPS.edp (which contains load "MUMPS_mpi" or load "MUMPS_FreeFem"), the script fails with a load error.
Here is the terminal output when trying to run testsolver_MUMPS.edp (this specific example tries to load "MUMPS_mpi"):
`zhangpingrui@zhangpingruideMacBook-Air mpi % ff-mpirun -np 4 testsolver_MUMPS.edp
‘/opt/homebrew/bin/mpiexec’ -np 4 /Users/zhangpingrui/my_freefem_install/bin/FreeFem+±mpi -nw ‘testsolver_MUMPS.edp’
– FreeFem++ v4.15 (2025年 5月15日 星期四 15时29分56秒 CST - git v4.15-66-gf2864243)
file : testsolver_MUMPS.edp
Load: lg_fem lg_mesh lg_mesh3 eigenvalue parallelempi
1 : // run with MPI: ff-mpirun -np 4 script.edp
2 : // NBPROC 4
3 :
4 : load “MUMPS_mpi” current line = 4 mpirank 1 / 4
current line = 4 mpirank 3 / 4
current line = 4 mpirank 2 / 4

Load error: MUMPS_mpi
fail:
dlerror : dlopen(../../plugin/seq/MUMPS_mpi.dylib, 0x0002): tried: ‘../../plugin/seq/MUMPS_mpi.dylib’ (no such file), ‘/System/Volumes/Preboot/Cryptexes/OS../../plugin/seq/MUMPS_mpi.dylib’ (no such file), ‘/Users/zhangpingrui/my_freefem_install/ff-petsc/r/lib/../../plugin/seq/MUMPS_mpi.dylib’ (no such file), ‘/System/Volumes/Preboot/Cryptexes/OS/Users/zhangpingrui/my_freefem_install/ff-petsc/r/lib/../../plugin/seq/MUMPS_mpi.dylib’ (no such file), ‘/Users/zhangpingrui/my_freefem_install/ff-petsc/r/lib/../../plugin/seq/MUMPS_mpi.dylib’ (no such file), ‘/System/Volumes/Preboot/Cryptexes/OS/Users/zhangpingrui/my_freefem_install/ff-petsc/r/lib/../../plugin/seq/MUMPS_mpi.dylib’ (no such file), ‘/usr/lib/../../plugin/seq/MUMPS_mpi.dylib’ (no such file, not in dyld cache), ‘../../plugin/seq/MUMPS_mpi.dylib’ (no such file), ‘/Users/zhangpingrui/FreeFem-sources/plugin/seq/MUMPS_mpi.dylib’ (no such file), ‘/System/Volumes/Preboot/Cryptexes/OS/Users/zhangpingrui/FreeFem-sources/plugin/seq/MUMPS_mpi.dylib’ (no such file), ‘/Users/zhangpingrui/FreeFem-sources/plugin/seq/MUMPS_mpi.dylib’ (no such file)
list prefix: ‘../../plugin/mpi/’ ‘’ ‘../../plugin/seq/’ list suffix: ‘’ , ‘.dylib’
current line = 4 mpirank 0 / 4
Load error : MUMPS_mpi
line number :4, MUMPS_mpi
error Load error : MUMPS_mpi
line number :4, MUMPS_mpi
code = 2 mpirank: 0Another example script usingload "MUMPS_FreeFem"shows a similardlopenerror forMUMPS_FreeFem.dylib`.)*

This suggests that the MUMPS_mpi.dylib (or MUMPS_FreeFem.dylib) plugin was not correctly built or installed by FreeFEM, or it cannot be found at runtime, despite PETSc (which should provide MUMPS via the --download-mumps option used during its configuration) appearing to build and check successfully.

I have checked my PETSc configure.log and it indicates that MUMPS was configured for download. I also have the make all log for PETSc.

My System Environment Details:

  • OS: macOS Apple Silicon (arm64), version appears to be macOS 15.4.1.
  • FreeFEM: develop branch (git v4.15-66-gf2864243 as of May 15, 2025).
  • PETSc: 3.23.2 (built by FreeFEM’s make petsc-slepc).
  • MPI: MPICH 4.3.0 (from Homebrew).
  • Compilers: Apple Clang 17.0.0 (for C/C++ via MPICH wrappers), GNU Fortran 14.2.0_1 (for Fortran via MPICH wrapper).
  • CMake: 4.0.2 (from Homebrew).
  • FreeFEM Installation Prefix: /Users/zhangpingrui/my_freefem_install/
  • Environment Variables: PATH and DYLD_LIBRARY_PATH have been updated to include /Users/zhangpingrui/my_freefem_install/bin and /Users/zhangpingrui/my_freefem_install/lib/ff++/4.15/lib (and /mpi subfolder) respectively.

Could you please provide some guidance on why the MUMPS plugin might not be loading correctly and what steps I can take to resolve this? Is there a specific way to check if PETSc’s MUMPS was successfully built and made available to FreeFEM, and how to ensure FreeFEM builds its MUMPS interface plugin? I also noticed some warnings about “missing mpi plugin” and “MISSING lib fftw3” during the main FreeFEM make install, which I can provide more details on if they are relevant.

Thank you for your continued support.

Sincerely,
Pingrui

If you do make check in the FreeFem-sources/examples/hpddm folder, what is the output, please?

Hi Pierre,
Thanks again for your guidance! As you suggested, I ran make check in the FreeFem-sources/examples/hpddm directory after successfully completing the make petsc-slepc step on the develop branch.
The results are very positive: