PETSc error on Ubuntu 20.04 (WSL2)

Hi to everyone,

I have Windows 11 system and also WSL2. Now, i want to use FreeFem in WSL2 (Ubuntu) to execute some softwares, but I don’t know why I have problems with PETSc.
In Windows it works without problems, but when i run for example:
ff-mpirun -np 4 heat-2d-PETSC.edp

The output is:
ff-mpirun -np 4 heat-2d-PETSC.edp
‘/usr/bin/mpiexec’ -np 4 /usr/local/bin/FreeFem+±mpi -nw ‘heat-2d-PETSC.edp’
[LAPTOP-V20KJ0G9:01388] *** Process received signal ***
[LAPTOP-V20KJ0G9:01388] Signal: Segmentation fault (11)
[LAPTOP-V20KJ0G9:01388] Signal code: Address not mapped (1)
[LAPTOP-V20KJ0G9:01388] Failing at address: (nil)
[LAPTOP-V20KJ0G9:01388] [ 0] /lib/x86_64-linux-gnu/libc.so.6(+0x43090)[0x7faeb4565090]
[LAPTOP-V20KJ0G9:01388] *** End of error message ***
/usr/local/bin/ff-mpirun: line 46: 1388 Segmentation fault ‘/usr/bin/mpiexec’ -np 4 /usr/local/bin/FreeFem+±mpi -nw ‘heat-2d-PETSC.edp’

If i try to run a script that only says 'load “PETSc” ’ , doing FreeFem+±mpi
I get:
– FreeFem++ v4.1 (Thu Dec 16 11:57:44 CET 2021 - git v4.10)
file : test.edp
Load: lg_fem lg_mesh lg_mesh3 eigenvalue parallelempi
1 : load “PETSc”
Load error: PETSc
fail:
dlerror : /lib/x86_64-linux-gnu/libmpi_mpifh.so.40: undefined symbol: mpi_conversion_fn_null_
list prefix: ‘/usr/lib/freefem++/’ ‘./’ ‘/usr/local/lib/ff++/4.10/lib/mpi/’ list suffix: ‘’ , ‘.so’
current line = 1 mpirank 0 / 1
Load error : PETSc
line number :1, PETSc
error Load error : PETSc
line number :1, PETSc
code = 2 mpirank: 0

Any idea where this error come from? Thanks in advance,
Rodrigo

Under unix use

ff-mpirun -np 4 ‘heat-2d-PETSC.edp’

to launch freefem+±mpi (I think you use a bad mpi lib).

1 Like

Thanks for your answer @frederichecht, but it didn’t work, same error as before

ff-mpirun -np 4 ‘heat-2d-PETSc.edp’
‘/usr/bin/mpiexec’ -np 4 /usr/local/bin/FreeFem+±mpi -nw ‘heat-2d-PETSc.edp’
[LAPTOP-V20KJ0G9:00690] *** Process received signal ***
[LAPTOP-V20KJ0G9:00690] Signal: Segmentation fault (11)
[LAPTOP-V20KJ0G9:00690] Signal code: Address not mapped (1)
[LAPTOP-V20KJ0G9:00690] Failing at address: (nil)
[LAPTOP-V20KJ0G9:00690] [ 0] /lib/x86_64-linux-gnu/libc.so.6(+0x43090)[0x7f2d3dcfc090]
[LAPTOP-V20KJ0G9:00690] *** End of error message ***
/usr/local/bin/ff-mpirun: line 46: 690 Segmentation fault ‘/usr/bin/mpiexec’ -np 4 /usr/local/bin/FreeFem+±mpi -nw ‘heat-2d-PETSc.edp’

Bonne journée,
Rodrigo

Can you tray a basic exemple with 4 proc svp.

essai.edp (4.09 KB)

dlerror : /lib/x86_64-linux-gnu/libmpi_mpifh.so.40: undefined symbol: mpi_conversion_fn_null_

My guts tell me that you are using one MPI for FreeFem++-mpi, and another for PETSc. Could you please share your config.log and 3rdparty/ff-petsc/petsc-3.XY.Z/fr/lib/petsc/conf/configure.log?

Very thanks for your answers and your help to the FreeFem enthusiasts!

It didnt goork the file essai.edp (same error), so finally I installed ubuntu (dual) and FreeFem again. I think that it was the problem that says @prj, and i did something wrong in the compilation of source code.

It works very well now!