From: John Maddock (john_at_[hidden])
Date: 2005-08-30 11:40:02
> * Cygwin 1.5.7
> * GCC 3.2
> I've got a very simple (testing-based) Jamfile that works fine, and
> I'd like to run one of the tests with multithreading options:
> bjam "-sTOOLS=GCC" "-sBUILD=<threading>multi" test_basic
> This invocation succeeds, but I can see in my code that
> BOOST_HAS_THREADS is *not* defined. I've tried also
> bjam "-sTOOLS=GCC" "-sBUILD=<threading>multi <define>BOOST_HAS_THREADS"
> with a similar effect: BOOST_HAS_THREADS is later undef'd, I
> guess by some Boost.Config header.
> My last attempt involved expicitly plugging the <threading>multi
> in the test rule itself inside the Jamfile, same result.
> So, what need I have to do in order to enable multithreading support
> under the
> aforementioned platform? I guess I'm missing something very obvious, and
> kinda stupid :(
With Boost-1.33.0 and the latest cygwin (gcc-4.4.4) then if I build the
config_info test case (under libs/config/test) then I see the
BOOST_HAS_THREADS *is* getting defined.
It would only be explicitly undef'ed if gcc and/or libstdc++3 had been built
single-threaded, in which case there is no way to build thread safe
programs, you need to look into boost/config/compiler/gcc.hpp and
boost/config/stdlib/libstdcpp3.hpp to see why it's getting undef'ed in your
case, but before you do that, do a:
and make sure it says:
Thread model: posix
Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk