How to build boost threads library on AIX 4.3.3 with VisualAge 5
Building Boost on AIX is difficult. Here's a recipe that worked for me, for building on the following platform: Boost source download version 28 AIX 4.3.3 on RS/6000 VisualAge 5.0 Jam: downloaded binary of Boost.Jam Version 3.1.0. OS=AIX. bash shell Building Boost Setup: Downloaded version 28 tar.gz file to ~/boost. Un-gzipped and untarred. Set export BOOST_ROOT=/home/satherb/boost/boost_1_28_0 Attempt: jam "-sTOOLS=vacpp" Result: Many compilation errors, in building of regexp library. For example: Error: "libs/regex/build/../src/cpp_regex_traits.cpp", line 196.39: 1540-0257 (S) An object or reference of type "std::messages_base::catalog" cannot be initialized with an expression of type "int". Attempt: in cpp_regex_traits.cpp", line 196, changed "-1" to "(size_t) 1" Result: compiler says "cannot be initialised with type unsigned long." for the same line. Attempt: Noted that www.boost.org says that threads lib does not depend on regex or python. Edited Jamfile to comment out unnecessary targets python and regex. Result: Most errors are "Thread support is unavailable". Looking at source indicates this is because BOOST_HAS_THREADS macro is undefined. Attempt: export BOOST_HAS_THREADS=1 Result: same errors. Attempt: run ./configure Result: configure gives error message that says "compiler does not produce output" (or something like that) However, running configure again worked! Here were the recent settings of environmental variables: export BOOST_ROOT=/home/satherb/boost/boost_1_28_0 export _MT=1 export CC=xlC_r export CXX=xlC export _POSIX_THREADS=1 export LIBS=-lpthread (I don't know which of these was the key. If you discover the answer, please let me know.) Attempt: Did as configure suggested: "Adjustments to boost configuration have been written to user.hpp, copy this to boost/config/user.hpp to use "as is" " Result: jam still gives "Thread support is unavailable" errors. Attempt: added a line to boost/config/user.hpp: #define BOOST_HAS_THREADS Result: builds! (Don't know yet if it works properly, of course. The examples don't build.) Bob Sather bob.sather@lloydstsb.delete_this_part.co.uk
Hi!
Yesterday, I posted a new vacpp-tools.jam to the boost build list.
You should use this because it selects the correct compile for
the threading model needed.
I'm not sure if the boost vacpp configuration is currently correct.
I did the same as you. But you should do
sh configure --with-boost=
--- In Boost-Users@y..., Markus Schöpflin
Hi!
Yesterday, I posted a new vacpp-tools.jam to the boost build list. <snip> As for the regex error, I posted something to the dev list yesterday but received no answers so far.
HTH, Markus
I assume that the boost build list and the dev list are mailing lists. How do I subscribe? Bob Sather bob.sather@lloydstsb.remove_this_part.co.uk
On Thursday, September 12, 2002, at 09:49 AM, robertpsather wrote:
I assume that the boost build list and the dev list are mailing lists. How do I subscribe?
Information about the boost development list is at http://boost.org/more/mailing_lists.htm I don't know how to subscribe to the build list. -- Darin
robertpsather wrote:
--- In Boost-Users@y..., Markus Schöpflin
wrote: Hi!
Yesterday, I posted a new vacpp-tools.jam to the boost build list. <snip> As for the regex error, I posted something to the dev list yesterday but received no answers so far.
HTH, Markus
I assume that the boost build list and the dev list are mailing lists. How do I subscribe?
Check out the boost web page for the mailing lists. The boost.build list is a yahoo groups list. I think it's called "jamboost" or something like this. It's also carried by the gmane news server. Markus
--- In Boost-Users@y..., "robertpsather"
Building Boost on AIX is difficult. Here's a recipe that worked for me, for building on the following platform: Boost source download version 28 AIX 4.3.3 on RS/6000 VisualAge 5.0 Jam: downloaded binary of Boost.Jam Version 3.1.0. OS=AIX. bash shell
Building Boost
Setup: Downloaded version 28 tar.gz file to ~/boost. Un-gzipped and untarred. Set export BOOST_ROOT=/home/satherb/boost/boost_1_28_0 Attempt: jam "-sTOOLS=vacpp" Result: Many compilation errors, in building of regexp library. For example: Error: "libs/regex/build/../src/cpp_regex_traits.cpp", line 196.39: 1540-0257 (S) An object or reference of type "std::messages_base::catalog" cannot be initialized with an expression of type "int". Attempt: in cpp_regex_traits.cpp", line 196, changed "-1" to "(size_t) 1" Result: compiler says "cannot be initialised with type unsigned long." for the same line. Attempt: Noted that www.boost.org says that threads lib does not depend on regex or python. Edited Jamfile to comment out unnecessary targets python and regex.
Not needed. If you need to compile only a part of Boost using bjam, all you have to do is switch to the appropriate build directory (in this case $BOOST_ROOT/libs/thread/build) and execute bjam there.
Result: Most errors are "Thread support is unavailable". Looking at source indicates this is because BOOST_HAS_THREADS macro is undefined. Attempt: export BOOST_HAS_THREADS=1
Generally a bad idea. BOOST_HAS_THREADS should be defined by
Result: same errors. Attempt: run ./configure Result: configure gives error message that says "compiler does not produce output" (or something like that) However, running configure again worked! Here were the recent settings of environmental variables: export BOOST_ROOT=/home/satherb/boost/boost_1_28_0 export _MT=1 export CC=xlC_r export CXX=xlC export _POSIX_THREADS=1 export LIBS=-lpthread
(I don't know which of these was the key. If you discover the answer, please let me know.)
Several of those are important. My understanding is that xlC_r turns on MT support for your platform, while _MT and _POSIX_THREADS are what cause BOOST_HAS_THREADS to be defined and -lpthread is the magic that makes linking a multi-threaded application work.
Attempt: Did as configure suggested: "Adjustments to boost configuration have been written to user.hpp, copy this to boost/config/user.hpp to use "as is" " Result: jam still gives "Thread support is unavailable" errors. Attempt: added a line to boost/config/user.hpp: #define BOOST_HAS_THREADS Result: builds!
That sounds like it might be a minor bug in the configure script, but Mr. Maddock can talk more authoritatively about that.
(Don't know yet if it works properly, of course. The examples don't build.)
If the library builds, the examples (and more importantly, the tests) should. Bill Kempf
Result: jam still gives "Thread support is unavailable" errors. Attempt: added a line to boost/config/user.hpp: #define BOOST_HAS_THREADS Result: builds!
Just defining BOOST_HAS_THREADS probably won't get things working - you need to set the right compiler switches to ensure that the compiler really is building multithreaded code, however Jam should do this for you, so my guess is that the vacc toolset description is wrong. Maybe someone familiar with the compiler/platform can jump in here and indicate what the problem with vacc-tools.jam is.
Afterwards you have to manually set BOOST_HAS_THREADS as you discovered by yourself. This is because the configure script discovers that POSIX threads are available by the configure system doesn't set BOOST_HAS_THREADS itself. Maybe it should? You should ask John Maddock about it.
It's not supposed to set it - the config system will still check for _REENTRANT and/or _MT etc to see if the compiler is in multi-thread mode, if vacpp sets some other define then let me know and I'll update the config system. John Maddock http://ourworld.compuserve.com/homepages/john_maddock/index.htm
--- In Boost-Users@y..., "John Maddock"
Just defining BOOST_HAS_THREADS probably won't get things working - you need to set the right compiler switches to ensure that the compiler really is building multithreaded code, however Jam should do this for you, so my guess is that the vacc toolset description is wrong. <snip> The config system will still check for _REENTRANT and/or _MT etc to see if the compiler is in multi-thread mode, if vacpp sets some other define then let me know and I'll update the config system.
John Maddock
When you run the Visual Age compiler in multi-thread mode it sets _THREAD_SAFE but not _MT or _REENTRANT. How do I update the boost/jam configuration to recognise this? Bob Sather bob.sather@lloydstsb.omit_this_part.co.uk
John Maddock wrote:
Afterwards you have to manually set BOOST_HAS_THREADS as you discovered by yourself. This is because the configure script discovers that POSIX threads are available by the configure system doesn't set BOOST_HAS_THREADS itself. Maybe it should? You should ask John Maddock about it.
It's not supposed to set it - the config system will still check for _REENTRANT and/or _MT etc to see if the compiler is in multi-thread mode, if vacpp sets some other define then let me know and I'll update the config system.
The config system checks for _THREAD_SAFE in the file "compiler/vacpp.hpp" but not in "suffix.hpp". Therefore it does work if you use the supplied configuration but it doesn't work if you use your own config file. It would be great if you could add this check. Thanks, Markus
The config system checks for _THREAD_SAFE in the file "compiler/vacpp.hpp" but not in "suffix.hpp". Therefore it does work if you use the supplied configuration but it doesn't work if you use your own config file.
It would be great if you could add this check.
Yep, I'll update the configure script to generate the necessary checks, Thanks, John Maddock http://ourworld.compuserve.com/homepages/john_maddock/index.htm
participants (5)
-
bill_kempf
-
Darin Adler
-
John Maddock
-
Markus Schöpflin
-
robertpsather