Boost logo

Boost :

From: BRIDGES Dick (Dick.Bridges_at_[hidden])
Date: 2005-06-21 12:58:36


> -----Original Message-----
> From: boost-bounces_at_[hidden]
[mailto:boost-bounces_at_[hidden]] On
> Behalf Of John Maddock
> Sent: Saturday, June 18, 2005 4:31 AM
> To: boost_at_[hidden]
> Subject: Re: [boost] Boost.config not recognize threading support
enabled?

<snip>

> If you look at the line that triggers the #error, you will see it is
within
> a block scoped by:
>
> #elif !defined(BOOST_HAS_THREADS)
>
> so the error is triggered by BOOST_HAS_THREADS not being defined. If
you
> now grep through the boost/config headers you will see:
>
> In suffix.hpp:
>
> #if (defined(__MT__) || defined(_MT) || defined(_REENTRANT) \
> || defined(_PTHREADS)) && !defined(BOOST_HAS_THREADS)
> # define BOOST_HAS_THREADS
> #endif
<snip>
> To find out which of the above is the cause the easiest way I find is
to
> through some #errors in the preprocessor branches you think may be
taken and
> then see if the #error is triggered or not (this is much easier than
> preprocessing the code IMO).
>
> To help you more we probably need:
>
> The gcc version.

[Dick]
"/opt/crosstool/arm-softfloat-linux-gnu/gcc-3.3.3-glibc-2.3.2/bin/arm-so
ftfloat-linux-gnu-c++" -v

Reading specs from
/opt/crosstool/arm-softfloat-linux-gnu/gcc-3.3.3-glibc-2.3.2/lib/gcc-lib
/arm-softfloat-linux-gnu/3.3.3/specs
Configured with:
/data/work/OMAP/crosstool/crosstool-0.28-rc37/build/arm-softfloat-linux-
gnu/gcc-3.3.3-glibc-2.3.2/gcc-3.3.3/configure
--target=arm-softfloat-linux-gnu --host=i686-host_pc-linux-gnu
--prefix=/opt/crosstool/arm-softfloat-linux-gnu/gcc-3.3.3-glibc-2.3.2
--with-float=soft
--with-headers=/opt/crosstool/arm-softfloat-linux-gnu/gcc-3.3.3-glibc-2.
3.2/arm-softfloat-linux-gnu/include
--with-local-prefix=/opt/crosstool/arm-softfloat-linux-gnu/gcc-3.3.3-gli
bc-2.3.2/arm-softfloat-linux-gnu --disable-nls --enable-threads=posix
--enable-symvers=gnu --enable-__cxa_atexit --enable-languages=c,c++
--enable-shared --enable-c99 --enable-long-long
Thread model: posix
gcc version 3.3.3

__GLIBCPP__ is 20040214 and __GLIBCXX__ is not defined. I 'peppered'
the headers with #warningS and determined that:

- BOOST_HAS_THREADS is not defined in gcc.hpp because linux, __linux &
__linux__ are all defined.

- BOOST_STDLIB_CONFIG is defined as "boost/config/stdlib/libstdcpp3.hpp"
in select_stdlib_config.hpp. But BOOST_HAS_THREADS is not defined in
libstdcpp3.hpp because __GLIBCXX__ is not defined.

- BOOST_HAS_PTHREADS is defined in posix_features.hpp after <unistd.h>
is included. I had hoped this was a good thing. ;)

- Then we get to suffix.hpp. BOOST_HAS_PTHREADS is defined and
BOOST_DISABLE_THREADS is !defined. So far, so good. However, because
none of _REENTRANT, _PTHREADS, __MT__, and __MT are defined,
BOOST_HAS_THREADS is still not defined. Consequently, on the way out,
BOOST_HAS_PTHREADS is undef'D.

Now that I see how BOOST_HAS_THREADS is not defined, I've moved into the
dark nether region of the-land-way-over-my-head.
 
I'm tempted to add BOOST_HAS_PTHREADS to the list of macros tested here:
<snippet file=suffix.hpp>
// Turn on threading support if the compiler thinks that it's in
// multithreaded mode. We put this here because there are only a
// limited number of macros that identify this (if there's any missing
// from here then add to the appropriate compiler section):
</snippet>
*BUT*, that little parenthetical admonition strongly suggests this file
is not to be modified - ever again. ;) Besides: there must have been
a reason for defining BOOST_HAS_PTHREADS without automatically
concluding BOOST_HAS_THREADS.

Apparently a similar problem was fixed in the past
(http://lists.boost.org/MailArchives/boost/msg19675.php) by adding an
unconditional define of BOOST_HAS_THREADS to metrowerks.hpp. But that
clearly won't work with gcc.hpp.

I am sorely in need of guidance. Where should I go from here?

> The command line that produced the above error.

[Dick]
"/opt/crosstool/arm-softfloat-linux-gnu/gcc-3.3.3-glibc-2.3.2/bin/arm-so
ftfloat-linux-gnu-c++" -I/usr/local/boost_1_32_0 -pthread test.cpp

> The output from the config_info program (cd into libs/config/test then
> "bjam -sBUILD="<threading>multi" config_info", then look for output
the
> program generated somewhere under
> boost-path/bin/boost/libs/config/test/config_info/ ...some
directories...
> /*.output

[Dick] Hey, that's a NEAT tool! (Unfortunately the "default" compiler
is gcc 3.4 and defines _REENTRANT. %>[ ) I'm going back through the
docs now to figure out how to invoke the cross-compiler but hoping the
above info might yield and answer.

> Hope this gets you further forward.
>
> John.
> _______________________________________________
> Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost

[Dick] Your help with this is sincerely appreciated. Thank you.


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