Mmg3d does not work in Ubuntu 20.04 but works in Mac and Windows

Dear all,

I did mesh adaption by mmg3d, the same code has different results on different PCs. In windows with FreeFem v4.10 and Mac with v4.12,
the mesh can be adapted, be refined near the edge (y==0);
but in Ubuntu 20.04 with ff v4.12, the mmg3d did not change the mesh.
One of my colleague also checked in his Linux with v4.12, the mesh was not changed.

The following is my simple example:

load "msh3"
load "medit"
load "aniso"
load "mmg"
load "mshmet"
include "cube.idp"

int[int] Nxyz=[10,10,3];
real [int,int] Bxyz=[[0.,0.06],[0.,0.06],[0.,0.0015]];
int [int,int] Lxyz=[[1,1],[2,2],[2,2]];
mesh3 Th=Cube(Nxyz,Bxyz,Lxyz);
fespace Ph6(Th,[P1,P1,P1,P1,P1,P1]);
Ph6 [m11,m21,m22,m31,m32,m33];

real errh,hmax,hmin,adaptratio;
errh = 1e-3; hmax = 0.01; hmin =1e-7 ;adaptratio = 1.5;
real epsilon = 0.002; 

fespace Ph(Th,P1);
Ph p = -(2*tanh(y/(epsilon))-1);
real[int] hmetric(6*Th.nv);


mesh3 Th3=mmg3d(Th,mem=10000,metric=m11[],hmax = hmax,hmin = hmin);

Examplemmg.edp (728 Bytes)

Can you include it as an attachment? The copy/paste has been corrupting files
for me ( Ubuntu 15 or so lol ).

I upload an attachement of this example.

In Windows, the 2nd image is adapted like that.

 cat  /proc/version
Linux version 4.15.0-142-generic (buildd@lgw01-amd64-039) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.12)) #146~16.04.1-Ubuntu SMP Tue Apr 13 09:27:15 UTC 2021
marchywka@happy:/home/documents/cpp/proj/freefem/play$ FreeFem++ 
FreeFem++ - version 4.12 (Sun Jan 22 17:51:12 EST 2023 - git no git) 64bits
License: LGPL 3+ (

`ldd `which FreeFem++` =>  (0x00007fff155a6000) => /home/ubuntu/dev/freefem/install2/ff-petsc/r/lib/ (0x00007f8fec4b4000) => /home/ubuntu/dev/freefem/install2/ff-petsc/r/lib/ (0x00007f8fec1a9000) => /usr/lib/ (0x00007f8feb9b1000) => /usr/lib/ (0x00007f8feb773000) => /lib/x86_64-linux-gnu/ (0x00007f8feb56f000) => /usr/lib/x86_64-linux-gnu/ (0x00007f8feb244000) => /lib/x86_64-linux-gnu/ (0x00007f8feaf3b000) => /usr/lib/x86_64-linux-gnu/ (0x00007f8feaa9d000) => /lib/x86_64-linux-gnu/ (0x00007f8fea880000) => /usr/lib/x86_64-linux-gnu/ (0x00007f8fea4fe000) => /lib/x86_64-linux-gnu/ (0x00007f8fea2e8000) => /lib/x86_64-linux-gnu/ (0x00007f8fe9f1e000) => /home/ubuntu/dev/freefem/install2/ff-petsc/r/lib/ (0x00007f8fe9d14000) => /home/ubuntu/dev/freefem/install2/ff-petsc/r/lib/ (0x00007f8fe9b11000) => /home/ubuntu/dev/freefem/install2/ff-petsc/r/lib/ (0x00007f8fe9909000) => /home/ubuntu/dev/freefem/install2/ff-petsc/r/lib/ (0x00007f8fe96fc000) => /home/ubuntu/dev/freefem/install2/ff-petsc/r/lib/ (0x00007f8fe94f0000) => /home/ubuntu/dev/freefem/install2/ff-petsc/r/lib/ (0x00007f8fe927e000) => /usr/lib/ (0x00007f8fe8ce0000)
	/lib64/ (0x00007f8fec77c000) => /usr/lib/x86_64-linux-gnu/ (0x00007f8fe8aa1000) => /usr/lib/x86_64-linux-gnu/ (0x00007f8fe889e000) => /lib/x86_64-linux-gnu/ (0x00007f8fe8684000) => /lib/x86_64-linux-gnu/ (0x00007f8fe847c000) => /usr/lib/x86_64-linux-gnu/ (0x00007f8fe8274000)

Here is what I get with Linux. You should consider trying out the develop branch with the latest available PETSc (which will get you the latest available Mmg).

In Windows, the mmg version is 5.5.2 ,
and in Linux with mmg 5.6.0, is it the latest ?

Not at all. This is what you’ll get with a proper installation (on both Linux/macOS/Windows).

$ FreeFem-sources-linux/src/nw/FreeFem++ Examplemmg.edp -v 0 -nw

  ## Warning: MMG5_memOption_memSet: asking for 10000 MB of memory when only 3966 available.

   MODULE MMG3D: 5.7.1 (Dec. 20, 2022)
     git branch: HEAD
     git commit: 9bd0023fe5f4a7de55d2959dd8dd4bf5d6929a36
     git date:   2022-12-22 08:56:26 +0100