Boost logo

Boost :

From: Alkis Evlogimenos (alkis_at_[hidden])
Date: 2002-10-14 02:55:05


I am experiencing some problems building/running the regressions test on
gcc2.95.3-stlport on Linux. This is the toolset file I used (gcc2.95.3 and
STLport are installed under /opt/gcc2):

{
    local GCC_ROOT_DIRECTORY = /opt/gcc2 ;
    local GCC_STDLIB_DIRECTORY =
/opt/gcc2/lib/gcc-lib/i686-pc-linux-gnu/2.95.3 ;
    local STLPORT_ROOT = /opt/gcc2 ;
    local STLPORT_INCLUDE_DIRECTORY = include/stlport ;

    extends-toolset gcc-stlport ;
}

The first problem is the same as reported on the c++-sig_at_[hidden] list:

http://mail.python.org/pipermail/c++-sig/2002-July/001616.html

namely linking to the stlport library requires linking to the pthread library.
This problem can be easily reproduced by building boost and then trying to
compile any test:

[root_at_moraki status]# bjam "-sTOOLS=gcc2953-stlport" array1
...found 532 targets...
...updating 8 targets...
MkDir1 ../status/bin/array1.test/gcc2953-stlport
MkDir1 ../status/bin/array1.test/gcc2953-stlport/debug
MkDir1 ../status/bin/array1.test/gcc2953-stlport/debug/runtime-link-dynamic
gcc-C++-action
../status/bin/array1.test/gcc2953-stlport/debug/runtime-link-dynamic/array1.o
gcc-Link-action
../status/bin/array1.test/gcc2953-stlport/debug/runtime-link-dynamic/array1
/opt/gcc2/lib/libstlport_gcc_stldebug.so: undefined reference to
`pthread_getspecific'
/opt/gcc2/lib/libstlport_gcc_stldebug.so: undefined reference to
`pthread_key_create'
/opt/gcc2/lib/libstlport_gcc_stldebug.so: undefined reference to
`pthread_setspecific'
collect2: ld returned 1 exit status

It seems that these lines in gcc-stlport-tools.jam:

flags gcc-stlport FINDLIBS <runtime-link>static/<runtime-build>debug :
stlport_$(GCC_STLPORT_LIB_ID)_stldebug ;
flags gcc-stlport FINDLIBS <runtime-link>static/<runtime-build>release :
stlport_$(GCC_STLPORT_LIB_ID) ;
flags gcc-stlport FINDLIBS <runtime-link>dynamic/<runtime-build>debug :
stlport_$(GCC_STLPORT_LIB_ID)_stldebug ;
flags gcc-stlport FINDLIBS <runtime-link>dynamic/<runtime-build>release :
stlport_$(GCC_STLPORT_LIB_ID) ;

need to be changed to:

flags gcc-stlport FINDLIBS <runtime-link>static/<runtime-build>debug :
stlport_$(GCC_STLPORT_LIB_ID)_stldebug pthread ;
flags gcc-stlport FINDLIBS <runtime-link>static/<runtime-build>release :
stlport_$(GCC_STLPORT_LIB_ID) pthread ;
flags gcc-stlport FINDLIBS <runtime-link>dynamic/<runtime-build>debug :
stlport_$(GCC_STLPORT_LIB_ID)_stldebug pthread ;
flags gcc-stlport FINDLIBS <runtime-link>dynamic/<runtime-build>release :
stlport_$(GCC_STLPORT_LIB_ID) pthread ;

Indeed after this change the executables link properly:

[root_at_moraki status]# bjam "-sTOOLS=gcc2953-stlport" array1
...found 532 targets...
...updating 4 targets...
gcc-Link-action
../status/bin/array1.test/gcc2953-stlport/debug/runtime-link-dynamic/array1
Chmod1
../status/bin/array1.test/gcc2953-stlport/debug/runtime-link-dynamic/array1
capture-run-output1
../status/bin/array1.test/gcc2953-stlport/debug/runtime-link-dynamic/array1.run

But unfortunately they don't run:

        export PATH

        export LD_LIBRARY_PATH
        
../status/bin/array1.test/gcc2953-stlport/debug/runtime-link-dynamic/array1
>
../status/bin/array1.test/gcc2953-stlport/debug/runtime-link-dynamic/array1.output
2>&1 && cp -f
../status/bin/array1.test/gcc2953-stlport/debug/runtime-link-dynamic/array1.output
../status/bin/array1.test/gcc2953-stlport/debug/runtime-link-dynamic/array1.run

...failed capture-run-output1
../status/bin/array1.test/gcc2953-stlport/debug/runtime-link-dynamic/array1.run...
succeeded-test-file
../status/bin/array1.test/gcc2953-stlport/debug/runtime-link-dynamic/array1.test
bin compiler.cfg compiler_status.html cs-aix.html cs-hpux.html cs-irix.html
cs-macosx.html cs-solaris.html cs-tru64.html cs-win32.html CVS index.html
intel_logo.gif Jamfile kai_logo.gif pattern.temp2 pattern.test regression.cfg
regression.cpp regress.log rng.saved rng.tmp temp.tmp test_facet_file.out tmp
output file follows bin compiler.cfg compiler_status.html cs-aix.html
cs-hpux.html cs-irix.html cs-macosx.html cs-solaris.html cs-tru64.html
cs-win32.html CVS index.html intel_logo.gif Jamfile kai_logo.gif
pattern.temp2 pattern.test regression.cfg regression.cpp regress.log
rng.saved rng.tmp temp.tmp test_facet_file.out tmp
../status/bin/array1.test/gcc2953-stlport/debug/runtime-link-dynamic/array1:
error while loading shared libraries: libstlport_gcc_stldebug.so: cannot open
shared object file: No such file or directory
bin compiler.cfg compiler_status.html cs-aix.html cs-hpux.html cs-irix.html
cs-macosx.html cs-solaris.html cs-tru64.html cs-win32.html CVS index.html
intel_logo.gif Jamfile kai_logo.gif pattern.temp2 pattern.test regression.cfg
regression.cpp regress.log rng.saved rng.tmp temp.tmp test_facet_file.out tmp
end of output file bin compiler.cfg compiler_status.html cs-aix.html
cs-hpux.html cs-irix.html cs-macosx.html cs-solaris.html cs-tru64.html
cs-win32.html CVS index.html intel_logo.gif Jamfile kai_logo.gif
pattern.temp2 pattern.test regression.cfg regression.cpp regress.log
rng.saved rng.tmp temp.tmp test_facet_file.out tmp
*
***************** failed above test: array1 ********************
*
...failed updating 1 target...
...updated 3 targets...

LD_LIBRARY_PATH doesn't look like being set correctly:

../status/bin/array1.test/gcc2953-stlport/debug/runtime-link-dynamic/array1:
error while loading shared libraries: libstlport_gcc_stldebug.so: cannot open
shared object file: No such file or directory

Any ideas on how to fix this one (besides defining LD_LIBRARY_PATH before
running bjam)?

Thanks,

-- 
Alkis

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk