Opened 16 years ago

Closed 14 years ago

#77 closed Bugs (Fixed)

config needed for AIX - gcc

Reported by: cpqlvc Owned by: John Maddock
Milestone: Component: config
Version: None Severity:
Keywords: Cc:

Description

It looks like Boost.Threads is not configured 
for the platform / compiler combination AIX / gcc.  
I'm trying to compile Boost.Threads on a RS/6000 box 
running AIX 4.3 under gcc 2.95.3.  On my first attempt 
to compile condition.cpp, I got the following error 
message:

(27_0/libs/thread/src)$ g++ -g -Wall -W -c -I../../.. 
condition.cpp
In file included from ../../../boost/limits.hpp:15,
                 from condition.cpp:16:
../../../boost/detail/limits.hpp:55: #error The file 
boost/detail/limits.hpp needs to be set up for your 
CPU type.
(27_0/libs/thread/src)$ 

Above the #error is a #ifndef that tests for 
the definition of several macros.  Under g++ 
__powerpc__ is not defined, but _POWER is; so, I added 
a defined(_POWER) to the list of conditions.

The next problem that I ran into is that 
select_platform_config.hpp only includes aix.hpp if 
__IBMCPP__ is defined.  This macro is not defined 
under g++.  As a temporary hack I defined this macro 
on the command line.  Fortunately the series of #elif 
in select_compiler_config.hpp selected gcc.hpp, so I 
got the right platform (aix.hpp) and compiler 
(gcc.hpp).

aix.hh #define's BOOST_HAS_PTHREAD_YIELD.  In 
thread.cpp thread::yield() this causes  pthread_yield
() to be invoked.  Unfortunately (for 
me) /usr/include/pthread.h looks like 

#ifdef _AIX_PTHREADS_D7
extern void
pthread_yield __((void));
#endif

and _AIX_PTHREADS_D7 is not defined.  To workaround 
this problem I defined BOOST_HAS_SCHED_YIELD on the 
command line.

I don't know whether my little workarounds / command 
line hacks are correct.  By documenting this problem 
I'm hoping that Boost.Threads will be updated to 
support AIX / gcc.

Thanks,

Doug

Change History (2)

comment:1 Changed 16 years ago by cpqlvc

Logged In: YES 
user_id=525108

After fumbling around (see above) I ran the configure 
script, creating a user.hpp file.  Unfortunately...
 1) This does not fix the #error problem in 
boost/limits.hpp.
 2) The first #define in user.hpp is 
#define BOOST_NO_CONFIG
This disables the inclusion of gcc.hpp, which #define's
BOOST_HAS_THREADS.  Attempting to compile the source code 
in the threads library results in 

../../../boost/thread/thread.hpp:17: #error Thread support 
is unavailable!
In file included from ../../../boost/thread/thread.hpp:22,

I commented-out the 
#define BOOST_NO_CONFIG
in user.hpp, and now all threads files compile under 
AIX 4.3/ gcc 2.95.3

comment:2 Changed 14 years ago by John Maddock

Status: assignedclosed
Logged In: YES 
user_id=14804

This is should be fixed in the current cvs state.

John Maddock
Note: See TracTickets for help on using tickets.