Boost logo

Boost :

From: Rene Rivera (grafik.list_at_[hidden])
Date: 2005-05-26 15:10:56


Patrik Jonsson wrote:
> Rene Rivera wrote:
>
>> Well that's a single threaded library, it would have "threading-multi"
>> in the path if it was multi threaded.
>>
>>> ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_unlock
>>> ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_lock
>>> ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_init
>>> ld: 0711-317 ERROR: Undefined symbol: .pthread_mutex_destroy
>>
>>
>>
>> It's likely that something other than Boost requires pthread. Could
>> you find out what that is? It could be libstdc++, or something else..
>>
> It seems to be that boost/greg_month.hpp includes boost/shared_ptr.hpp,
> which uses boost/detail/shared_count.hpp which uses
> /boost/detail/lightweight_mutex.hpp. The pthread symbols are in
> greg_month.o, so it looks like that library won't work without threads
> or else something's supposed to turn threads off but isn't working...

Hmm... The only fix for this I can come up with is to add
"<define>BOOST_LWM_USE_SPINLOCK", or probably more safely add
"<linkflags>-pthread" to the BUILD. The current code, what's going to be
1.33, is rather different and is likely not to rely on pthreads on your
platform. I think it uses native assembly in the GCC+PPC case.

But more generally I would think that it should not generate *any*
locking code when doing a single threaded build.

I'm CC'ing the Boost list in the hope someone else can better resolve
the problem.

-- 
-- Grafik - Don't Assume Anything
-- Redshift Software, Inc. - http://redshift-software.com
-- rrivera/acm.org - grafik/redshift-software.com
-- 102708583/icq - grafikrobot/aim - Grafik/jabber.org

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