Page 1 of 2

Boost 1.53

Posted: 02 Apr 2013, 02:30
by bwrsandman
Archlinux users are having trouble compiling openMW on the new version of boost.
The issue happens on both upstream (last checked the morning of april 1st) and 0.22.0.

I know lgromanowski bought up the issue recently.
These compile errors aren't just localized to opencs.

Code: Select all

Linking CXX executable ../../esmtool
[ 76%] Built target esmtool
[ 76%] Generating ui_playpage.h
[ 76%] Generating qrc_launcher.cxx
[ 76%] Generating moc_datafilespage.cxx
[ 76%] Generating moc_graphicspage.cxx
[ 77%] Generating moc_maindialog.cxx
usr/include/boost/type_traits/detail/has_binary_operator.hp:50: Parse
error at "BOOST_JOIN"
make[2]: *** [apps/launcher/moc_maindialog.cxx] Error 1
make[1]: *** [apps/launcher/CMakeFiles/omwlauncher.dir/all] Error 2
make: *** [all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...
==> ERROR: Makepkg was unable to build openmw.
==> Restart building openmw ? [y/N]
==> -------------------------------
I have a very important presentation to Ubisoft and Autodesk in a couple days, so I won't be able to spend a lot of time to resolving this or making a custom patch to 0.22.

Any help is greatly appreciated.

Re: Boost 1.53

Posted: 02 Apr 2013, 03:06
by Chris
I'm wondering if we should phase out Boost. The last two versions (1.52 and 1.53) individually broke existing code, and the 1.52 break still isn't fixed (and it's not straight forward how to fix).

I don't think there's much we need it for that isn't already provided by Ogre or that we couldn't replace with our own. Getting rid of Boost will also make it easier to cross-compile or build on Windows as it's one less dependency to worry about, and a hefty one at that. May also improve general compilation time since Boost's templates are notorious for increasing compile times.

Re: Boost 1.53

Posted: 02 Apr 2013, 05:27
by lgromanowski
bwrsandman wrote:Archlinux users are having trouble compiling openMW on the new version of boost.
The issue happens on both upstream (last checked the morning of april 1st) and 0.22.0.

I know lgromanowski bought up the issue recently.
These compile errors aren't just localized to opencs.

Code: Select all

Linking CXX executable ../../esmtool
[ 76%] Built target esmtool
[ 76%] Generating ui_playpage.h
[ 76%] Generating qrc_launcher.cxx
[ 76%] Generating moc_datafilespage.cxx
[ 76%] Generating moc_graphicspage.cxx
[ 77%] Generating moc_maindialog.cxx
usr/include/boost/type_traits/detail/has_binary_operator.hp:50: Parse
error at "BOOST_JOIN"
make[2]: *** [apps/launcher/moc_maindialog.cxx] Error 1
make[1]: *** [apps/launcher/CMakeFiles/omwlauncher.dir/all] Error 2
make: *** [all] Error 2
==> ERROR: A failure occurred in build().
    Aborting...
==> ERROR: Makepkg was unable to build openmw.
==> Restart building openmw ? [y/N]
==> -------------------------------
Any help is greatly appreciated.
The problem wasn't in boost but in broken Qt MOC compiler. You need to add #ifndef Q_MOC_RUN/#endif around the #includes which are using boost.

Re: Boost 1.53

Posted: 02 Apr 2013, 09:54
by Zini
Chris wrote:I'm wondering if we should phase out Boost. The last two versions (1.52 and 1.53) individually broke existing code, and the 1.52 break still isn't fixed (and it's not straight forward how to fix).

I don't think there's much we need it for that isn't already provided by Ogre or that we couldn't replace with our own. Getting rid of Boost will also make it easier to cross-compile or build on Windows as it's one less dependency to worry about, and a hefty one at that. May also improve general compilation time since Boost's templates are notorious for increasing compile times.
We are using dozens of boost libraries, a lot of them very extensively (try doing a git grep boost | wc -l). Phasing out boost is not an option and I don't consider it desirable. Boost doesn't break stuff a lot more worse than other libraries and as lgro already mentioned the last instance of breakage is a bug in Qt, not in boost.

Re: Boost 1.53

Posted: 02 Apr 2013, 13:12
by Chris
Zini wrote:We are using dozens of boost libraries, a lot of them very extensively (try doing a git grep boost | wc -l).
The vast majority of Boost's usage seem to be boost::shared_ptr and boost::lexical_cast (to convert between int/floats and strings). Both of which Ogre can do. The two other big ones seem to be boost:filesystem and boost::program_options. Admittedly I don't have much of an idea for how to replace these, right now (at least where standard iostream/cstdio can't work for boost::filesystem; getopt can probably help with boost::program_options).

But even still, replacing shared_ptr and lexical_cast with Ogre's equivalents would quite likely be an improvement. Having a policy of avoiding boost as much as possible, with strict regulations on including boost (i.e. don't include boost in a header that a lot of sources directly or indirectly include) would really help with compile times. Obviously I wouldn't expect complete and immediate do-away with boost::shared_ptr and lexical_cast, but it might be a good newbie task to replace a few uses of it at a time (for someone familiar with C++ but not OpenMW).

Re: Boost 1.53

Posted: 02 Apr 2013, 13:24
by Zini
Since it is not desirable to get rid of boost, this would be pointless.

Re: Boost 1.53

Posted: 02 Apr 2013, 13:39
by Chris
Zini wrote:Since it is not desirable to get rid of boost, this would be pointless.
Boost is a well-known cause for killing compilation times. Currently, it takes me over an hour to do a full build of the project. I can't say I agree that it would be pointless to remove and restrict the use of Boost where appropriate.

Re: Boost 1.53

Posted: 02 Apr 2013, 13:55
by Zini
That may be true for certain parts of boost, but I don't see that here. Compiling OpenMW takes a long time on a slow box, because the box is slow. OpenMW is a medium to large project that makes heavy use of templates in many places. Substantial compile time is to be expected.

Re: Boost 1.53

Posted: 02 Apr 2013, 14:10
by Zini
btw. over an hour sounds excessive. I just ran a test and a full rebuild takes me 2 minutes and 23 seconds. I have a top of the line CPU, but still. You are not building single-threaded, are you? May a ask the specs of your box?

Re: Boost 1.53

Posted: 02 Apr 2013, 14:43
by Chris
Zini wrote:btw. over an hour sounds excessive. I just ran a test and a full rebuild takes me 2 minutes and 23 seconds. I have a top of the line CPU, but still. You are not building single-threaded, are you? May a ask the specs of your box?
I have a dual-core Athlon 64 X2 4200+ (dual-core 2.2GHz). Not top of the line, but not a bad little thing. I do build single-threaded because -j2 still takes a good half hour, and having both cores pegged degrades my system's responsiveness and overall usability while I'm waiting for it to finish.