[cgma-dev] build issues, libtool
Jason Kraftcheck
kraftche at cae.wisc.edu
Fri Sep 18 15:37:14 CDT 2009
Jed Brown wrote:
> My system is automake 1.11, autoconf 2.64, libtool 2.2.6a, gcc 4.4.1. I
> pulled the most recent CGM (r3134), ran autoreconf -fi, and then
> subsequently hit some build issues. I don't know if this is due to new
> versions on my end, or updates to CGM in the last couple months
> (changelog suggests the former, but I'd rather not revert my environment
> to confirm this unless it's important).
>
I cannot reproduce the issues you see below. More comments below. I tried
using automake 1.10.1 and autoconf 2.61 with both version 1.5.26 and 2.2.6a
of libtool. I think something is wrong with your libtool installation.
> First, configuring using --with-pic isn't actually adding -fPIC where
> needed, I had to put this into *FLAGS. My configuration is now
>
You should never need to specify --with-pic. Libtool automatically adds
that for shared libraries. The option is used to request PIC code in static
libraries (*.a) that will later be linked into a shared library.
> ../configure --enable-shared --without-acis --prefix=/home/jed/usr --with-occ=/opt/opencascade --enable-debug --with-pic CFLAGS=-fPIC CXXFLAGS=-fPIC FCFLAGS=-fPIC
>
> More importantly, the libtool script that autoconf puts in the build
> directory is broken on my system because it drops the -Wl, prefix that
> gcc requires. Using the system libtool (s#/bin/sh ./##) works
> correctly.
Which version of libtool is that?
> Changing to --tag=CXX and g++ without using system libtool
> does not error, but libcgm.so.0.0.0 is not created (and is thus not
> usable).
>
This should not be necessary. It is normal for libtool to use $CC when
linking a library that is composed of other libraries and archives.
>
> /bin/sh ./libtool --tag=CC --mode=link gcc -fPIC -g -o libcgm.la -rpath /home/jed/usr/lib init/libcgma_init.la geom/OCC/libcubit_OCC.la geom/virtual/libcubit_virtual.la geom/facet/libcubit_facet.la geom/Cholla/libcholla.la geom/facetbool/libcubit_facetbool.la geom/libcubit_geom.la util/libcubit_util.la -lTKMath -lTKXSBase -lTKernel -lTKShHealing -lTKBRep -lTKG3d -lTKBO -lTKFeat -lTKFillet -lTKG2d -lTKOffset -lTKBool -lTKGeomAlgo -lTKGeomBase -lTKPrim -lTKTopAlgo -lTKHLR -lTKIGES -lTKMesh -lTKPrim -lTKSTEP209 -lTKSTEPAttr -lTKSTEPBase -lTKSTEP -lTKSTL -lTKTopAlgo -lTKXSBase -lTKLCAF -lTKBinL no -lTKernel -lm
> libtool: link: gcc -shared --whole-archive init/.libs/libcgma_init.a geom/OCC/.libs/libcubit_OCC.a geom/virtual/.libs/libcubit_virtual.a geom/facet/.libs/libcubit_facet.a geom/Cholla/.libs/libcholla.a geom/facetbool/.libs/libcubit_facetbool.a geom/.libs/libcubit_geom.a util/.libs/libcubit_util.a --no-whole-archive -L/opt/opencascade/lib /opt/opencascade/lib/libTKFeat.so /opt/opencascade/lib/libTKHLR.so /opt/opencascade/lib/libTKIGES.so /opt/opencascade/lib/libTKOffset.so /opt/opencascade/lib/libTKFillet.so /opt/opencascade/lib/libTKBool.so /opt/opencascade/lib/libTKBO.so /opt/opencascade/lib/libTKPrim.so /opt/opencascade/lib/libTKSTEP.so /opt/opencascade/lib/libTKSTEPAttr.so /opt/opencascade/lib/libTKSTEP209.so /opt/opencascade/lib/libTKSTEPBase.so /opt/opencascade/lib/libTKSTL.so /opt/opencascade/lib/libTKMesh.so /opt/opencascade/lib/libTKXSBase.so /opt/opencascade/lib/libTKShHealing.so /opt/opencascade/lib/libTKBinL.so /opt/opencascade/lib/libTKLCAF.so /opt/opencascade/
li
> b/libTKTopAlgo.so /opt/opencascade/lib/libTKGeomAlgo.so /opt/opencascade/lib/libTKBRep.so /opt/opencascade/lib/libTKGeomBase.so /opt/opencascade/lib/libTKG3d.so /opt/opencascade/lib/libTKG2d.so /opt/opencascade/lib/libTKMath.so /opt/opencascade/lib/libTKCDF.so /opt/opencascade/lib/libTKernel.so -ldl -lpthread -lm -lc -soname libcgm.so.0 -o .libs/libcgm.so.0.0.0
> gcc: libcgm.so.0: No such file or directory
> gcc: unrecognized option '-soname'
> make[2]: *** [libcgm.la] Error 1
> make[2]: Leaving directory `/home/jed/build/cgm/build'
> make[1]: *** [all-recursive] Error 1
> make[1]: Leaving directory `/home/jed/build/cgm/build'
> make: *** [all] Error 2
>
>
> The same occurs with libiGeom.
>
> /bin/sh ../libtool --tag=CXX --mode=link g++ -fPIC -g -Wno-long-long -o libiGeom.la -rpath /home/jed/usr/lib CATag.lo iGeom_CGMA.lo iGeomError.lo ../libcgm.la -lTKernel -lm
> libtool: link: (cd ".libs" && rm -f "libiGeom.so.0" && ln -s "libiGeom.so.0.0.0" "libiGeom.so.0")
> libtool: link: (cd ".libs" && rm -f "libiGeom.so" && ln -s "libiGeom.so.0.0.0" "libiGeom.so")
> libtool: link: ar cru .libs/libiGeom.a CATag.o iGeom_CGMA.o iGeomError.o
> libtool: link: ranlib .libs/libiGeom.a
> libtool: link: ( cd ".libs" && rm -f "libiGeom.la" && ln -s "../libiGeom.la" "libiGeom.la" )
> cd .. && /bin/sh ./config.status itaps/iGeom-Defs.inc
> config.status: creating itaps/iGeom-Defs.inc
> make[2]: Leaving directory `/home/jed/build/cgm/build/itaps'
> make[1]: Leaving directory `/home/jed/build/cgm/build/itaps'
> $ ls -l .libs/
> total 3984
> -rw-r--r-- 1 jed users 781480 2009-09-17 23:16 CATag.o
> -rw-r--r-- 1 jed users 44240 2009-09-17 23:16 iGeomError.o
> -rw-r--r-- 1 jed users 1178200 2009-09-17 23:16 iGeom_CGMA.o
> -rw-r--r-- 1 jed users 2054656 2009-09-17 23:16 libiGeom.a
> lrwxrwxrwx 1 jed users 14 2009-09-17 23:16 libiGeom.la -> ../libiGeom.la
> -rw-r--r-- 1 jed users 1944 2009-09-17 23:16 libiGeom.lai
> lrwxrwxrwx 1 jed users 17 2009-09-17 23:16 libiGeom.so -> libiGeom.so.0.0.0
> lrwxrwxrwx 1 jed users 17 2009-09-17 23:16 libiGeom.so.0 -> libiGeom.so.0.0.0
>
>
> (Note the broken links.) Again, using system libtool fixes the
> problem.
>
>
> After working around the broken libtool, CGM seems to be built, but I
> had to kill the test suite after it was demanding more than 5GB of
> memory. Make check gives the output below (I killed it from elsewhere).
> Is this a memory leak, or is it actually doing a stress test that I just
> don't have enough memory for? I'll get you a stack trace if that would
> be helpful.
>
>
> make[4]: Entering directory `/home/jed/build/cgm/build/itaps'
> Using default input file: ../../itaps/../test/LeverArm.brep
> Geometry engine set to: OCC Geometry Engine version 6.2.0
>
>
> ITAPS GEOMETRY INTERFACE TEST PROGRAM:
>
> gLoad:
> Constructed 1 Volume: 1
> Model contents:
> vertices: 99
> edges: 159
> faces: 63
> regions: 1
> Success
> tags: Tags defined on model: GLOBAL_ID, NAME
> Success
> gentity sets: Success
> topology adjacencies: Success
> construct: Created swept volume 4
> Success
> primitives: Success
> transforms: Success
> booleans: Updated volume(s): 11
> Destroyed volume(s): 12
> Updated volume(s): 13
> Updated volume(s): 13
> Destroyed volume(s): 14
> Success
> /bin/sh: line 5: 7247 Terminated ${dir}$tst
> FAIL: testgeom_occ
> ==================
> 1 of 1 test failed
> ==================
>
>
>
>
> Thanks,
>
> Jed
>
--
"A foolish consistency is the hobgoblin of little minds" - Ralph Waldo Emerson
More information about the cgma-dev
mailing list