Error "définitions multiples de MMG" installing FreeFem 4.6 on Ubuntu 22.04.3 LTS

Hello,
I am trying to install FreeFem++ 4.6 from source on a freshly installed Ubuntu 22.04.3 LTS (installed on new computer).
I follow the instructions at Installation guide

The “make” produces a fatal error when building 3rdparty/mmg with many line messages similar to:

/usr/bin/ld : lib/libmmg2d.a(anisosiz_2d.c.o):/home/install/FreeFem-sources-4.6/3rdparty/mmg/mmg-sources/src/common/mmgexterns.c:36 : définitions multiples de « MMG5_renumbering »; lib/libmmg2d.a(mmg.c.o):/home/install/FreeFem-sources-4.6/3rdparty/mmg/mmg-sources/src/common/mmg.c:49 : défini pour la première fois ici

/usr/bin/ld : lib/libmmg2d.a(anisosiz_2d.c.o):/home/install/FreeFem-sources-4.6/3rdparty/mmg/mmg-sources/src/common/mmgexterns.c:34 : définitions multiples de « MMG5_compute_meanMetricAtMarkedPoints »; lib/libmmg2d.a(mmg.c.o):/home/install/FreeFem-sources-4.6/3rdparty/mmg/mmg-sources/src/common/mmg.c:44 : défini pour la première fois ici

(53 messages similar to that)

Does anybody have some idea?
Thanks.

Switch to FreeFEM 4.14 and let PETSc compile Mmg instead of relying on 3rdparty/mmg.

Also, here is a much simpler installation guide: GitHub - FreeFem/FreeFem-sources: FreeFEM source code.

Thank you for your reply.

I tried to compile FreeFem 4.14, but it fails from the beginning : the necessary packages

cpp freeglut3-dev g++ gcc gfortran   m4 make patch pkg-config wget python unzip liblapack-dev libhdf5-dev libgsl-dev autoconf automake autotools-dev bison flex gdb git cmake

are incompatible. FreeFem requires ancient versions that ubuntu refuses to install (obsolete from his point of view).

How to to specify PETSc to compile Mmg?

Could you please send configure.log? FreeFEM does not require ancient versions, you do not need those packages installed, in fact.

When I use
make petsc-slepc
I get an error : /usr/bin/env: «python»: Aucun fichier ou dossier de ce type

It is impossible to install python (obsolete from Ubuntu’s point of view).
python3 is installed on Ubuntu’s distribution

Please start from scratch (rm your FreeFem-sources folder and clone/download again), you are probably trying to do make petsc-slepc from FreeFEM 4.6, which is obsolete. There is no occurence of env python in neither FreeFEM nor PETSc, so you are using outdated files. The newer versions are using python3 indeed.

I will try this tomorrow. Attached is config.log
config.log (176.0 KB)
Thanks!

You could also try to do: export PYTHON=python3; make petsc-slepc, but I believe this is not needed if you start fresh.

#define VERSION "4.6"

No need to look any further.

I started from scratch, I followed instructions at

when doing “make petsc-slepc” I still get:
/usr/bin/env: «python»: Aucun fichier ou dossier de ce type
make: *** [Makefile:210 : petsc-3.13.0/tag-conf-real] Erreur 127

it looks for a file or directory named “python”, not for a command!
maybe it is related to a previous error message “dirname: opérande manquant”,
see the terminal output in attached file
make-petsc-slepc.log (1.2 KB)

I am still stuck.

I have looked in which source files the word “/usr/bin/env” appears (under the ff-petsc directory). I obtained the attached results
findenv.log (6.5 KB)
It occurs followed by “python”, which is the problem!

I see this in your log: cd petsc-3.13.0 && ./configure MAKEFLAGS='' \.

No, you did not start from scratch, FreeFEM 4.14 installs PETSc 3.20, you are stuck with old versions of both FreeFEM and PETSc, do not expect this to work until you switch to newer versions.

I installed new files for FreeFem 4.6 from the downloaded archive.
How can I do differently?

I told you yesterday in my previous answer Error "définitions multiples de MMG" installing FreeFem 4.6 on Ubuntu 22.04.3 LTS - #7 by prj, Please start from scratch (rm your FreeFem-sources folder and clone/download again).

Of course, I implicitly meant that you should download again the updated sources, not the ones from version 4.6.

Sorry I thought that version 4.6 was the most recent.
This is the one that is presented as the most recent at
https://doc.freefem.org/introduction/download.html
I have found version 4.14 at

I try this one…

This FreeFem4.14 source works! I got some warning messages like
Warning “argument mismatch” apparently related to the gfortran version (I have gfortran-11)
Also the make check has some error on testvtk.edp
makecheck.log (1.9 KB)
This is not a problem for me.
Thanks a lot PRJ (what is your name?). It is rather difficult to find on the web the installation procedure that is best adapted to one’s config (apt install freefem? freefem.deb ? sources (which ones)? commands to compile sources…
Fortunately you gave me personal help, which I appreciated a lot.
Francois.

Here is my name: prj- (Pierre Jolivet) · GitHub.
There is everything you need to install here: https://joliv.et/FreeFem-tutorial/main.pdf#page=24 (or there if you want a more fine-tuned installation: https://joliv.et/FreeFem-tutorial/main.pdf#page=199).

Thank you. Indeed I was mistaken by two things:
– The web page I mentioned, that says that 4.6 is the last version
– 4.14 < 4.6 (for which my computer agrees with)