[Gmsh] Building problem with lib version of Gmsh on Linux
Nicolas.Saugnier at loria.fr
Nicolas.Saugnier at loria.fr
Fri Jun 19 17:51:52 CEST 2009
Hi,
I've built Gmsh with OpenCASCADE as a library on Linux, and I come
across a little problem when I build any of the examples in
utils/api-demos/ :
/usr/local/lib/libGmsh.a(pmetis.o): In function `__MlevelEdgeBisection':
/home/nicolas/gmsh/gmsh/contrib/Metis/pmetis.c:176: undefined
reference to `__Refine2Way'
/usr/local/lib/libGmsh.a(initpart.o): In function `__RandomBisection':
/home/nicolas/gmsh/gmsh/contrib/Metis/initpart.c:358: undefined
reference to `__Allocate2WayPartitionMemory'
/home/nicolas/gmsh/gmsh/contrib/Metis/initpart.c:397: undefined
reference to `__Compute2WayPartitionParams'
/usr/local/lib/libGmsh.a(initpart.o): In function `__GrowBisection':
/home/nicolas/gmsh/gmsh/contrib/Metis/initpart.c:95: undefined
reference to `__Allocate2WayPartitionMemory'
/home/nicolas/gmsh/gmsh/contrib/Metis/initpart.c:179: undefined
reference to `__Compute2WayPartitionParams'
/usr/local/lib/libGmsh.a(initpart.o): In function `__GrowBisectionNode':
/home/nicolas/gmsh/gmsh/contrib/Metis/initpart.c:313: undefined
reference to `__Compute2WayPartitionParams'
- Gmsh lib configuration :
./configure --disable-gui --enable-occ
--with-occ-prefix=/usr/local/opencascade --disable-chaco
--prefix=/usr/local/
I added -lpthread to "OPTIM" in variables as it complained about
thread related functions missing.
- Gmsh compilation :
sudo make install-lib
- Build line (slightly modified from the one in the comments of mainOcc.cpp):
g++ -O2 -I/usr/local/opencascade/inc mainOcc.cpp -lGmsh
-L/usr/local/opencascade/lib -lTKSTEP -lTKSTEP209 -lTKSTEPAttr
-lTKSTEPBase -lTKIGES -lTKXSBase -lTKOffset -lTKFeat -lTKFillet
-lTKBool -lTKShHealing -lTKMesh -lTKHLR -lTKBO -lTKPrim -lTKTopAlgo
-lTKGeomAlgo -lTKBRep -lTKGeomBase -lTKG3d -lTKG2d -lTKAdvTools
-lTKMath -lTKernel -lm -llapack -lblas -lpthread
I'm working with the nightly sources 20090616 , Debian for amd64, with
OpenCascade 6.3.0. It also shows up in today's nightly source package
it seams.
My guess, by looking at the makefile rule "lib", is that refine.o
coming from contrib/Metis/ is silently replaced by the one coming from
contrib/Netgen/.
Disabling one of those packages suppresses the error.
Proceeding like this also seams to do the trick, without the need to
disable the packages:
make
cp contrib/Metis/refine.o lib/refine2.o
sudo make install-lib
Best Regards,
Nicolas SAUGNIER