ElmerCSC / elmerfem

Official git repository of Elmer FEM software
http://www.elmerfem.org
Other
1.14k stars 311 forks source link

Fails to build with gcc-10 #250

Closed yurivict closed 3 years ago

yurivict commented 3 years ago

Please see the log here: http://pb2.nyi.freebsd.org/data/121i386-default-PR244494/2020-12-01_06h57m35s/logs/errors/elmerfem-8.4.20200708_1.log

gianlucapettinello commented 3 years ago

Me too. I had to exclude elmerice by passing -DWITH_ElmerIce=OFF to cmake

yurivict commented 3 years ago

-fallow-argument-mismatch also solves this.

raback commented 3 years ago

This check was added for CMakeLists.txt, see lines 230-235. The main problem was the Arpack library. Would there be easy remedy to make these lines apply to freebsd as well? https://github.com/ElmerCSC/elmerfem/blob/0b1985dba2d0ebc22c2401bab9754472ef2f06b8/CMakeLists.txt

antoscha commented 3 years ago

-fallow-argument-mismatch helps but not everywhere:

/elmerfem-release-8.4/elmerice/Solvers/CalvingRemeshMMG.F90:429:45:

  429 |       CALL MMG3D_mmg3dls(mmgMesh,mmgSol,ierr)
      |                                             1
Error: Type mismatch in argument ‘met’ at (1); passed INTEGER(4) to INTEGER(8)
gianlucapettinello commented 3 years ago

-fallow-argument-mismatch helps but not everywhere:

/elmerfem-release-8.4/elmerice/Solvers/CalvingRemeshMMG.F90:429:45:

  429 |       CALL MMG3D_mmg3dls(mmgMesh,mmgSol,ierr)
      |                                             1
Error: Type mismatch in argument ‘met’ at (1); passed INTEGER(4) to INTEGER(8)

This is where I stop myself. If you compile without elmeice it completes the compiling. The error is due to the fact that one argument is missing. I changed to CALL MMG3D_mmg3dls(mmgMesh,mmgSol, mmgSol, ierr) but then there is another error in

[ 59%] Building Fortran object elmerice/Solvers/MeshAdaptation_2D/CMakeFiles/ElmerIce_MeshAdapt2D.dir/MMG2DSolver.F90.o
/home/gianluca/builds/elmerfem/src/elmerfem-release-8.4/elmerice/Solvers/MeshAdaptation_2D/MMG2DSolver.F90:479:59:

  479 |       CALL MMG2D_Set_meshSize(mmgMesh,NVert,NEle,NEdge,ier)
gianlucapettinello commented 3 years ago

Found a solution: /elmerfem-release-8.4/elmerice/Solvers/CalvingRemeshMMG.F90 you need to define: MMG5_DATA_PTR_T :: mmgMet and modify the call in CALL MMG3D_mmg3dls(mmgMesh,mmgSol, mmgMet, ierr) /elmerfem-release-8.4/elmerice/Solvers/MeshAdaptation_2D/MMG2DSolver.F90 you need to define variable nquad: INTEGER :: np,nt,nquad,na,ier and modify the call in CALL MMG2D_Get_meshSize(mmgMesh,np,nt,nquad,na,ier) you need to define the variable NQuad INTEGER :: NVert,NEle,NQuad,NEdge and modify the call in CALL MMG2D_Set_meshSize(mmgMesh,NVert,NEle,NQuad,NEdge,ier) I don't know how to make a diff file. i somebody can do it we can submit a patch. Thanks Gianluca

antoscha commented 3 years ago

I don't know how to make a diff file. i somebody can do it we can submit a patch.

Here it is: elmerice.txt

tzwinger commented 3 years ago

The MMG incompatibilities have been solved with latest commit. Elmer compilation should now figure out whether to use the old (pre MMG v5.5) or the new interface.