|
Boost : |
Subject: Re: [boost] [serialization]cannot build libboost_serialization.so.1.60.0 with Oracle Solaris Studio
From: Robert Ramey (ramey_at_[hidden])
Date: 2015-10-27 13:42:59
On 10/27/15 8:16 AM, Aparna Kumta wrote:
> I see the following error when compiling Boost 1.60 in develop branch
> with Oracle Solaris Studio development compiler with -library=stlport4.
>
> "CC" -compat=5 -library=stlport4 -temp=/tmp/bn -xO4 -mt
> -erroff=%none -m32 -DBOOST_ALL_NO_LIB=1 -DNDEBUG -I".." -c -o
> "/export/home/sstrunk-tester/boost_regression/boost_regression_develop/boost_sparc-S2_stlport4/results/boost/bin.v2/libs/serialization/build/sun-next_stlport4/release/link-static/threading-multi/basic_text_iprimitive.o"
> "../libs/serialization/src/basic_text_iprimitive.cpp"
>
> "../boost/archive/basic_streambuf_locale_saver.hpp", line 75: Error:
> sync is not a member of std::ios .
> "../boost/archive/impl/basic_text_iprimitive.ipp", line 112: Where:
> While instantiating "boost::archive::basic_ios_locale_saver<char,
> std::char_traits<char>>::~basic_ios_locale_saver()".
> "../boost/archive/impl/basic_text_iprimitive.ipp", line 112: Where:
> Instantiated from
> boost::archive::basic_text_iprimitive<std::istream>::basic_text_iprimitive(std::istream
> &, bool).
> "../libs/serialization/src/basic_text_iprimitive.cpp", line 25: Where:
> Instantiated from non-template code.
> 1 Error(s) detected.
>
> This seems to prevent building libboost_serialization.so.1.60.0, and a
> recent regression after changes to the serialization library.
OK - I'm working on this. Problem is I'm trying to figure out what to
do that works with 4 standard library implementations.
libstdc++, libc+, cppreference, N3797.pdf, and msvc seem to have
different requirements for invoking imbue to change a codecvt facet.
a) libstdc++ declares and defines sync() function on basic_istream but
not on basic_ostream. It requires sync() to be called before hand or
the program crashes in a very difficult to find manner.
b) cppreference shows (pub)sync as a member of streambuf and stream.
The latter is through inheritence from ios_base.
c)libc++ doesn't have any reference documentation that I can find
d) n3797.pdf shows (pub)sync() as a member of streambuf but not as part
of (i/o)stream
e) MSVC - this has always just worked so I don't know anything about it
f) stlport - I haven't even looked at this until now.
as far as I can tell, streambuf have (pub)sync() declared and defined in
all of the libraries. So one would think that all he has to do is to
apply the (pub)sync and (pub)imbue to the streambuf and be done with it
it. Well, one would be wrong. Spelunking the library source code, it
seems that at least in a) and c) the stream caches the locale as well as
passing on to the the streambuf. This suggests that the locale should
be changed at the stream level when the library implements it (contrary
to the standard.) And in fact, if one fails to call sync() at the
stream level in a) (at least on input) the program will crash in a
particularly hard to detect manner.
It's hard to convey how much time and frustration is consumed in the
tracking down of this stuff. Making a Boost library that is widely used
is much, much harder than most people think.
Thanks for letting me know about this.
Robert Ramey
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk