[Gmsh] Problem building with triangle-1.6

Christophe Geuzaine cag32 at case.edu
Sat Nov 26 01:16:12 CET 2005


pfgshield-freebsd at yahoo.com wrote:
> Hi;
> I attempted to build gmsh 1.61 with the latest version of triangle on FreeBSD
> 4.11 (gcc 2.95.4).
> The result follows:
> _____
> ...
> c++ -Os -pipe -march=pentium -DHAVE_GSL -DHAVE_MATH_EVAL -DHAVE_METIS
> -DHAVE_ANN
> _ -DHAVE_TRIANGLE -DHAVE_LIBZ -DHAVE_LIBPNG -DHAVE_LIBJPEG -DHAVE_FLTK  
> -I/usr/
> X11R6 -I/usr/X11R6/include -I/usr/local/include/freetype2 -I/usr/local/include
> -
> O -pipe -I/usr/X11R6/include -I/usr/local -I/usr/local/include -I/usr/local
> -I/u
> sr/local/include -I/usr/local/include -I../Numeric -I../Common -I../DataStr
> -I..
> /Geo -I../Mesh -I../Graphics -I../Parser -I../Fltk -I../contrib/NR
> -I../contrib/
> Triangle -I../contrib/Tetgen -I../contrib/Netgen
> -I../contrib/Netgen/libsrc/incl
> ude -I../contrib/Netgen/libsrc/interface -I../contrib/ANN/include
> -I../contrib/M
> etis -c 2D_Parametric.cpp
> c++ -Os -pipe -march=pentium -DHAVE_GSL -DHAVE_MATH_EVAL -DHAVE_METIS
> -DHAVE_ANN
> _ -DHAVE_TRIANGLE -DHAVE_LIBZ -DHAVE_LIBPNG -DHAVE_LIBJPEG -DHAVE_FLTK  
> -I/usr/
> X11R6 -I/usr/X11R6/include -I/usr/local/include/freetype2 -I/usr/local/include
> -
> O -pipe -I/usr/X11R6/include -I/usr/local -I/usr/local/include -I/usr/local
> -I/u
> sr/local/include -I/usr/local/include -I../Numeric -I../Common -I../DataStr
> -I..
> /Geo -I../Mesh -I../Graphics -I../Parser -I../Fltk -I../contrib/NR
> -I../contrib/
> Triangle -I../contrib/Tetgen -I../contrib/Netgen
> -I../contrib/Netgen/libsrc/incl
> ude -I../contrib/Netgen/libsrc/interface -I../contrib/ANN/include
> -I../contrib/M
> etis -c 2D_Mesh_Aniso.cpp
> c++ -Os -pipe -march=pentium -DHAVE_GSL -DHAVE_MATH_EVAL -DHAVE_METIS
> -DHAVE_ANN
> _ -DHAVE_TRIANGLE -DHAVE_LIBZ -DHAVE_LIBPNG -DHAVE_LIBJPEG -DHAVE_FLTK  
> -I/usr/
> X11R6 -I/usr/X11R6/include -I/usr/local/include/freetype2 -I/usr/local/include
> -
> O -pipe -I/usr/X11R6/include -I/usr/local -I/usr/local/include -I/usr/local
> -I/u
> sr/local/include -I/usr/local/include -I../Numeric -I../Common -I../DataStr
> -I..
> /Geo -I../Mesh -I../Graphics -I../Parser -I../Fltk -I../contrib/NR
> -I../contrib/
> Triangle -I../contrib/Tetgen -I../contrib/Netgen
> -I../contrib/Netgen/libsrc/incl
> ude -I../contrib/Netgen/libsrc/interface -I../contrib/ANN/include
> -I../contrib/M
> etis -c 2D_Mesh_Triangle.cpp
> In file included from 2D_Mesh_Triangle.cpp:42:
> ../contrib/Triangle/triangle.h:285: `VOID' was not declared in this scope
> ../contrib/Triangle/triangle.h:285: `memptr' was not declared in this scope
> ../contrib/Triangle/triangle.h:285: variable or field `trifree' declared void
> *** Error code 1
> 
> Stop in /usr/ports/cad/gmsh/work/gmsh-1.61.0/Mesh.
> *** Error code 1
> 
> Stop in /usr/ports/cad/gmsh/work/gmsh-1.61.0.
> *** Error code 1
> 
> Stop in /usr/ports/cad/gmsh.
> estudio# 
> ___________
> 
> Hope you find it useful.
> 


Looks like the latest version of triangle.h uses "VOID" instead of
"void"... I've released gmsh 1.61.1 with the following patch:

http://geuz.org/gmsh/src/gmsh-1.61.1-source.tgz

*******************************************

Index: gmsh/Mesh/2D_Mesh_Triangle.cpp
diff -u gmsh/Mesh/2D_Mesh_Triangle.cpp:1.12
gmsh/Mesh/2D_Mesh_Triangle.cpp:1.13
--- gmsh/Mesh/2D_Mesh_Triangle.cpp:1.12	Sat Jan  1 20:35:30 2005
+++ gmsh/Mesh/2D_Mesh_Triangle.cpp	Sat Nov 26 00:49:04 2005
@@ -1,4 +1,4 @@
-// $Id: 2D_Mesh_Triangle.cpp,v 1.12 2005/01/01 19:35:30 geuzaine Exp $
+// $Id: 2D_Mesh_Triangle.cpp,v 1.13 2005/11/25 23:49:04 geuzaine Exp $
  //
  // Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle
  //
@@ -36,6 +36,7 @@

  #define ANSI_DECLARATORS
  #define REAL double
+#define VOID void

  extern "C"
  {
Index: gmsh/Plugin/Triangulate.cpp
diff -u gmsh/Plugin/Triangulate.cpp:1.28 gmsh/Plugin/Triangulate.cpp:1.29
--- gmsh/Plugin/Triangulate.cpp:1.28	Wed Mar  2 09:14:29 2005
+++ gmsh/Plugin/Triangulate.cpp	Sat Nov 26 00:49:05 2005
@@ -1,4 +1,4 @@
-// $Id: Triangulate.cpp,v 1.28 2005/03/02 08:14:29 geuzaine Exp $
+// $Id: Triangulate.cpp,v 1.29 2005/11/25 23:49:05 geuzaine Exp $
  //
  // Copyright (C) 1997-2005 C. Geuzaine, J.-F. Remacle
  //
@@ -98,6 +98,7 @@

  #define ANSI_DECLARATORS
  #define REAL double
+#define VOID void

  extern "C"
  {

********************************************


Thanks for report,

Christophe

-- 
Christophe Geuzaine
Assistant Professor, Case Western Reserve University, Mathematics
http://www.case.edu/artsci/math/geuzaine