[1.35.0] Threads - build failure using gcc on Win XP

It seems that I am unable to build/use boost threads when compiling with gcc-4.2.0 on windows. I get errors: libs\thread\src\win32\thread.cpp:147: error: 'heap_delete' is not a member of 'boost::detail' and other (see below). Can someone advise me as to how I can get boost_thread to build under gcc-4.2.0/32-bit XP machine wth boost 1.35.0. Thanks, Mat $ bjam -j2 debug gcc-4.2.0 --without-mpi --without-python threadapi=win32 libs/thread/build//boost_thread warning: Graph library does not contain optional GraphML reader. note: to enable GraphML support, set EXPAT_INCLUDE and EXPAT_LIBPATH to the note: directories containing the Expat headers and libraries, respectively. Building Boost.Regex with the optional Unicode/ICU support disabled. Please refer to the Boost.Regex documentation for more information (don't panic: this is a strictly optional feature). ...patience... ...found 676 targets... ...updating 3 targets... gcc.compile.c++ bin.v2\libs\thread\build\gcc-4.2.0\debug\threading-multi\thread.o libs\thread\src\win32\thread.cpp: In function 'void boost::<unnamed>::run_thread_exit_callbacks()': libs\thread\src\win32\thread.cpp:147: error: 'heap_delete' is not a member of 'boost::detail' libs\thread\src\win32\thread.cpp:149: error: 'heap_delete' is not a member of 'boost::detail' libs\thread\src\win32\thread.cpp:159: error: 'heap_delete' is not a member of 'boost::detail' libs\thread\src\win32\thread.cpp: At global scope: libs\thread\src\win32\thread.cpp:170: error: no 'unsigned int boost::thread::thread_start_function(void*)' member function declared in class 'boost::thread' libs\thread\src\win32\thread.cpp: In member function 'void boost::thread::start_thread()': libs\thread\src\win32\thread.cpp:194: error: ISO C++ forbids taking the address of an unqualified or parenthesized non-static member function to form a pointer to member function. Say '&boost::thread::thread_start_function' libs\thread\src\win32\thread.cpp:194: error: 'struct boost::detail::thread_data_base' has no member named 'id' libs\thread\src\win32\thread.cpp:194: error: '_beginthreadex' was not declared in this scope libs\thread\src\win32\thread.cpp:199: error: 'intrusive_ptr_add_ref' was not declared in this scope libs\thread\src\win32\thread.cpp:200: error: 'boost::detail::win32' has not been declared libs\thread\src\win32\thread.cpp: In constructor 'boost::<unnamed>::externally_launched_thread::externally_launched_thread()': libs\thread\src\win32\thread.cpp:215: error: 'count' was not declared in this scope libs\thread\src\win32\thread.cpp:216: error: 'interruption_enabled' was not declared in this scope libs\thread\src\win32\thread.cpp: In function 'void boost::<unnamed>::make_external_thread_data()': libs\thread\src\win32\thread.cpp:225: error: 'heap_new' is not a member of 'boost::detail' libs\thread\src\win32\thread.cpp:225: error: expected primary-expression before '>' token libs\thread\src\win32\thread.cpp:225: error: expected primary-expression before ')' token libs\thread\src\win32\thread.cpp: In constructor 'boost::thread::thread(boost::detail::thread_move_t<boost::thread>)': libs\thread\src\win32\thread.cpp:251: error: no match for 'operator=' in 'x. boost::detail::thread_move_t<T>::operator-> [with T = boost::thread]()->boost::thread::thread_info = 0' ./boost/shared_ptr.hpp:194: note: candidates are: boost::shared_ptr<T>& boost::shared_ptr<T>::operator=(const boost::shared_ptr<T>&) [with T = boost::detail::thread_data_base] libs\thread\src\win32\thread.cpp: In member function 'void boost::thread::join()': libs\thread\src\win32\thread.cpp:292: error: 'interruptible_wait' is not a member of 'boost::this_thread' libs\thread\src\win32\thread.cpp:292: error: 'boost::detail::timeout' has not been declared libs\thread\src\win32\thread.cpp:293: error: 'release_handle' was not declared in this scope libs\thread\src\win32\thread.cpp: In member function 'bool boost::thread::timed_join(const boost::system_time&)': libs\thread\src\win32\thread.cpp:302: error: 'interruptible_wait' is not a member of 'boost::this_thread' libs\thread\src\win32\thread.cpp:306: error: 'release_handle' was not declared in this scope libs\thread\src\win32\thread.cpp: In member function 'void boost::thread::detach()': libs\thread\src\win32\thread.cpp:313: error: 'release_handle' was not declared in this scope libs\thread\src\win32\thread.cpp: At global scope: libs\thread\src\win32\thread.cpp:316: error: no 'void boost::thread::release_handle()' member function declared in class 'boost::thread' libs\thread\src\win32\thread.cpp: In member function 'void boost::thread::release_handle()': libs\thread\src\win32\thread.cpp:319: error: no match for 'operator=' in '((boost::thread*)this)->boost::thread::thread_info = 0' ./boost/shared_ptr.hpp:194: note: candidates are: boost::shared_ptr<T>& boost::shared_ptr<T>::operator=(const boost::shared_ptr<T>&) [with T = boost::detail::thread_data_base] libs\thread\src\win32\thread.cpp: In member function 'void boost::thread::interrupt()': libs\thread\src\win32\thread.cpp:327: error: 'struct boost::detail::thread_data_base' has no member named 'interrupt' libs\thread\src\win32\thread.cpp: In member function 'bool boost::thread::interruption_requested() const': libs\thread\src\win32\thread.cpp:334: error: 'boost::detail::win32' has not been declared libs\thread\src\win32\thread.cpp:334: error: 'struct boost::detail::thread_data_base' has no member named 'interruption_handle' libs\thread\src\win32\thread.cpp: In static member function 'static unsigned int boost::thread::hardware_concurrency()': libs\thread\src\win32\thread.cpp:339: warning: missing braces around initializer for '_SYSTEM_INFO::<anonymous union>' libs\thread\src\win32\thread.cpp: At global scope: libs\thread\src\win32\thread.cpp:344: error: 'native_handle_type' in class 'boost::thread' does not name a type libs\thread\src\win32\thread.cpp:360: error: 'timeout' is not a member of 'boost::detail' libs\thread\src\win32\thread.cpp:361: error: expected ',' or ';' before '{' token libs\thread\src\win32\thread.cpp:628: error: expected `}' at end of input libs\thread\src\win32\thread.cpp:628: error: expected `}' at end of input libs\thread\src\win32\thread.cpp:628: error: expected `}' at end of input ./boost/detail/shared_count.hpp: In constructor 'boost::detail::shared_count::shared_count(P, D) [with P = boost::detail::thread_data_base*, D = bool]': ./boost/shared_ptr.hpp:177: instantiated from 'boost::shared_ptr<T>::shared_ptr(Y*, D) [with Y = boost::detail::thread_data_base, D = bool, T = boost::detail::thread_data_base]' libs\thread\src\win32\thread.cpp:135: instantiated from here ./boost/detail/shared_count.hpp:115: error: 'd' cannot be used as a function ./boost/detail/sp_counted_impl.hpp: In member function 'void boost::detail::sp_counted_impl_pd<P, D>::dispose() [with P = boost::detail::thread_data_base*, D = bool]': libs\thread\src\win32\thread.cpp:627: instantiated from here ./boost/detail/sp_counted_impl.hpp:144: error: '((boost::detail::sp_counted_impl_pd<boost::detail::thread_data_base*, bool>*)this)->boost::detail::sp_counted_impl_pd<boost::detail::thread_data_base*, bool>::del' cannot be used as a function "/opt/gcc-4.2.0/bin/g++.exe" -ftemplate-depth-128 -O0 -fno-inline -Wall -g -mthreads -DBOOST_ALL_NO_LIB=1 -DBOOST_THREAD_BUILD_DLL=1 -I"." -c -o "bin.v2\libs\thread\build\gcc-4.2.0\debug\threading-multi\thread.o" "libs\thread\src\win32\thread.cpp" ...failed gcc.compile.c++ bin.v2\libs\thread\build\gcc-4.2.0\debug\threading-multi\thread.o... ...skipped <pbin.v2\libs\thread\build\gcc-4.2.0\debug\threading-multi>boost_thread-gcc42-mt-d-1_35.lib for lack of <pbin.v2\libs\thread\build\gcc-4.2.0\debug\threading-multi>thread.o... ...skipped <pbin.v2\libs\thread\build\gcc-4.2.0\debug\threading-multi>boost_thread-gcc42-mt-d-1_35.dll for lack of <pbin.v2\libs\thread\build\gcc-4.2.0\debug\threading-multi>thread.o... ...failed updating 1 target... ...skipped 2 targets...

"Mat Marcus" <mat-lists@emarcus.org> writes:
It seems that I am unable to build/use boost threads when compiling with gcc-4.2.0 on windows. I get errors:
libs\thread\src\win32\thread.cpp:147: error: 'heap_delete' is not a member of 'boost::detail'
and other (see below). Can someone advise me as to how I can get boost_thread to build under gcc-4.2.0/32-bit XP machine wth boost 1.35.0.
This surprises me: building using your bjam command line with gcc-4.2.1 on 32-bit Windows XP compiles file. Have you got the latest w32api headers on your include path? I use w32api-3.10 from www.mingw.org, but earlier versions should work too. Anthony -- Anthony Williams | Just Software Solutions Ltd Custom Software Development | http://www.justsoftwaresolutions.co.uk Registered in England, Company Number 5478976. Registered Office: 15 Carrallack Mews, St Just, Cornwall, TR19 7UL

On Mon, Apr 14, 2008 at 1:20 AM, Anthony Williams <anthony_w.geo@yahoo.com> wrote:
"Mat Marcus" <mat-lists@emarcus.org> writes:
It seems that I am unable to build/use boost threads when compiling with gcc-4.2.0 on windows. I get errors:
libs\thread\src\win32\thread.cpp:147: error: 'heap_delete' is not a member of 'boost::detail'
and other (see below). Can someone advise me as to how I can get boost_thread to build under gcc-4.2.0/32-bit XP machine wth boost 1.35.0.
This surprises me: building using your bjam command line with gcc-4.2.1 on 32-bit Windows XP compiles file.
Have you got the latest w32api headers on your include path? I use w32api-3.10 from www.mingw.org, but earlier versions should work too.
Anthony
Thanks for the suggestion. I naively followed it, but things haven't improved yet. Let me tell you a little bit more about my configuration. I use a version of bjam built with mscv, since my primary builds on this machine use the MS compiler. But I sometimes need to build with gcc-4.x. I usually run bjam from the cygwin shell, though sometimes I use cmd. I configured and compiled my own gcc-4.2.0 under cygwin. I had not installed the mingw win32 api headers in the past. My user-config.jam contained, amongst other things, the following lines: import toolset : using ; using msvc : 9.0 : "C:\\Program Files\\Microsoft Visual Studio 9.0\\VC\\bin\\cl.exe" ; using msvc : 8.0 : "C:\\Program Files\\Microsoft Visual Studio 8\\VC\\bin\\cl.exe" ; using gcc : 4.2.0 : /opt/gcc-4.2.0/bin/g++.exe : <cxxflags>-I/usr/local/w32api/include/w32api ; using gcc : svn : /opt/conceptgcc-svn/bin/conceptg++.exe ; # concept gcc With the above configuration, using boost 1.34.1, I was able build executables whose jamfiles depended on boost threads with my gcc-4.2.0. Presumably they were built upon the win32 thread functionality, but I didn't check. When I upgraded boost 1.35.0 I lost the ability to use the thread lib with my gcc-4.2.0, and I've been trying to restore it. I tried both win32 and pthread variants from the command line. Neither worked out of the box. I chose to drill down into the win32 flavor first. Following your advice, I went ahead and installed the mingw w32api-3.11. Then I changed my user-config.jam's gcc-4.2.0 to point to the mingw win32api include dir: using gcc : 4.2.0 : /opt/gcc-4.2.0/bin/g++.exe : <cxxflags>-I/usr/local/w32api/include/w32api ; When I invoke: bjam --without-mpi gcc-4.2.0 libs/thread/build//boost_thread -d+2 I see that one of the resulting compilation commands is: "/opt/gcc-4.2.0/bin/g++.exe" -ftemplate-depth-128 -I/usr/local/w32api/include/w32api -O0 -fno-inline -Wall -g -mthreads -DBOOST_ALL_NO_LIB=1 -DBOOST_THREAD_BUILD_DLL=1 -I"." -c -o "bin.v2\libs\thread\build\gcc-4.2.0\debug\threading-multi\thread.o" "libs\thread\src\win32\thread.cpp" But the errors remain: libs\thread\src\win32\thread.cpp: In function 'void boost::<unnamed>::run_thread_exit_callbacks()': libs\thread\src\win32\thread.cpp:147: error: 'heap_delete' is not a member of 'boost::detail' libs\thread\src\win32\thread.cpp:149: error: 'heap_delete' is not a member of 'boost::detail' libs\thread\src\win32\thread.cpp:159: error: 'heap_delete' is not a member of 'boost::detail' ...etc. Sorry if I'm missing something obvious, but could you give me a little more guidance on what specific things I might put in my user-config.jam, or exactly what other actions I take in order to use threads with my gcc-4.2.0 . Thanks, Mat

AMDG Mat Marcus wrote:
Sorry if I'm missing something obvious, but could you give me a little more guidance on what specific things I might put in my user-config.jam, or exactly what other actions I take in order to use threads with my gcc-4.2.0 .
I've run into the same problem. I think the issue is caused by a mismatch between what the configuration headers expect (pthreads) and what the Jamfile expects (win32), but this is just a guess. In Christ, Steven Watanabe

"Mat Marcus" <mat-lists@emarcus.org> writes:
On Mon, Apr 14, 2008 at 1:20 AM, Anthony Williams <anthony_w.geo@yahoo.com> wrote:
"Mat Marcus" <mat-lists@emarcus.org> writes:
It seems that I am unable to build/use boost threads when compiling with gcc-4.2.0 on windows. I get errors:
libs\thread\src\win32\thread.cpp:147: error: 'heap_delete' is not a member of 'boost::detail'
and other (see below). Can someone advise me as to how I can get boost_thread to build under gcc-4.2.0/32-bit XP machine wth boost 1.35.0.
This surprises me: building using your bjam command line with gcc-4.2.1 on 32-bit Windows XP compiles file.
Have you got the latest w32api headers on your include path? I use w32api-3.10 from www.mingw.org, but earlier versions should work too.
Anthony
Thanks for the suggestion. I naively followed it, but things haven't improved yet.
Let me tell you a little bit more about my configuration. I use a version of bjam built with mscv, since my primary builds on this machine use the MS compiler. But I sometimes need to build with gcc-4.x. I usually run bjam from the cygwin shell, though sometimes I use cmd. I configured and compiled my own gcc-4.2.0 under cygwin. I had not installed the mingw win32 api headers in the past.
OK, stop right there. I naively assumed that you would be using the mingw port of gcc like I am. The cygwin port of gcc should use the pthread API by default. You do not need the w32api headers to build boost thread with cygwin and the pthread API. I guess the build problems you're having are because the pthread headers are being chosen, but the build system is choosing the win32 source files. I don't have cygwin on this machine, so could you try building with "threadapi=pthread" on the bjam command line? Anthony -- Anthony Williams | Just Software Solutions Ltd Custom Software Development | http://www.justsoftwaresolutions.co.uk Registered in England, Company Number 5478976. Registered Office: 15 Carrallack Mews, St Just, Cornwall, TR19 7UL

On Mon, Apr 14, 2008 at 10:25 AM, Anthony Williams <anthony_w.geo@yahoo.com> wrote:
"Mat Marcus" <mat-lists@emarcus.org> writes:
On Mon, Apr 14, 2008 at 1:20 AM, Anthony Williams <anthony_w.geo@yahoo.com> wrote:
"Mat Marcus" <mat-lists@emarcus.org> writes:
It seems that I am unable to build/use boost threads when compiling with gcc-4.2.0 on windows. I get errors:
libs\thread\src\win32\thread.cpp:147: error: 'heap_delete' is not a member of 'boost::detail'
and other (see below). Can someone advise me as to how I can get boost_thread to build under gcc-4.2.0/32-bit XP machine wth boost 1.35.0.
This surprises me: building using your bjam command line with gcc-4.2.1 on 32-bit Windows XP compiles file.
Have you got the latest w32api headers on your include path? I use w32api-3.10 from www.mingw.org, but earlier versions should work too.
Anthony
Thanks for the suggestion. I naively followed it, but things haven't improved yet.
Let me tell you a little bit more about my configuration. I use a version of bjam built with mscv, since my primary builds on this machine use the MS compiler. But I sometimes need to build with gcc-4.x. I usually run bjam from the cygwin shell, though sometimes I use cmd. I configured and compiled my own gcc-4.2.0 under cygwin. I had not installed the mingw win32 api headers in the past.
OK, stop right there. I naively assumed that you would be using the mingw port of gcc like I am. The cygwin port of gcc should use the pthread API by default. You do not need the w32api headers to build boost thread with cygwin and the pthread API.
I guess the build problems you're having are because the pthread headers are being chosen, but the build system is choosing the win32 source files.
I don't have cygwin on this machine, so could you try building with "threadapi=pthread" on the bjam command line?
Anthony
I'm pasting the result below. A couple of questions: 1) Why doesn't the build system choose the threadapi=pthread by default in my configuration? (The default seems to be win32) 2) Did 1.35.0 add the requirement over 1.34.1 that I need to download, build, and update my user-config.jam to point to a posix threads library before using boost threads? $ bjam -j2 debug gcc-4.2.0 --without-mpi --without-python threadapi=pthread libs/thread/build//boost_thread warning: Graph library does not contain optional GraphML reader. note: to enable GraphML support, set EXPAT_INCLUDE and EXPAT_LIBPATH to the note: directories containing the Expat headers and libraries, respectively. Building Boost.Regex with the optional Unicode/ICU support disabled. Please refer to the Boost.Regex documentation for more information (don't panic: this is a strictly optional feature). ************************************************************ Trying to build Boost.Thread with pthread support. If you need pthread you should specify the paths. You can specify them in site-config.jam, user-config.jam or in the environment. For example: PTW32_INCLUDE=C:\Program Files\ptw32\Pre-built2\include PTW32_LIB=C:\Program Files\ptw32\Pre-built2\lib ************************************************************ Skipping build of: libs/thread/build/boost_thread <build>no in common properties ...found 1 target...

"Mat Marcus" <mat-lists@emarcus.org> writes:
On Mon, Apr 14, 2008 at 10:25 AM, Anthony Williams <anthony_w.geo@yahoo.com> wrote:
"Mat Marcus" <mat-lists@emarcus.org> writes:
On Mon, Apr 14, 2008 at 1:20 AM, Anthony Williams <anthony_w.geo@yahoo.com> wrote:
"Mat Marcus" <mat-lists@emarcus.org> writes:
It seems that I am unable to build/use boost threads when compiling with gcc-4.2.0 on windows. I get errors:
libs\thread\src\win32\thread.cpp:147: error: 'heap_delete' is not a member of 'boost::detail'
and other (see below). Can someone advise me as to how I can get boost_thread to build under gcc-4.2.0/32-bit XP machine wth boost 1.35.0.
This surprises me: building using your bjam command line with gcc-4.2.1 on 32-bit Windows XP compiles file.
Have you got the latest w32api headers on your include path? I use w32api-3.10 from www.mingw.org, but earlier versions should work too.
Anthony
Thanks for the suggestion. I naively followed it, but things haven't improved yet.
Let me tell you a little bit more about my configuration. I use a version of bjam built with mscv, since my primary builds on this machine use the MS compiler. But I sometimes need to build with gcc-4.x. I usually run bjam from the cygwin shell, though sometimes I use cmd. I configured and compiled my own gcc-4.2.0 under cygwin. I had not installed the mingw win32 api headers in the past.
OK, stop right there. I naively assumed that you would be using the mingw port of gcc like I am. The cygwin port of gcc should use the pthread API by default. You do not need the w32api headers to build boost thread with cygwin and the pthread API.
I guess the build problems you're having are because the pthread headers are being chosen, but the build system is choosing the win32 source files.
I don't have cygwin on this machine, so could you try building with "threadapi=pthread" on the bjam command line?
Anthony
I'm pasting the result below. A couple of questions:
1) Why doesn't the build system choose the threadapi=pthread by default in my configuration? (The default seems to be win32)
Because you're using msvc bjam to build using cygwin gcc. Apparently this build option is broken.
2) Did 1.35.0 add the requirement over 1.34.1 that I need to download, build, and update my user-config.jam to point to a posix threads library before using boost threads?
No. This has always been a requirement if you want to use pthreads on a plain win32 (non-cygwin) compiler. It's just that the detection of cygwin is broken in the jamfile. Can you use a cygwin-built bjam? Anthony -- Anthony Williams | Just Software Solutions Ltd Custom Software Development | http://www.justsoftwaresolutions.co.uk Registered in England, Company Number 5478976. Registered Office: 15 Carrallack Mews, St Just, Cornwall, TR19 7UL

On Mon, Apr 14, 2008 at 12:57 PM, Anthony Williams <anthony_w.geo@yahoo.com> wrote:
"Mat Marcus" <mat-lists@emarcus.org> writes:
On Mon, Apr 14, 2008 at 10:25 AM, Anthony Williams <anthony_w.geo@yahoo.com> wrote:
"Mat Marcus" <mat-lists@emarcus.org> writes:
On Mon, Apr 14, 2008 at 1:20 AM, Anthony Williams <anthony_w.geo@yahoo.com> wrote:
"Mat Marcus" <mat-lists@emarcus.org> writes:
It seems that I am unable to build/use boost threads when compiling with gcc-4.2.0 on windows. I get errors:
libs\thread\src\win32\thread.cpp:147: error: 'heap_delete' is not a member of 'boost::detail'
and other (see below). Can someone advise me as to how I can get boost_thread to build under gcc-4.2.0/32-bit XP machine wth boost 1.35.0.
This surprises me: building using your bjam command line with gcc-4.2.1 on 32-bit Windows XP compiles file.
Have you got the latest w32api headers on your include path? I use w32api-3.10 from www.mingw.org, but earlier versions should work too.
Anthony
Thanks for the suggestion. I naively followed it, but things haven't improved yet.
Let me tell you a little bit more about my configuration. I use a version of bjam built with mscv, since my primary builds on this machine use the MS compiler. But I sometimes need to build with gcc-4.x. I usually run bjam from the cygwin shell, though sometimes I use cmd. I configured and compiled my own gcc-4.2.0 under cygwin. I had not installed the mingw win32 api headers in the past.
OK, stop right there. I naively assumed that you would be using the mingw port of gcc like I am. The cygwin port of gcc should use the pthread API by default. You do not need the w32api headers to build boost thread with cygwin and the pthread API.
I guess the build problems you're having are because the pthread headers are being chosen, but the build system is choosing the win32 source files.
I don't have cygwin on this machine, so could you try building with "threadapi=pthread" on the bjam command line?
Anthony
I'm pasting the result below. A couple of questions:
1) Why doesn't the build system choose the threadapi=pthread by default in my configuration? (The default seems to be win32)
Because you're using msvc bjam to build using cygwin gcc. Apparently this build option is broken.
This begins to sound like the boost-build options and the header file configuration detection options are out of sync, as Steven suggested.
2) Did 1.35.0 add the requirement over 1.34.1 that I need to download, build, and update my user-config.jam to point to a posix threads library before using boost threads?
No. This has always been a requirement if you want to use pthreads on a plain win32 (non-cygwin) compiler. It's just that the detection of cygwin is broken in the jamfile.
Can you use a cygwin-built bjam?
In general no. My workflow includes invoking such commands as: bjam debug release msvc-8.0 msvc-9.0 gcc-4.2.0 It would be a shame to lose the ability to use a single (msvc-built) bjam for all compilation as a result of upgrading to 1.35.0 (The need to use a separate cygwin-built bjam for boost-book is one of the reasons that I avoid using boostbook). But, to try to get to the bottom of things, I did try to create a cygwin-built bjam with 1.35.0. It fails to compile (assertion failure) under cygwin for me at the moment (suing either the cygwin provided gcc or my hand-built gcc-4.2.0). I just posted to the boost build list about that. - Mat

AMDG Mat Marcus wrote:
Because you're using msvc bjam to build using cygwin gcc. Apparently this build option is broken.
This begins to sound like the boost-build options and the header file configuration detection options are out of sync, as Steven suggested.
The default threading api should be determined by toolset rather than by the operating system the build is being run under, IMO. In Christ, Steven Watanabe

"Mat Marcus" <mat-lists@emarcus.org> writes:
On Mon, Apr 14, 2008 at 12:57 PM, Anthony Williams <anthony_w.geo@yahoo.com> wrote:
"Mat Marcus" <mat-lists@emarcus.org> writes:
1) Why doesn't the build system choose the threadapi=pthread by default in my configuration? (The default seems to be win32)
Because you're using msvc bjam to build using cygwin gcc. Apparently this build option is broken.
This begins to sound like the boost-build options and the header file configuration detection options are out of sync, as Steven suggested.
OK, one more thing to try: can you set <target-os>cygwin in your user-config.jam gcc setup? using gcc : 4.2.0 : : <target-os>cygwin ; The boost thread jamfile uses <target-os> to work out whether it's building for cygwin or native win32. It appears that <target-os> is not set correctly for you (which probably ought to be done in gcc.jam or somewhere like that), so explicitly setting it might work. Anthony -- Anthony Williams | Just Software Solutions Ltd Custom Software Development | http://www.justsoftwaresolutions.co.uk Registered in England, Company Number 5478976. Registered Office: 15 Carrallack Mews, St Just, Cornwall, TR19 7UL

On Mon, Apr 14, 2008 at 1:31 PM, Anthony Williams <anthony_w.geo@yahoo.com> wrote:
"Mat Marcus" <mat-lists@emarcus.org> writes:
On Mon, Apr 14, 2008 at 12:57 PM, Anthony Williams <anthony_w.geo@yahoo.com> wrote:
"Mat Marcus" <mat-lists@emarcus.org> writes:
1) Why doesn't the build system choose the threadapi=pthread by default in my configuration? (The default seems to be win32)
Because you're using msvc bjam to build using cygwin gcc. Apparently this build option is broken.
This begins to sound like the boost-build options and the header file configuration detection options are out of sync, as Steven suggested.
OK, one more thing to try: can you set <target-os>cygwin in your user-config.jam gcc setup?
using gcc : 4.2.0 : : <target-os>cygwin ;
The boost thread jamfile uses <target-os> to work out whether it's building for cygwin or native win32. It appears that <target-os> is not set correctly for you (which probably ought to be done in gcc.jam or somewhere like that), so explicitly setting it might work.
Anthony
Thanks for the suggestion. No change yet. 1) I added the parameter to my user-config.jam file using gcc : 4.2.0 : /opt/gcc-4.2.0/bin/g++.exe : <target-os>cygwin ; 2) I added it to my bjam invocation: Result: $ bjam --without-mpi gcc-4.2.0 libs/thread/build//boost_thread -d+2 target-os=cygwin warning: Graph library does not contain optional GraphML reader. note: to enable GraphML support, set EXPAT_INCLUDE and EXPAT_LIBPATH to the note: directories containing the Expat headers and libraries, respectively. WARNING: No python installation configured and autoconfiguration failed. See http://www.boost.org/libs/python/doc/building.html for configuration instructions or pass --without-python to suppress this message and silently skip all Boost.Python targets Building Boost.Regex with the optional Unicode/ICU support disabled. Please refer to the Boost.Regex documentation for more information (don't panic: this is a strictly optional feature). MkDir1 bin.v2\libs\thread\build\gcc-4.2.0\debug\target-os-cygwin mkdir "bin.v2\libs\thread\build\gcc-4.2.0\debug\target-os-cygwin" MkDir1 bin.v2\libs\thread\build\gcc-4.2.0\debug\target-os-cygwin\threading-multi mkdir "bin.v2\libs\thread\build\gcc-4.2.0\debug\target-os-cygwin\threading-multi" gcc.compile.c++ bin.v2\libs\thread\build\gcc-4.2.0\debug\target-os-cygwin\threading-multi\thread.o "/opt/gcc-4.2.0/bin/g++.exe" -ftemplate-depth-128 -O0 -fno-inline -Wall -g -mthreads -DBOOST_ALL_NO_LIB=1 -DBOOST_THREAD_BUILD_DLL=1 -I"." -c -o "bin.v2\libs\thread\build\gcc-4.2.0\debug\target-os-cygwin\threading-multi\thread.o" "libs\thread\src\win32\thread.cpp" libs\thread\src\win32\thread.cpp: In function 'void boost::<unnamed>::run_thread_exit_callbacks()': libs\thread\src\win32\thread.cpp:147: error: 'heap_delete' is not a member of 'boost::detail' libs\thread\src\win32\thread.cpp:149: error: 'heap_delete' is not a member of 'boost::detail' libs\thread\src\win32\thread.cpp:159: error: 'heap_delete' is not a member of 'boost::detail' libs\thread\src\win32\thread.cpp: At global scope: libs\thread\src\win32\thread.cpp:170: error: no 'unsigned int boost::thread::thread_start_function(void*)' member function declared in class 'boost::thread' libs\thread\src\win32\thread.cpp: In member function 'void boost::thread::start_thread()': libs\thread\src\win32\thread.cpp:194: error: ISO C++ forbids taking the address of an unqualified or parenthesized non-static member function to form a pointer to member function. Say '&boost::thread::thread_start_function' libs\thread\src\win32\thread.cpp:194: error: 'struct boost::detail::thread_data_base' has no member nam ...

AMDG Mat Marcus wrote:
OK, one more thing to try: can you set <target-os>cygwin in your user-config.jam gcc setup?
using gcc : 4.2.0 : : <target-os>cygwin ;
The boost thread jamfile uses <target-os> to work out whether it's building for cygwin or native win32. It appears that <target-os> is not set correctly for you (which probably ought to be done in gcc.jam or somewhere like that), so explicitly setting it might work.
Anthony
Thanks for the suggestion. No change yet.
1) I added the parameter to my user-config.jam file using gcc : 4.2.0 : /opt/gcc-4.2.0/bin/g++.exe : <target-os>cygwin ;
2) I added it to my bjam invocation:
The thread Jamfile checks [ os.name ]... In Christ, Steven Watanabe

Steven Watanabe <watanabesj@gmail.com> writes:
AMDG
Mat Marcus wrote:
OK, one more thing to try: can you set <target-os>cygwin in your user-config.jam gcc setup?
using gcc : 4.2.0 : : <target-os>cygwin ;
The boost thread jamfile uses <target-os> to work out whether it's building for cygwin or native win32. It appears that <target-os> is not set correctly for you (which probably ought to be done in gcc.jam or somewhere like that), so explicitly setting it might work.
Anthony
Thanks for the suggestion. No change yet.
1) I added the parameter to my user-config.jam file using gcc : 4.2.0 : /opt/gcc-4.2.0/bin/g++.exe : <target-os>cygwin ;
2) I added it to my bjam invocation:
The thread Jamfile checks [ os.name ]...
Oops. That should be a check on target-os. I don't know jamfile syntax well enough to fix that though --- I don't think <target-os> is available at that point. Anyway, that's the "default API" selection: threadapi=pthread can override that. So: can we try target-os=cygwin threadapi=pthread? Anthony -- Anthony Williams | Just Software Solutions Ltd Custom Software Development | http://www.justsoftwaresolutions.co.uk Registered in England, Company Number 5478976. Registered Office: 15 Carrallack Mews, St Just, Cornwall, TR19 7UL

On Mon, Apr 14, 2008 at 1:53 PM, Anthony Williams <anthony_w.geo@yahoo.com> wrote:
Oops. That should be a check on target-os. I don't know jamfile syntax well enough to fix that though --- I don't think <target-os> is available at that point.
Anyway, that's the "default API" selection: threadapi=pthread can override that.
So: can we try target-os=cygwin threadapi=pthread?
Anthony --
Thanks! That succeeds for now. Ok, so a followup question is, for my (local) boost patch file, what modifications should I make? My goal is to restore the state of affairs to that of 1.34.1: the user didn't need to make any explicit mention of the threadapi or target-os on the command line or in the user-config.jam. Or will I need patches to both the boost thread Jamfile.v2 and the boost build system to restore auto-detection? - Mat

Mat Marcus wrote:
My goal is to restore the state of affairs to that of 1.34.1: the user didn't need to make any explicit mention of the threadapi or target-os on the command line or in the user-config.jam.
I don't think this goal is reasonable. You are doing essentially a cross compile, so you need to specify the essential parts, which is <target-os> and <threadapi>. Else the build system cannot support all variants. -- _________________________________________ _ _ | Roland Schwarz |_)(_ | aka. speedsnail | \__) | mailto:roland.schwarz@chello.at ________| http://www.blackspace.at
participants (4)
-
Anthony Williams
-
Mat Marcus
-
Roland Schwarz
-
Steven Watanabe