1 dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 dnl This library is free software; you can redistribute it and/or
7 dnl modify it under the terms of the GNU Lesser General Public
8 dnl License as published by the Free Software Foundation; either
9 dnl version 2.1 of the License.
11 dnl This library is distributed in the hope that it will be useful,
12 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
13 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 dnl Lesser General Public License for more details.
16 dnl You should have received a copy of the GNU Lesser General Public
17 dnl License along with this library; if not, write to the Free Software
18 dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 AC_DEFUN([CHECK_NETGEN],[
24 AC_REQUIRE([AC_PROG_CXX])dnl
25 AC_REQUIRE([AC_PROG_CXXCPP])dnl
27 AC_CHECKING(for Netgen 4.5 and higher Libraries)
33 [ --with-netgen=DIR root directory path of NETGEN installation],
34 NETGEN_HOME=$withval,NETGEN_HOME="")
41 if test "x$NETGEN_HOME" == "x" ; then
43 # no --with-netgen option used
44 if test "x$NETGENHOME" != "x" ; then
46 # NETGENHOME environment variable defined
47 NETGEN_HOME=$NETGENHOME
53 if test "x$NETGEN_HOME" != "x"; then
57 echo -------------------------------------------------
58 echo You are about to choose to use somehow the
59 echo Netgen Library to generate Tetrahedric mesh.
62 echo ----------------------------------------------------------
63 echo ----------------------------------------------------------
64 echo You are strongly advised to consult the file
65 echo NETGENPLUGIN_SRC/src/NETGEN/ReadMeForNgUsers, particularly about
66 echo assumptions made on the installation of the Netgen
67 echo application and libraries.
68 echo Ask your system administrator for those details.
69 echo ----------------------------------------------------------
70 echo ----------------------------------------------------------
76 NETGEN_INCLUDES="-I${NETGEN_HOME}/include"
78 # check ${NETGEN_HOME}/lib/LINUX directory for libraries
79 if test -f ${NETGEN_HOME}/lib/LINUX/libcsg.a ; then
80 NETGEN_LIBS_DIR="${NETGEN_HOME}/lib/LINUX"
82 # check ${NETGEN_HOME}/lib/LINUX64 directory for libraries
83 if test -f ${NETGEN_HOME}/lib/LINUX64/libcsg.a ; then
84 NETGEN_LIBS_DIR="${NETGEN_HOME}/lib/LINUX64"
86 NETGEN_LIBS_DIR="${NETGEN_HOME}/lib"
90 echo "NETGEN_LIBS_DIR = $NETGEN_LIBS_DIR"
92 CPPFLAGS_old="$CPPFLAGS"
93 CXXFLAGS_old="$CXXFLAGS"
94 CPPFLAGS="$NETGEN_INCLUDES $CAS_CPPFLAGS $CPPFLAGS"
95 CXXFLAGS="$NETGEN_INCLUDES $CAS_CPPFLAGS $CXXFLAGS"
97 AC_MSG_CHECKING(for Netgen header file)
99 AC_CHECK_HEADER(nglib.h,Netgen_ok=yes,Netgen_ok=no)
100 if test "x$Netgen_ok" == "xyes"; then
102 AC_MSG_CHECKING(for Netgen libraries)
104 LDFLAGS_old="$LDFLAGS"
105 LDFLAGS="-L. -lNETGEN $CAS_LDPATH -lTKBRep -lTKShHealing -lTKSTEP -lTKXSBase -lTKIGES -lTKSTL -lTKTopAlgo $LDFLAGS"
107 AC_TRY_COMPILE(#include <iostream>
113 #include <occgeom.hpp>
115 netgen::OCCGeometry occgeo;
116 nglib::Ng_Exit();,Netgen_ok=yes;ar x "$NETGEN_LIBS_DIR/libnginterface.a";
117 ar x "$NETGEN_LIBS_DIR/libocc.a";
118 ar x "$NETGEN_LIBS_DIR/libcsg.a";
119 ar x "$NETGEN_LIBS_DIR/libgprim.a";
120 ar x "$NETGEN_LIBS_DIR/libmesh.a";
121 ar x "$NETGEN_LIBS_DIR/libopti.a";
122 ar x "$NETGEN_LIBS_DIR/libgen.a";
123 ar x "$NETGEN_LIBS_DIR/libla.a";
124 ar x "$NETGEN_LIBS_DIR/libstlgeom.a";
125 ar x "$NETGEN_LIBS_DIR/libgeom2d.a";
126 $CXX -shared linopt.o bfgs.o linsearch.o global.o bisect.o meshtool.o refine.o ruler3.o improve3.o adfront3.o tetrarls.o prism2rls.o profiler.o pyramidrls.o pyramid2rls.o netrule3.o ruler2.o meshclass.o improve2.o adfront2.o netrule2.o triarls.o geomsearch.o secondorder.o meshtype.o parser3.o quadrls.o specials.o parser2.o meshing2.o meshing3.o meshfunc.o localh.o improve2gen.o delaunay.o boundarylayer.o msghandler.o meshfunc2d.o smoothing2.o smoothing3.o topology.o curvedelems_new.o clusters.o zrefine.o ngexception.o geomtest3d.o geom2d.o geom2dmesh.o geom3d.o adtree.o transform3d.o geomfuncs.o polynomial.o densemat.o vector.o basemat.o sparsmat.o algprim.o brick.o manifold.o bspline2d.o meshsurf.o csgeom.o polyhedra.o curve2d.o singularref.o edgeflw.o solid.o explicitcurve2d.o specpoin.o gencyl.o revolution.o genmesh.o genmesh2d.o spline3d.o surface.o identify.o triapprox.o meshstlsurface.o stlline.o stltopology.o stltool.o stlgeom.o stlgeomchart.o stlgeommesh.o table.o optmem.o spbita2d.o hashtabl.o sort.o flags.o seti.o bitarray.o array.o symbolta.o mystring.o moveablemem.o spline.o splinegeometry.o ngnewdelete.o nglib.o hprefinement.o Partition_Inter2d.o Partition_Loop.o Partition_Loop3d.o Partition_Inter3d.o Partition_Loop2d.o Partition_Spliter.o occgeom.o occgenmesh.o occmeshsurf.o -o libNETGEN.so;
127 rm -rf linopt.o bfgs.o linsearch.o global.o bisect.o meshtool.o refine.o ruler3.o improve3.o adfront3.o tetrarls.o prism2rls.o profiler.o pyramidrls.o pyramid2rls.o netrule3.o ruler2.o meshclass.o improve2.o adfront2.o netrule2.o triarls.o geomsearch.o secondorder.o meshtype.o parser3.o quadrls.o specials.o parser2.o meshing2.o meshing3.o meshfunc.o localh.o improve2gen.o delaunay.o boundarylayer.o msghandler.o meshfunc2d.o smoothing2.o smoothing3.o topology.o curvedelems_new.o clusters.o zrefine.o ngexception.o geomtest3d.o geom2d.o geom2dmesh.o geom3d.o adtree.o transform3d.o geomfuncs.o polynomial.o densemat.o vector.o basemat.o sparsmat.o algprim.o brick.o manifold.o bspline2d.o meshsurf.o csgeom.o polyhedra.o curve2d.o singularref.o edgeflw.o solid.o explicitcurve2d.o specpoin.o gencyl.o revolution.o genmesh.o genmesh2d.o spline3d.o surface.o identify.o triapprox.o meshstlsurface.o stlline.o stltopology.o stltool.o stlgeom.o stlgeomchart.o stlgeommesh.o table.o optmem.o spbita2d.o hashtabl.o sort.o flags.o seti.o bitarray.o array.o symbolta.o mystring.o moveablemem.o spline.o splinegeometry.o ngnewdelete.o nglib.o hprefinement.o Partition_Inter2d.o Partition_Loop.o Partition_Loop3d.o Partition_Inter3d.o Partition_Loop2d.o Partition_Spliter.o occgeom.o occgenmesh.o occmeshsurf.o csgparser.o dynamicmem.o extrusion.o occconstruction.o parthreads.o readuser.o writeabaqus.o writediffpack.o writeelmer.o writefeap.o writefluent.o writegmsh.o writejcm.o writepermas.o writetecplot.o writetochnog.o writeuser.o wuchemnitz.o,
130 AC_CACHE_VAL(salome_netgen_lib,[
138 #include <occgeom.hpp>
140 netgen::OCCGeometry occgeo;
142 eval "salome_netgen_lib=yes";rm -rf libNETGEN.so,eval "salome_netgen_lib=no";rm -rf libNETGEN.so)
144 Netgen_ok="$salome_netgen_lib"
147 LDFLAGS="$LDFLAGS_old"
150 CPPFLAGS="$CPPFLAGS_old"
151 CXXFLAGS="$CXXFLAGS_old"
153 if test "x$Netgen_ok" == xno ; then
155 AC_MSG_WARN(Netgen libraries not found or not properly installed)
161 AC_SUBST(NETGEN_INCLUDES)
162 AC_SUBST(NETGEN_LIBS_DIR)