Boost logo

Boost Users :

Subject: Re: [Boost-users] order of headers with Boost.Serialization and Boost.MPI
From: Matthias Troyer (troyer_at_[hidden])
Date: 2010-10-25 05:10:58


On Oct 24, 2010, at 9:55 PM, Riccardo Murri wrote:

> Sorry, this time with attachments.
>
> On Sun, Oct 24, 2010 at 9:52 PM, Riccardo Murri
> <riccardo.murri_at_[hidden]> wrote:
>> Hi Matthias,
>>
>> On Sun, Oct 24, 2010 at 3:38 PM, Matthias Troyer <troyer_at_[hidden]> wrote:
>>> Unfortunately your example is not self-contained and I thus cannot reproduce the problem
>>>
>>
>> Here's all files needed to compile the example (gmp.h and gmpxx.h come
>> from GMP 5.0.1);
>> I get errors if I include GMP [include block (3) in foo.c] _before_
>> Boost.MPI [include block (2)].
>> A dump of the compiler errors is in files errorsXXX.txt (where XXX =
>> order of the include blocks in foo.c)
>>
>> In the real code the situation is actually worse, because depending on
>> the order of includes I either get errors like those in the attached
>> dumps, or the compiler complains that there is no `serialize` method
>> in class `mpq_class` (true, indeed I'm trying to use the non-intrusive
>> approach). I've not been able -so far- to distil a minimal example
>> that reproduces exactly the problem I'm having with the real code...
>>
>> I'm using Boost 1.44.0 on GCC 4.4.5 (Ubuntu 10.10).
>>
>> Thanks for any help!

Hi Riccardo,

This is not a Boost.MPI issue since the same problem occurs if I remove all of the Boost.MPI headers.
Looking deeper into your code I find that the actual problem is that you call the macro BOOST_SERIALIZATION_SPLIT_FREE inside the namespace boost::serialization. It has to be called from outside of any namespace. Once I make that change your code compiles for me.

Matthias


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net