Boost logo

Boost Testing :

From: Jim Douglas (jim_at_[hidden])
Date: 2006-04-07 02:30:36


Since the switch to bbv2 I have been experiencing failures in thread,
spirit & regex due to the inclusion of pthread in the list of link
libraries. I have at long last tracked down the offending piece of code
which can be found in ..libs\thread\build\Jamfile.v2 :

<snippet>
if [ os.name ] = NT
{
     reqts = <link>shared:<define>BOOST_THREAD_BUILD_DLL=1 ;
}
else
{
     # Declare the uses system library
     lib pthread : : <name>pthread ;
     usage = <library>pthread ;
}
</snippet>

This will fail big time on the QNX qcc toolset for a number of reasons:

1. QNX is inherently multi-threaded and does not link against a separate
pthread library.
2. QNX apps can be compiled natively, or cross compiled on Windows,
Linux or Solaris. The above code only detects the the OS hosting the
compiler and therefore may make the wrong choice.

In general I suggest that the above code breaks the rules of 'best
practice' and any decision regarding which libraries to include should
be moved to the individual tools .jam files based on the requirement for
single/multi threading.

BUT (and it is a big but), if you want a really quick and dirty fix then
change the above else test to

else if [ os.name ] != QNXNTO

That will at least work for the self-hosted regression tests for the
time being.

Regards
Jim


Boost-testing list run by mbergal at meta-comm.com