]> SALOME platform Git repositories - plugins/netgenplugin.git/blob - adm_local/unix/config_files/check_NETGENPLUGIN.m4
Salome HOME
1838cde6c97d1988fca4169dcbbc69e584c25709
[plugins/netgenplugin.git] / adm_local / unix / config_files / check_NETGENPLUGIN.m4
1 AC_DEFUN([CHECK_NETGEN],[
2
3 AC_REQUIRE([AC_PROG_CXX])dnl
4 AC_REQUIRE([AC_PROG_CXXCPP])dnl
5
6 AC_CHECKING(for Netgen 4.5 and higher Libraries)
7
8 AC_LANG_SAVE
9 AC_LANG_CPLUSPLUS
10
11 AC_ARG_WITH(netgen,
12             [  --with-netgen=DIR root directory path of NETGEN installation],
13             NETGEN_HOME=$withval,NETGEN_HOME="")
14
15 NETGEN_INCLUDES=""
16 NETGEN_LIBS_DIR=""
17
18 Netgen_ok=no
19
20 if test "x$NETGEN_HOME" == "x" ; then
21
22 # no --with-netgen option used
23    if test "x$NETGENHOME" != "x" ; then
24
25     # NETGENHOME environment variable defined
26       NETGEN_HOME=$NETGENHOME
27
28    fi
29
30 fi
31
32 if test "x$NETGEN_HOME" != "x"; then
33
34   echo
35   echo
36   echo -------------------------------------------------
37   echo You are about to choose to use somehow the
38   echo Netgen Library to generate Tetrahedric mesh.
39   echo
40   echo WARNING
41   echo ----------------------------------------------------------
42   echo ----------------------------------------------------------
43   echo You are strongly advised to consult the file
44   echo NETGENPLUGIN_SRC/src/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 ----------------------------------------------------------
50   echo 
51   echo
52
53   
54
55   NETGEN_INCLUDES="-I$NETGEN_HOME/include"
56   NETGEN_LIBS_DIR="$NETGEN_HOME/lib/LINUX"
57
58   CPPFLAGS_old="$CPPFLAGS"
59   CXXFLAGS_old="$CXXFLAGS"
60   CPPFLAGS="$NETGEN_INCLUDES $CAS_CPPFLAGS $CPPFLAGS"
61   CXXFLAGS="$NETGEN_INCLUDES $CAS_CPPFLAGS $CXXFLAGS"
62
63   AC_MSG_CHECKING(for Netgen header file)
64
65   AC_CHECK_HEADER(nglib.h,Netgen_ok=yes,Netgen_ok=no)
66   if test "x$Netgen_ok" == "xyes"; then
67
68     AC_MSG_CHECKING(for Netgen libraries)
69
70     LDFLAGS_old="$LDFLAGS"
71     LDFLAGS="-L. -lNETGEN $CAS_LDPATH -lTKBRep -lTKShHealing -lTKSTEP -lTKXSBase -lTKIGES -lTKSTL -lTKTopAlgo $LDFLAGS"
72
73     AC_TRY_COMPILE(#include <iostream.h>
74 #include <fstream.h>
75 namespace nglib {
76 #include "nglib.h"
77 }
78 #define OCCGEOMETRY
79 #include <occgeom.hpp>
80 ,nglib::Ng_Init();
81  netgen::OCCGeometry occgeo;
82  nglib::Ng_Exit();,Netgen_ok=yes;ar x "$NETGEN_LIBS_DIR/libnginterface.a";
83             ar x "$NETGEN_LIBS_DIR/libocc.a";
84             ar x "$NETGEN_LIBS_DIR/libcsg.a";
85             ar x "$NETGEN_LIBS_DIR/libgprim.a";
86             ar x "$NETGEN_LIBS_DIR/libmesh.a";
87             ar x "$NETGEN_LIBS_DIR/libopti.a";
88             ar x "$NETGEN_LIBS_DIR/libgen.a";
89             ar x "$NETGEN_LIBS_DIR/libla.a";
90             ar x "$NETGEN_LIBS_DIR/libstlgeom.a";
91             ar x "$NETGEN_LIBS_DIR/libgeom2d.a";
92             $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;
93             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,
94             Netgen_ok=no)
95
96     AC_CACHE_VAL(salome_netgen_lib,[
97                  AC_TRY_LINK(
98 #include <iostream.h>
99 #include <fstream.h>
100 namespace nglib {
101 #include "nglib.h"
102 }
103 #define OCCGEOMETRY
104 #include <occgeom.hpp>
105 ,nglib::Ng_Init();
106  netgen::OCCGeometry occgeo;
107  nglib::Ng_Exit();,
108     eval "salome_netgen_lib=yes";rm -rf libNETGEN.so,eval "salome_netgen_lib=no";rm -rf libNETGEN.so)
109   ])
110     Netgen_ok="$salome_netgen_lib"
111
112
113     LDFLAGS="$LDFLAGS_old"
114   fi
115
116   CPPFLAGS="$CPPFLAGS_old"
117   CXXFLAGS="$CXXFLAGS_old"
118
119   if test "x$Netgen_ok" == xno ; then
120     AC_MSG_RESULT(no)
121     AC_MSG_WARN(Netgen libraries not found or not properly installed)
122   else
123     AC_MSG_RESULT(yes)
124   fi
125 fi
126
127 AC_SUBST(NETGEN_INCLUDES)
128 AC_SUBST(NETGEN_LIBS_DIR)
129
130 AC_LANG_RESTORE
131
132 ])dnl