[config] Single threaded builds with g++ >= 3.4: No longer possible?

Hi there
From boost/config/stdlib/libstdcpp3.hpp:
<quote> #ifdef __GLIBCXX__ // gcc 3.4 and greater: # ifdef _GLIBCXX_HAVE_GTHR_DEFAULT // // If the std lib has thread support turned on, then turn it on in Boost // as well. We do this because some gcc-3.4 std lib headers define _REENTANT // while others do not... // # define BOOST_HAS_THREADS # else # define BOOST_DISABLE_THREADS # endif #endif </quote> I suspect this means that ST builds are no longer possible on some GCC platforms (I'm using MinGW). Could someone please confirm or deny this? Thanks & Regards, -- Andreas Huber When replying by private email, please remove the words spam and trap from the address shown in the header.

Hi, On Tue, Jan 18, 2005 at 03:49:17PM +0100, Andreas Huber wrote:
From boost/config/stdlib/libstdcpp3.hpp:
<quote> #ifdef __GLIBCXX__ // gcc 3.4 and greater: # ifdef _GLIBCXX_HAVE_GTHR_DEFAULT // // If the std lib has thread support turned on, then turn it on in Boost // as well. We do this because some gcc-3.4 std lib headers define _REENTANT // while others do not... // # define BOOST_HAS_THREADS # else # define BOOST_DISABLE_THREADS # endif #endif </quote>
I suspect this means that ST builds are no longer possible on some GCC platforms (I'm using MinGW). Could someone please confirm or deny this?
builds without MT support are still possible but you need to explicitly define BOOST_DISABLE_THREADS (either via the compiler command line option or via your own version of boost/config/user.hpp). Yes, it is annoying, but given that gcc 3.4 does not provide a way to detect at compile time whether the option `-pthread' (or whatever it is on your platform) is present on the compiler command line, there seems to be no better solution. The corresponding PR in the gcc bug tracking system <URL:http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11953> did not see much activity lately whence I entertain some doubt whether there will be a resolution before gcc 4.0. Christoph -- http://www.informatik.tu-darmstadt.de/TI/Mitarbeiter/cludwig.html LiDIA: http://www.informatik.tu-darmstadt.de/TI/LiDIA/Welcome.html

Hi Christoph
I suspect this means that ST builds are no longer possible on some GCC platforms (I'm using MinGW). Could someone please confirm or deny this?
builds without MT support are still possible but you need to explicitly define BOOST_DISABLE_THREADS (either via the compiler command line option or via your own version of boost/config/user.hpp).
Yes, it is annoying, but given that gcc 3.4 does not provide a way to detect at compile time whether the option `-pthread' (or whatever it is on your platform) is present on the compiler command line, there seems to be no better solution. The corresponding PR in the gcc bug tracking system <URL:http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11953> did not see much activity lately whence I entertain some doubt whether there will be a resolution before gcc 4.0.
Thanks a lot for the info. I guess this makes it a bjam issue then. It seems that the mingw toolset should define BOOST_DISABLE_THREADS for a single-threaded build. Regards, -- Andreas Huber When replying by private email, please remove the words spam and trap from the address shown in the header.
participants (2)
-
Andreas Huber
-
Christoph Ludwig