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

**URL:** <https://community.freefem.org/t/error-definitions-multiples-de-mmg-installing-freefem-4-6-on-ubuntu-22-04-3-lts/2965>\
**Category:** FreeFEM installation\
**Created:** [February 14, 2024, 4:43pm UTC](https://community.freefem.org/t/error-definitions-multiples-de-mmg-installing-freefem-4-6-on-ubuntu-22-04-3-lts/2965 "2024-02-14T16:43:12Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![fb77](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/fb77/32/3796_2.png) [@fb77](https://community.freefem.org/u/fb77)\
**Post date:** [February 14, 2024, 4:43pm UTC](https://community.freefem.org/t/error-definitions-multiples-de-mmg-installing-freefem-4-6-on-ubuntu-22-04-3-lts/2965/1 "2024-02-14T16:43:12Z")

</div>

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](https://doc.freefem.org/introduction/installation.html)

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

```auto
/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.

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [February 14, 2024, 5:24pm UTC](https://community.freefem.org/t/error-definitions-multiples-de-mmg-installing-freefem-4-6-on-ubuntu-22-04-3-lts/2965/2 "2024-02-14T17:24:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [February 14, 2024, 5:30pm UTC](https://community.freefem.org/t/error-definitions-multiples-de-mmg-installing-freefem-4-6-on-ubuntu-22-04-3-lts/2965/3 "2024-02-14T17:30:41Z")

</div>

Also, here is a much simpler installation guide: [GitHub - FreeFem/FreeFem-sources: FreeFEM source code](https://github.com/FreeFem/FreeFem-sources?tab=readme-ov-file#freefem).

---

<div class="post-metadata">

**Author:** ![fb77](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/fb77/32/3796_2.png) [@fb77](https://community.freefem.org/u/fb77)\
**Post date:** [February 14, 2024, 5:32pm UTC](https://community.freefem.org/t/error-definitions-multiples-de-mmg-installing-freefem-4-6-on-ubuntu-22-04-3-lts/2965/4 "2024-02-14T17:32:22Z")

</div>

Thank you for your reply.

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

```auto
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?

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [February 14, 2024, 5:33pm UTC](https://community.freefem.org/t/error-definitions-multiples-de-mmg-installing-freefem-4-6-on-ubuntu-22-04-3-lts/2965/5 "2024-02-14T17:33:22Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![fb77](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/fb77/32/3796_2.png) [@fb77](https://community.freefem.org/u/fb77)\
**Post date:** [February 14, 2024, 5:37pm UTC](https://community.freefem.org/t/error-definitions-multiples-de-mmg-installing-freefem-4-6-on-ubuntu-22-04-3-lts/2965/6 "2024-02-14T17:37:06Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [February 14, 2024, 5:40pm UTC](https://community.freefem.org/t/error-definitions-multiples-de-mmg-installing-freefem-4-6-on-ubuntu-22-04-3-lts/2965/7 "2024-02-14T17:40:56Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![fb77](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/fb77/32/3796_2.png) [@fb77](https://community.freefem.org/u/fb77)\
**Post date:** [February 14, 2024, 5:43pm UTC](https://community.freefem.org/t/error-definitions-multiples-de-mmg-installing-freefem-4-6-on-ubuntu-22-04-3-lts/2965/8 "2024-02-14T17:43:35Z")

</div>

I will try this tomorrow. Attached is config.log  
[config.log](https://community.freefem.org/uploads/short-url/eBWUJ1JxTRiVUL8X3bB9qTybJ5w.log) (176.0 KB)  
Thanks!

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [February 14, 2024, 5:43pm UTC](https://community.freefem.org/t/error-definitions-multiples-de-mmg-installing-freefem-4-6-on-ubuntu-22-04-3-lts/2965/9 "2024-02-14T17:43:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [February 14, 2024, 5:44pm UTC](https://community.freefem.org/t/error-definitions-multiples-de-mmg-installing-freefem-4-6-on-ubuntu-22-04-3-lts/2965/10 "2024-02-14T17:44:34Z")

</div>

```auto
#define VERSION "4.6"

```

No need to look any further.

---

<div class="post-metadata">

**Author:** ![fb77](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/fb77/32/3796_2.png) [@fb77](https://community.freefem.org/u/fb77)\
**Post date:** [February 15, 2024, 10:58am UTC](https://community.freefem.org/t/error-definitions-multiples-de-mmg-installing-freefem-4-6-on-ubuntu-22-04-3-lts/2965/11 "2024-02-15T10:58:22Z")

</div>

I started from scratch, I followed instructions at

> **[GitHub - FreeFem/FreeFem-sources: FreeFEM source code](https://github.com/FreeFem/FreeFem-sources?tab=readme-ov-file#freefem)**
>
> FreeFEM source code. Contribute to FreeFem/FreeFem-sources development by creating an account on GitHub.

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](https://community.freefem.org/uploads/short-url/4vY27F6wAE2lJQxki9iIki7jMZ4.log) (1.2 KB)

I am still stuck.

---

<div class="post-metadata">

**Author:** ![fb77](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/fb77/32/3796_2.png) [@fb77](https://community.freefem.org/u/fb77)\
**Post date:** [February 15, 2024, 11:20am UTC](https://community.freefem.org/t/error-definitions-multiples-de-mmg-installing-freefem-4-6-on-ubuntu-22-04-3-lts/2965/12 "2024-02-15T11:20:42Z")

</div>

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](https://community.freefem.org/uploads/short-url/3rCVZL9CsSC8K63zaqSo4j9k5rs.log) (6.5 KB)  
It occurs followed by “python”, which is the problem!

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [February 15, 2024, 11:21am UTC](https://community.freefem.org/t/error-definitions-multiples-de-mmg-installing-freefem-4-6-on-ubuntu-22-04-3-lts/2965/13 "2024-02-15T11:21:58Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![fb77](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/fb77/32/3796_2.png) [@fb77](https://community.freefem.org/u/fb77)\
**Post date:** [February 15, 2024, 11:25am UTC](https://community.freefem.org/t/error-definitions-multiples-de-mmg-installing-freefem-4-6-on-ubuntu-22-04-3-lts/2965/14 "2024-02-15T11:25:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [February 15, 2024, 11:27am UTC](https://community.freefem.org/t/error-definitions-multiples-de-mmg-installing-freefem-4-6-on-ubuntu-22-04-3-lts/2965/15 "2024-02-15T11:27:11Z")

</div>

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](https://community.freefem.org/t/error-definitions-multiples-de-mmg-installing-freefem-4-6-on-ubuntu-22-04-3-lts/2965/7), `Please start from scratch (rm your FreeFem-sources folder and clone/download again)`.

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [February 15, 2024, 11:28am UTC](https://community.freefem.org/t/error-definitions-multiples-de-mmg-installing-freefem-4-6-on-ubuntu-22-04-3-lts/2965/16 "2024-02-15T11:28:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![fb77](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/fb77/32/3796_2.png) [@fb77](https://community.freefem.org/u/fb77)\
**Post date:** [February 15, 2024, 12:19pm UTC](https://community.freefem.org/t/error-definitions-multiples-de-mmg-installing-freefem-4-6-on-ubuntu-22-04-3-lts/2965/17 "2024-02-15T12:19:17Z")

</div>

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](https://doc.freefem.org/introduction/download.html)  
I have found version 4.14 at

> **[Release FreeFEM v4.14 · FreeFem/FreeFem-sources](https://github.com/FreeFem/FreeFem-sources/releases/tag/v4.14)**
>
> \[4.14\]
> Added
> 
> Finite element BDM2 and BDM2ortho in test, Bug in BDM2ortho corrected the 4 sept 2014 in version: v4.13-130-g1af52457
> Conversion of matrix or transpose of matrix in int\[int\]\[int\] arra...

I try this one…

---

<div class="post-metadata">

**Author:** ![fb77](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/fb77/32/3796_2.png) [@fb77](https://community.freefem.org/u/fb77)\
**Post date:** [February 15, 2024, 2:03pm UTC](https://community.freefem.org/t/error-definitions-multiples-de-mmg-installing-freefem-4-6-on-ubuntu-22-04-3-lts/2965/18 "2024-02-15T14:03:28Z")

</div>

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](https://community.freefem.org/uploads/short-url/vZclzsASUUkZnzUC6WNA9Eva5et.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.

---

<div class="post-metadata">

**Author:** ![prj](https://avatars.discourse-cdn.com/v4/letter/p/ecae2f/32.png) [@prj](https://community.freefem.org/u/prj)\
**Post date:** [February 15, 2024, 2:42pm UTC](https://community.freefem.org/t/error-definitions-multiples-de-mmg-installing-freefem-4-6-on-ubuntu-22-04-3-lts/2965/19 "2024-02-15T14:42:41Z")

</div>

Here is my name: [prj- (Pierre Jolivet) · GitHub](https://github.com/prj-).  
There is everything you need to install here: [https://joliv.et/FreeFem-tutorial/main.pdf#page=24](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](https://joliv.et/FreeFem-tutorial/main.pdf#page=199)).

---

<div class="post-metadata">

**Author:** ![fb77](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/fb77/32/3796_2.png) [@fb77](https://community.freefem.org/u/fb77)\
**Post date:** [February 15, 2024, 3:42pm UTC](https://community.freefem.org/t/error-definitions-multiples-de-mmg-installing-freefem-4-6-on-ubuntu-22-04-3-lts/2965/20 "2024-02-15T15:42:52Z")

</div>

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)
