It seems that the mpich or openmpi available from the ubuntu public repositories are somehow broken or hard to configure properly for the compilation. I also attempted to install from the provided .deb but I have an issue with the version of gfortran.
However everything seems to run fine if we follow these steps:
This automatically install a working mpich. Note that on my environment “–download-fblaslapack” is needed because the MUMPS of the ubuntu repository is too old and its libraries will create conflict when compiling FreeFEM.
One should need to do the same for PETSc complex and adapting to use the mpich of PETSc real
./configure --enable-download --enable-optim -with-mpi=mpich
./3rdparty/getall -a
make
sudo make install
I made a script which attempts to do all this (verified on kubuntu 20.04) which is maintained here:
I suspect it could help many ubuntu users if there would be an option to use --download-mpich of PETSc on the FreeFEM configure which would reproduce my suggestion, or if these instructions would be clearly suggested on the FreeFEM doc page.
Dear Florian,
I’ve just pushed a new commit in the develop branch so that if no MPI implementation is detected during ./configure, the flag --download-mpich will automatically be added for you when running make petsc-slepc. Then, during ./reconfigure, FreeFEM will pick up the PETSc-generated wrappers mpirun, mpic++, mpic, and mpif90 if you have Fortran installed. Having MPI installed is not a requirement anymore for using PETSc/SLEPc.
Thank you for the feature request
PS: I still do prefer and recommend to power users to have their PETSc installation on the side, like you are doing in your post, since it’s easier to update and adapt, e.g., specific downloaded libraries and such.
If we do --disable-fortran, then it is still possible to compile all third party packages ?
The -fcommon flag is needed now for the compilation of mmg with gcc10 (otherwise there are linker errors). The reason for this is explained here https://gcc.gnu.org/gcc-10/porting_to.html.
OK, I guess the Mmg error should be reported upstream, and I don’t think it would be too difficult to fix?
If you do:
$ ./configure --enable-download --prefix=~/FreeFem-install
$ cd 3rdparty/ff-petsc && make petsc-slepc
$ ./reconfigure --disable-fortran
Then, you’ll get most (not all) third party packages. The missing ones will be ARPACK (but you’ll have SLEPc), Ipopt, MUMPS_seq.
With the upcoming release of PETSc 3.14.0 (scheduled September 29), you’ll also get ARPACK with these steps (may be tested using the branch petsc-3.14.0).