Upgrade boost from 1.55 to 1.60

This wiki page is based on the following bug-request:

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=199601#c27

Port failures with 1.55

Patch/PR

Notes

databases/mariadb100-server:build

PR 207094

databases/mariadb55-server:package

PR 207115

games/supertux2:build

Unrelated, fails on 10.x anyway, marked BROKEN

lang/sdcc-devel:build

Committed r408498

truckmans' logs for the following list: https://people.freebsd.org/~truckman/boost-1.60_fallout/r405759/FreeBSD-10.1-amd64/

Port failures with 1.60

Patch/PR

Notes

audio/clementine-player:build

Committed r408472

audio/csound6:build

Committed r408418

cad/openscad:build

Committed r408473

databases/sfcgal:build

Committed r408549

deskutils/kdepim4:build

Fixed by qt4-moc patch

deskutils/pinot:build

Committed r408912

devel/avro-cpp:build

Committed r408476

devel/codeblocks:build

Committed r408415

devel/kdevplatform:build

Fixed by qt4-moc patch

devel/luabind:build

Committed r406614

devel/msp430-debug-stack:build

Committed r408552

editors/openoffice-devel:build

Committed r408611, also PR 207073

finance/ledger:build

Committed r409549

games/allacrost:build

Committed r406614

games/plee-the-bear:build

games/pokerth:build

Committed r408412

games/traingame:build

Committed r408413

games/valyriatear:build

Committed r406614

graphics/aqsis:build

Committed r408475

graphics/evolvotron:build

Committed r408419

graphics/mapnik:build

Committed r410719

graphics/mitsuba:build

Committed r408995

graphics/py-openimageio:build

Committed r410146

graphics/scantailor:build

Committed r408592

lang/sdcc:build

Committed r408498

math/pdal:build

PR 207059

May be switched to internal boost for the time being, but needs update

multimedia/gstreamer-qt4:build

Committed r408773

multimedia/gstreamer1-qt4:build

PR 207144

net-p2p/namecoin:build

Committed r408474

science/avogadro:build

Committed r408502

security/quantis:build

Fixed by qt4-moc patch

textproc/libabw:build

Committed r409560

textproc/libe-book00:build

PR 207017

Deprecated

textproc/libe-book:build

Committed r409567

textproc/libvisio:build

PR 206999

Deprecated

textproc/luceneplusplus:build

Committed r408572

www/anyterm:build

Committed r408416

x11/leechcraft:build

Fixed by qt4-moc patch

Common problems

luabind

error: no matching function for call to 'operator!='
note: in expansion of macro 'LUABIND_OPERATOR_ADL_WKND'
   LUABIND_OPERATOR_ADL_WKND(!=)
   ^

This is luabind problem (probably in bundled version of luabind).

Examples: devel/luabind, games/allacrost, games/valyriatear

Solution: you need to patch luabind/object.hpp like this

qt4 moc

Parse error at "BOOST_JOIN"

Qt4's moc fails to parse macros in namespace declarations, like this in boost/type_traits/detail/has_binary_operator.hpp:

namespace BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl) {

There is an upstream bug about this and it is fixed in Qt 5, but there are no plans to backport the fix to Qt 4.

Examples: audio/clementine-player, cad/openscad, graphics/evolvotron

Solution: It is possible to solve the problem in two different ways:

1. Make moc automatically define the include guards for the headers that ultimately include the other headers that use namespace BOOST_JOIN, so that moc does not include them and does not fail to process a port's includes. It involves some trial and error to find out which headers must be skipped. It helps to replace the moc-qt4 invocation with c++ -E to see which headers are being included where. Once you have figured out which headers must be skipped, edit devel/qt4-moc/files/patch-src__tools__moc__main.cpp and add their include guards to the list.

2. Instead of changing moc, wrap the Boost includes in a port within an #ifndef Q_MOC_RUN block so that moc just skips them when processing a port's source code.

#ifndef Q_MOC_RUN
#include <boost/...>
#endif

It can be quicker than the other solution, but requires patching a lot of files in many different ports.

file streams

error: reference to 'ifstream' is ambiguous

Namespace conflict between std::ifstream and boost::filesystem::ifstream (or ofstream).

Examples: games/pokerth, games/traingame

Solution: resolve the conflict by using fully qualified name. Since boost/filesystem/fstream.hpp is included only in newer boost, it is likely that std streams are actually meant, so you need to replace [io]fstream mentions by std::[io]fstream correspondingly:

        @${FIND} ${WRKSRC} -name '*.cpp' -print0 | ${XARGS} -0 \
                ${REINPLACE_CMD} -e 's|[io]fstream|std::&|'

missing symbols

undefined reference to `boost::system::generic_category()'

Examples: devel/codeblocks, www/anyterm

Solution: link with needed boost libraries

LIBS+=          -L${LOCALBASE}/lib -lboost_system

PFTO

It was a hack for broken old compilers, no op on actual clang and gcc that we use.

Examples: graphics/aqsis

Solution: just remove pfto.hpp includes and BOOST_MAKE_PFTO_WRAPPER.

boost test

error: use of undeclared identifier 'BOOST_CHECKPOINT'

This is deprecated API which was removed in 1.60 or earlier. See this.

Examples: devel/avro-cpp

Solution: Replace BOOST_CHECKPOINT with BOOST_TEST_CHECKPOINT, BOOST_MESSAGE with BOOST_TEST_MESSAGE, BOOST_BITWISE_EQUAL with BOOST_CHECK_BITWISE_EQUAL.

ice

/usr/local/include/boost/graph/adjacency_matrix.hpp:446:5: error: type name requires a specifier or qualifier
    BOOST_STATIC_ASSERT(type_traits::ice_not<(is_same<Directed, bidirectionalS>::value)>::value);
    ^

Examples: databases/sfcgal (actually math/cgal)

Solution: Bug in boost. Need to explicitly include <boost/type_traits/ice.hpp> for boost 1.60

+// Workaround for boost bug #11880
+#include <boost/version.hpp>
+#if BOOST_VERSION == 106000
+       #include <boost/type_traits/ice.hpp>
+#endif

BoostPortingProject/1.55-to-1.60 (last edited 2016-07-21 10:26:25 by BorisSamorodov)