[C++-sig] Boost.Python, AIX, and gcc

Ralf W. Grosse-Kunstleve rwgk at yahoo.com
Tue Nov 4 05:04:24 CET 2003


--- "J. Michael Owen" <mikeowen at llnl.gov> wrote:
> > Index: boost/type_traits/type_with_alignment.hpp
> ===================================================================
> RCS file: /cvsroot/boost/boost/boost/type_traits/type_with_alignment.hpp,v
> retrieving revision 1.14
> diff -u -r1.14 type_with_alignment.hpp
> --- boost/type_traits/type_with_alignment.hpp	3 Sep 2003 15:19:12 -0000	1.14
> +++ boost/type_traits/type_with_alignment.hpp	4 Nov 2003 00:31:00 -0000
> @@ -132,7 +132,7 @@
>  
>      BOOST_STATIC_CONSTANT(std::size_t, found =
> alignment_of<align_t>::value);
>  
> -#if !(defined(__APPLE__) && defined(__MACH__) && defined(__GNUC__))
> +#if !(((defined(__APPLE__) && defined(__MACH__)) || defined(_AIX)) &&
> defined(__GNUC__))
>      BOOST_STATIC_ASSERT(found >= Align);
>      BOOST_STATIC_ASSERT(found % Align == 0);
>  #endif

I am afraid I am responsible for the __APPLE__ hack. It would be good if we
could get rid of this. Could you please try this:

--- Douglas Gregor <gregod at cs.rpi.edu> wrote:
> My apologies for the very late reply. I was away for a while and am still
> sorting through my inbox...
> 
> > Platform:
> >   Mac OS 10.2
> >   gcc 3.3 compiled from sources
> >   boost cvs from last Friday
> >
> > When porting the Boost.Python bindings for some custom libraries I ran
> > into a problem with static asserts in type_with_alignment.hpp:
> [snip patch]
> > This patch allows me to compile and link, and our regression test
> > runs fine.
> >
> > Reducing my code to a minimal test is most likely a time-consuming
> > project that I'd like to avoid if possible (compilation is quite slow
> > to make things worse). Do the authors of the code above have any ideas
> > what could be going wrong? Are there things that I could try first
> > before chopping my code into pieces?
> 
> If you could figure out what alignment value you're trying to get a type for
> it would help greatly. One way you could do it would be to replace the
> static assertion lines with something that will halt the compile and give
> back the Align value in an error message, e.g.,
> 
> // somewhere
> template<bool DontPrintIt, std::size_t Align> struct maybe_print_align {
> typedef void type; }
> template<std::size_t Align> struct maybe_print_align<false, Align> {};
> 
> // instead of the static asserts:
> typedef typename maybe_print_align<(found >= Align), Align>::type foobar;
> 
> Note that when those static asserts fail, it means that you aren't getting
> back a type with the right alignment.
> 
>     Doug



Here is the result for the Mac:

From: "Ralf W. Grosse-Kunstleve" <rwgk at yahoo.com>
To: "Boost mailing list" <boost at lists.boost.org>
Sent: Saturday, June 07, 2003 5:50 AM
Subject: Re: [boost] Mac OS 10 & type_traits/type_with_alignment.hpp

> --- Douglas Gregor <gregod at cs.rpi.edu> wrote:
> /var/tmp/mac/boost/boost/type_traits/type_with_alignment.hpp:120:
> error: no type named `type' in `boost::maybe_print_align<false, 8, 4>'

So you have a type that is 8-byte aligned, but we don't have any types in
the list of possible types that have an alignment of 8 on that architecture,
so it fails. We'll just have to find a type that has 8-byte alignment and
add it to the list. I'll see if I can dig one up tomorrow.

    Doug


As of today we are still waiting. Maybe if we can give Doug a little more
incentive he'll be able to help.

Ralf


__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree




More information about the Cplusplus-sig mailing list