Getting the petsc plugin with external petsc libs

Hi,

We have FreeFem++ installed on our HPC Clusters but it seems like the PETSc plugin is missing :
attempting to run the poisson example from the tutorial, i get the following error :
Load error : PETSc
line number :10, PETSc

Indeed, when attempting to reinstall with :
‘–with-slepc-include= -I/…/slepc-3.12.1/intel–20.0.0__openmpi–4.0.1/default/include/’
‘–with-slepc-ldflags=-L/…/slepc-3.12.1/intel–20.0.0__openmpi–4.0.1/default/lib/ -lslepc’
‘–with-petsc=/…/petsc-3.12.2/intel–20.0.0__openmpi–4.0.1/default/lib/petsc/conf/petscvariables’
‘–enable-hpddm’
‘–with-hpddm-include=-I/…/hpddm-3.14/intel–20.0.0__openmpi–4.0.1/default/include’
‘–with-hpddm-ldflags=-L/lib -lhpddm_c -lhpddm_fortran’

looking at the config.log, i get :
configure:23515: ++ add hpddm : -L/lib -lhpddm_c -lhpddm_fortran ; -I/…/hpddm-3.14/intel–20.0.0__openmpi–4.0.1/default/include in plugin/seq
[…]
configure:25642: FreeFEM used download: no
configure:25644: – Dynamic load facility: yes
configure:25646: – ARPACK (eigen value): yes
configure:25648: – UMFPACK (sparse solver): yes
configure:25650: – BLAS: yes
configure:25652: – with MPI: yes
configure:25654: – with PETSc: yes / PETSc complex: no
configure:25656: – with SLEPc: yes / SLEPc complex: no
configure:25658: – with hpddm: no
configure:25660: – with htool: no
configure:25662: – with bemtool: no (need boost: no and htool: no)
configure:25664: – without libs: tetgen mmg3d mmg parmmg mshmet gmm ipopt mumps_seq nlopt superlu umfpack yams pipe MMAP NewSolver hpddm bem
configure:25666: – without plugins: tetgen.so mmg3d-v4.0.so mmg.so parmmg.so mshmet.so aniso.so ilut.so ff-Ipopt.so MUMPS_seq.so MUMPS.so ff-NLopt.so SuperLu.so UMFPACK64.so freeyams.so pipe.so ff-mmap-semaphore.so NewSolver.so hpddm.so hpddm_substructuring.so PETSc.so function-PETSc.so SLEPc.so bem.so
configure:25670: progs: FreeFem+±nw bamg cvmsh2 FreeFem+±mpi ffmedit ffglut
configure:25866: PETSc directories do not exist, to build do:
configure:25868: cd 3rdparty/ff-petsc && make

From what i understood so far, the load “PETSc” is reffering to the PETSc plugin which cannot be built using an external install of petsc, slepc and hpddm because of how the configure.ac and resulting configure are written (the checking for the hpddm install from petsc conf sets ff_hpddm_ok, whereas the check for the hpddm install from configure options does not and happends after the discarding of the petsc plugin anyways).
Is this understanding correct or am i missing something ?
Is there a way to build freefem with the petsc plugin using pre-existing installs of these tools ?
(we might use a patched version of petsc or might have to patch it in the future and would like to avoid having another installation to manage if possible)

Best Regards
Clement

It’s definitely possible. You can see one example with proper flags there: using prebuilt PETSc when building from source? · Issue #128 · FreeFem/FreeFem-sources · GitHub.
First thing that looks suspicious is the use of relative paths instead of absolute paths.
Once you fix those, if it’s still not working, please provide the complete config.log.
If your security clearance is high enough at TGCC, I can mail the path to my installations on Irène at hotline.tgcc@cea.fr (or directly to you profil email address), you’ll simply need to pick up my config.param and ./reconfigure, I use custom PETSc installations as well.

Hi,

Thanks for the quick reply.

These are absolute paths, i just obfuscated them.
Taking a look at your install own may help a ton. Please provide username, which machine it is installed on and path to install to this account email address.

The only major difference i see between with the arguments provided in the example you link is that both petsc and petsc complex are provided. Is that necessary for building the PETSc plugin ?
Also i do provide
‘–enable-hpddm’
‘–with-hpddm-include=-I/…/hpddm-3.14/intel–20.0.0__openmpi–4.0.1/default/include’
‘–with-hpddm-ldflags=-L/lib -lhpddm_c -lhpddm_fortran’
and the logs show
configure:23515: ++ add hpddm : -L/lib -lhpddm_c -lhpddm_fortran ; -I/…/hpddm-3.14/intel–20.0.0__openmpi–4.0.1/default/include in plugin/seq
but still
configure:25658: – with hpddm: no

Providing the complete config.log requites specific clearance. I will ask for it but i’m unsure when the response will come.

I’ve sent you an email with the appropriate information.
With respect to HPDDM, there is no need to compile the libraries, in that scenario, only the headers are needed (so no need for --with-hpddm-ldflags). But without the full log, it’s though for me to understand why it’s not being picked up. I’ll try to reproduce this on my own.

I have been able to reproduce the problem. Could you add the flag --enable-download_hpddm (which in fact, will not download HPDDM but use what you provide in the option --with-hpddm-include) and see if this fixes your issue?

Yes !
It looks like it enabled both hpddm and PETSc.so.

Thanks for the help. I will come back if i encounter more issues with this installation ahah.