Opened 12 years ago

Closed 12 years ago

#4987 closed Bugs (fixed)

pch.hpp.gch build fails with boost::swap' has not been declared in boost::optional

Reported by: Peter Schueller <schueller.p@…> Owned by: Andrey Semashev
Milestone: To Be Determined Component: optional
Version: Boost Release Branch Severity: Showstopper
Keywords: Cc: schueller.p@…

Description

Starting on 13th of december, nightly tests for some software I maintain started to fail with boost release because boost release does not build anymore:

The full log is here

http://www.kr.tuwien.ac.at/pg/ps/dlvhex/nightly/build_withboost_2010-12-15_06:00.txt

The error is

...patience... ...found 6165 targets... ...updating 667 targets... common.mkdir stage common.mkdir stage/lib common.mkdir bin.v2/libs/iostreams common.mkdir bin.v2/libs/iostreams/build common.mkdir bin.v2/libs/iostreams/build/gcc-4.2.1 common.mkdir bin.v2/libs/iostreams/build/gcc-4.2.1/release common.mkdir bin.v2/libs/iostreams/build/gcc-4.2.1/release/threading-multi gcc.compile.c++ bin.v2/libs/iostreams/build/gcc-4.2.1/release/threading-multi/file_descriptor.o gcc.compile.c++ bin.v2/libs/iostreams/build/gcc-4.2.1/release/threading-multi/mapped_file.o gcc.compile.c++ bin.v2/libs/iostreams/build/gcc-4.2.1/release/threading-multi/zlib.o gcc.compile.c++ bin.v2/libs/iostreams/build/gcc-4.2.1/release/threading-multi/gzip.o gcc.compile.c++ bin.v2/libs/iostreams/build/gcc-4.2.1/release/threading-multi/bzip2.o gcc.link.dll bin.v2/libs/iostreams/build/gcc-4.2.1/release/threading-multi/libboost_iostreams.so.1.46.0 common.copy stage/lib/libboost_iostreams.so.1.46.0 ln-UNIX stage/lib/libboost_iostreams.so common.mkdir bin.v2/libs/math/build common.mkdir bin.v2/libs/math/build/gcc-4.2.1 common.mkdir bin.v2/libs/math/build/gcc-4.2.1/release common.mkdir bin.v2/libs/math/build/gcc-4.2.1/release/threading-multi common.mkdir bin.v2/libs/math/build/gcc-4.2.1/release/threading-multi/.. common.mkdir bin.v2/libs/math/build/gcc-4.2.1/release/threading-multi/../src common.mkdir bin.v2/libs/math/build/gcc-4.2.1/release/threading-multi/../src/tr1 gcc.compile.c++.pch bin.v2/libs/math/build/gcc-4.2.1/release/threading-multi/../src/tr1/pch.hpp.gch In file included from ./boost/optional.hpp:15,

from ./boost/format/internals.hpp:20, from ./boost/format.hpp:38, from ./boost/math/policies/error_handling.hpp:30, from ./boost/math/special_functions/acosh.hpp:21, from ./boost/math/special_functions.hpp:15, from libs/math/build/../src/tr1/pch.hpp:9:

./boost/optional/optional.hpp: In member function 'void boost::optional<T>::swap(boost::optional<T>&)': ./boost/optional/optional.hpp:618: error: 'boost::swap' has not been declared

"g++" -x c++-header -O3 -finline-functions -Wno-inline -Wall -pthread -fPIC -fvisibility=hidden -DBOOST_ALL_NO_LIB=1 -DBOOST_BUILD_PCH_ENABLED -DBOOST_MATH_TR1_DYN_LINK=1 -DNDEBUG -I"." -I"libs/math/src/tr1" -c -o "bin.v2/libs/math/build/gcc-4.2.1/release/threading-multi/../src/tr1/pch.hpp.gch" "libs/math/build/../src/tr1/pch.hpp"

Change History (7)

comment:1 by Peter Schüller <schueller.p@…>, 12 years ago

now also reproduced on different machine:

[67280] release branch fails to build with

./bootstrap.sh
./bjam

now more succinct and better formatted error message:

gcc.compile.c++.pch bin.v2/libs/math/build/gcc-4.3/release/threading-multi/../src/tr1/pch.hpp.gch
In file included from ./boost/optional.hpp:15,
                 from ./boost/format/internals.hpp:20,
                 from ./boost/format.hpp:38,
                 from ./boost/math/policies/error_handling.hpp:30,
                 from ./boost/math/special_functions/acosh.hpp:21,
                 from ./boost/math/special_functions.hpp:15,
                 from libs/math/build/../src/tr1/pch.hpp:9:
./boost/optional/optional.hpp: In member function ‘void boost::optional<T>::swap(boost::optional<T>&)’:
./boost/optional/optional.hpp:618: error: ‘boost::swap’ has not been declared

    "g++" -x c++-header -O3 -finline-functions -Wno-inline -Wall -pthread -fPIC -fvisibility=hidden -DBOOST_ALL_NO_LIB=1 -DBOOST_BUILD_PCH_ENABLED -DBOOST_MATH_TR1_DYN_LINK=1 -DNDEBUG -I"." -I"libs/math/src/tr1" -c -o "bin.v2/libs/math/build/gcc-4.3/release/threading-multi/../src/tr1/pch.hpp.gch" "libs/math/build/../src/tr1/pch.hpp"

...failed gcc.compile.c++.pch bin.v2/libs/math/build/gcc-4.3/release/threading-multi/../src/tr1/pch.hpp.gch...

comment:2 by Peter Schüller <schueller.p@…>, 12 years ago

possibly introduced by [67183]?

r67183 | andysem | 2010-12-12 12:34:12 +0100 (Sun, 12 Dec 2010) | 1 line
Changed paths:
   M /branches/release/boost/optional/optional.hpp
   M /branches/release/boost/optional/optional_io.hpp
   M /branches/release/libs/optional/test/optional_test.cpp
   M /branches/release/libs/optional/test/optional_test_io.cpp

Merged changes from trunk. Fixes #3395. Also updates swap behavior: if default constructor has no-throw guarantee, swap will use it to pr
ovide no-throw guarantee itself. operator>> behavior changed slightly so that the stream is not accessed when unrecognized character sequ
ence is detected. The stream is marked with failbit in such a case.

comment:3 by Peter Schüller <schueller.p@…>, 12 years ago

Owner: set to Andrey Semashev

reassigning to andysem on a hunch

comment:4 by Andrey Semashev, 12 years ago

(In [67288]) Refs #4987. Added forward declaration of namespace-scope swap for boost::optional, this should fix GCC compilation errors. Also swap implementation now uses Boost.Utility.Swap to make use of the workarounds for some broken compilers. If it breaks for your compiler, let me know in the mentioned ticket.

comment:5 by Andrey Semashev, 12 years ago

Component: Building Boostoptional
Status: newassigned

Could you please verify that the trunk version works for you now?

comment:6 by Peter Schüller <schueller.p@…>, 12 years ago

trunk [67294] builds nicely, but trunk built nicely before!

after doing a

svn merge http://svn.boost.org/svn/boost/trunk -c 67288

the release branch now also works for me.

Please merge your fix into the release branch, then everything should be fixed.

Thanks a lot!

comment:7 by Andrey Semashev, 12 years ago

Resolution: fixed
Status: assignedclosed

(In [67307]) Merged changes from trunk: add namespace scope swap forward declaration to fix member swap copmilation. Swap implementation now uses Boost.Utility.Swap. Fixes #4987.

Note: See TracTickets for help on using tickets.