Boost logo

Boost Users :

From: John Hunter (jdhunter_at_[hidden])
Date: 2002-06-06 08:51:59


Hi David,

I have found out a little bit more about the problem. It only occurs
if I link with the dynamic library generated by bjam in
build/bin/libboost_python.so/gcc/release/inlining-on/runtime-link-dynamic/shared-linkable-true/libboost_python.so.1.28.0.
When I link against the static library, which I built using the
makefile linux_gcc.mak, the segmentation fault no longer occurs. I
replicated the problem with OverloadTest in comprehensive.cpp (seg
fault occurs when calling the first overloaded constructor iff linking
against the shared lib compiled by bjam). Are you linking against the
static or dynamic version of libboost_python?

Below I'll include some relevant lines of my bjam output which I
compiled with debug 2 and some from the make output where I build the
static library. Could any of the flags that bjam sets be causing my
problem if I don't also set them when building my extension module?
bjam is setting -ftemplate-depth-100 -DBOOST_PYTHON_DYNAMIC_LIB -g -O0
-fno-inline -fPIC and I am setting -fPIC and -ftemplate-depth-100.

BTW: I could not find the enclosed user directory you referred to in
your post.

Thanks,
John Hunter

----
Sample bjam out:
gcc-C++-action libs/python/build/bin/libboost_python.so/gcc/debug/runtime-link-dynamic/shared-linkable-true/errors.o
    g++  -c -Wall -ftemplate-depth-100  -DBOOST_PYTHON_DYNAMIC_LIB  -g -O0 -fno-inline -fPIC   -I"libs/python/build" -I"/usr/local/include/python2.1" -I"/workn/jdhunter/c/lib/boost_1_28_0"   -o "libs/python/build/bin/libboost_python.so/gcc/debug/runtime-link-dynamic/shared-linkable-true/errors.o"  "libs/python/build/../src/errors.cpp" 
gcc-Link-action libs/python/build/bin/libboost_python.so/gcc/debug/runtime-link-dynamic/shared-linkable-true/libboost_python.so
    LD_LIBRARY_PATH=.:/home/jdhunter/c/lib:/usr/local/lib:/usr/lib:/lib:/usr/X11R6/lib:/usr/local/lib/mysql/:/home/jdhunter/python/lib:/usr/local/lib/vtk:/home/jdhunter/c/lib/xerces/lib:/usr/local/matlab/extern/lib/glnx86:/usr/local/matlab/sys/os/glnx86/ 
    export LD_LIBRARY_PATH 
    g++   -g -fPIC -shared  -o "libs/python/build/bin/libboost_python.so/gcc/debug/runtime-link-dynamic/shared-linkable-true/libboost_python.so.1.28.0"  -L/usr/local/lib/python2.1/config   "libs/python/build/bin/libboost_python.so/gcc/debug/runtime-link-dynamic/shared-linkable-true/types.o" "libs/python/build/bin/libboost_python.so/gcc/debug/runtime-link-dynamic/shared-linkable-true/classes.o" "libs/python/build/bin/libboost_python.so/gcc/debug/runtime-link-dynamic/shared-linkable-true/conversions.o" "libs/python/build/bin/libboost_python.so/gcc/debug/runtime-link-dynamic/shared-linkable-true/extension_class.o" "libs/python/build/bin/libboost_python.so/gcc/debug/runtime-link-dynamic/shared-linkable-true/functions.o" "libs/python/build/bin/libboost_python.so/gcc/debug/runtime-link-dynamic/shared-linkable-true/init_function.o" "libs/python/build/bin/libboost_python.so/gcc/debug/runtime-link-dynamic/shared-linkable-true/module_builder.o" "libs/python/build/bin/libboost_python.so/gcc/debug/runtime-link-dynamic/shared-linkable-true/objects.o" "libs/python/build/bin/libboost_python.so/gcc/debug/runtime-link-dynamic/shared-linkable-true/cross_module.o" "libs/python/build/bin/libboost_python.so/gcc/debug/runtime-link-dynamic/shared-linkable-true/errors.o"    -lutil  -Wl,-rpath-link,. "-Wl,-soname,libboost_python.so.1.28.0" 
    ln -fs "libboost_python.so.1.28.0" "libs/python/build/bin/libboost_python.so/gcc/debug/runtime-link-dynamic/shared-linkable-true/libboost_python.so" 
---
Sample make static lib out:
g++   -I/usr/local/include/boost -I/usr/local/include/python2.1 -fPIC -ftemplate-depth-21  -g -c errors.cpp
rm -f libboost_python.a
ar r libboost_python.a classes.o conversions.o errors.o extension_class.o functions.o init_function.o module_builder.o objects.o types.o cross_module.o
>>>>> "David" == David Abrahams <david.abrahams_at_[hidden]> writes:
    David> I can't reproduce your problem with gcc-3.0.4 or gcc-3.1
    David> Unzip the enclosed "user" directory to your libs/python
    David> directory and run bjam there to test it yourself. Works for
    David> me.

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net