1 AC_DEFUN([CHECK_NETGEN],[
3 AC_REQUIRE([AC_PROG_CXX])dnl
4 AC_REQUIRE([AC_PROG_CXXCPP])dnl
6 AC_CHECKING(for Netgen 4.5 and higher Libraries)
12 [ --with-netgen=DIR root directory path of NETGEN installation],
13 NETGEN_HOME=$withval,NETGEN_HOME="")
20 if test "x$NETGEN_HOME" == "x" ; then
22 # no --with-netgen option used
23 if test "x$NETGENHOME" != "x" ; then
25 # NETGENHOME environment variable defined
26 NETGEN_HOME=$NETGENHOME
32 if test "x$NETGEN_HOME" != "x"; then
36 echo -------------------------------------------------
37 echo You are about to choose to use somehow the
38 echo Netgen Library to generate Tetrahedric mesh.
41 echo ----------------------------------------------------------
42 echo ----------------------------------------------------------
43 echo You are strongly advised to consult the file
44 echo NETGENPLUGIN_SRC/src/NETGEN/ReadMeForNgUsers, particularly about
45 echo assumptions made on the installation of the Netgen
46 echo application and libraries.
47 echo Ask your system administrator for those details.
48 echo ----------------------------------------------------------
49 echo ----------------------------------------------------------
55 NETGEN_INCLUDES="-I${NETGEN_HOME}/include"
57 # check ${NETGEN_HOME}/lib/LINUX directory for libraries
58 if test -f ${NETGEN_HOME}/lib/LINUX/libcsg.a ; then
59 NETGEN_LIBS_DIR="${NETGEN_HOME}/lib/LINUX"
61 # check ${NETGEN_HOME}/lib/LINUX64 directory for libraries
62 if test -f ${NETGEN_HOME}/lib/LINUX64/libcsg.a ; then
63 NETGEN_LIBS_DIR="${NETGEN_HOME}/lib/LINUX64"
65 NETGEN_LIBS_DIR="${NETGEN_HOME}/lib"
69 echo "NETGEN_LIBS_DIR = $NETGEN_LIBS_DIR"
71 CPPFLAGS_old="$CPPFLAGS"
72 CXXFLAGS_old="$CXXFLAGS"
73 CPPFLAGS="$NETGEN_INCLUDES $CAS_CPPFLAGS $CPPFLAGS"
74 CXXFLAGS="$NETGEN_INCLUDES $CAS_CPPFLAGS $CXXFLAGS"
76 AC_MSG_CHECKING(for Netgen header file)
78 AC_CHECK_HEADER(nglib.h,Netgen_ok=yes,Netgen_ok=no)
79 if test "x$Netgen_ok" == "xyes"; then
81 AC_MSG_CHECKING(for Netgen libraries)
83 LDFLAGS_old="$LDFLAGS"
84 LDFLAGS="-L. -lNETGEN $CAS_LDPATH -lTKBRep -lTKShHealing -lTKSTEP -lTKXSBase -lTKIGES -lTKSTL -lTKTopAlgo $LDFLAGS"
86 AC_TRY_COMPILE(#include <iostream.h>
92 #include <occgeom.hpp>
94 netgen::OCCGeometry occgeo;
95 nglib::Ng_Exit();,Netgen_ok=yes;ar x "$NETGEN_LIBS_DIR/libnginterface.a";
96 ar x "$NETGEN_LIBS_DIR/libocc.a";
97 ar x "$NETGEN_LIBS_DIR/libcsg.a";
98 ar x "$NETGEN_LIBS_DIR/libgprim.a";
99 ar x "$NETGEN_LIBS_DIR/libmesh.a";
100 ar x "$NETGEN_LIBS_DIR/libopti.a";
101 ar x "$NETGEN_LIBS_DIR/libgen.a";
102 ar x "$NETGEN_LIBS_DIR/libla.a";
103 ar x "$NETGEN_LIBS_DIR/libstlgeom.a";
104 ar x "$NETGEN_LIBS_DIR/libgeom2d.a";
105 $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;
106 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,
109 AC_CACHE_VAL(salome_netgen_lib,[
111 #include <iostream.h>
117 #include <occgeom.hpp>
119 netgen::OCCGeometry occgeo;
121 eval "salome_netgen_lib=yes";rm -rf libNETGEN.so,eval "salome_netgen_lib=no";rm -rf libNETGEN.so)
123 Netgen_ok="$salome_netgen_lib"
126 LDFLAGS="$LDFLAGS_old"
129 CPPFLAGS="$CPPFLAGS_old"
130 CXXFLAGS="$CXXFLAGS_old"
132 if test "x$Netgen_ok" == xno ; then
134 AC_MSG_WARN(Netgen libraries not found or not properly installed)
140 AC_SUBST(NETGEN_INCLUDES)
141 AC_SUBST(NETGEN_LIBS_DIR)