Page 1 of 1

boost 1.58 on arch linux - yet another missing include

Posted: Sun May 24, 2015 9:57 pm
by Chriss
[chris@desk build]$ make -j1 -k
Writing file: util/Version.cpp
Building v0.4.4+ build 2015-05-24.b39cbba
[ 0%] Built target freeorionversion
Scanning dependencies of target freeorioncommon
[ 0%] Building CXX object CMakeFiles/freeorioncommon.dir/combat/CombatEvent.cpp.o
In file included from /home/chris/freeorion-workspace/freeorion.git/combat/../util/Serialize.ipp:16:0,
from /home/chris/freeorion-workspace/freeorion.git/combat/CombatEvent.cpp:7:
/usr/include/boost/serialization/deque.hpp: In Funktion »void boost::serialization::load(Archive&, std::deque<U, Allocator>&, unsigned int)«:
/usr/include/boost/serialization/deque.hpp:48:27: Fehler: »library_version_type« in Namensbereich »boost::archive« bezeichnet keinen Typ
const boost::archive::library_version_type library_version(
^
/usr/include/boost/serialization/deque.hpp:55:8: Fehler: »library_version_type« ist kein Element von »boost::archive«
if(boost::archive::library_version_type(3) < library_version){
^
/usr/include/boost/serialization/deque.hpp:55:50: Fehler: »library_version« wurde in diesem Gültigkeitsbereich nicht definiert
if(boost::archive::library_version_type(3) < library_version){
^
CMakeFiles/freeorioncommon.dir/build.make:54: die Regel für Ziel „CMakeFiles/freeorioncommon.dir/combat/CombatEvent.cpp.o“ scheiterte
make[2]: *** [CMakeFiles/freeorioncommon.dir/combat/CombatEvent.cpp.o] Fehler 1
[ 1%] Building CXX object CMakeFiles/freeorioncommon.dir/combat/CombatEvents.cpp.o
In file included from /home/chris/freeorion-workspace/freeorion.git/combat/../util/Serialize.ipp:16:0,
from /home/chris/freeorion-workspace/freeorion.git/combat/CombatEvents.cpp:5:
/usr/include/boost/serialization/deque.hpp: In Funktion »void boost::serialization::load(Archive&, std::deque<U, Allocator>&, unsigned int)«:
/usr/include/boost/serialization/deque.hpp:48:27: Fehler: »library_version_type« in Namensbereich »boost::archive« bezeichnet keinen Typ
const boost::archive::library_version_type library_version(
^
/usr/include/boost/serialization/deque.hpp:55:8: Fehler: »library_version_type« ist kein Element von »boost::archive«
if(boost::archive::library_version_type(3) < library_version){
^
/usr/include/boost/serialization/deque.hpp:55:50: Fehler: »library_version« wurde in diesem Gültigkeitsbereich nicht definiert
if(boost::archive::library_version_type(3) < library_version){
^
CMakeFiles/freeorioncommon.dir/build.make:77: die Regel für Ziel „CMakeFiles/freeorioncommon.dir/combat/CombatEvents.cpp.o“ scheiterte
make[2]: *** [CMakeFiles/freeorioncommon.dir/combat/CombatEvents.cpp.o] Fehler 1

Code: Select all

[chris@desk freeorion.git]$ git diff util/Process.h 
diff --git a/util/Process.h b/util/Process.h
index f9927cc..f95b5f3 100644
--- a/util/Process.h
+++ b/util/Process.h
@@ -13,6 +13,10 @@
 #if BOOST_VERSION == 105700
 #include <boost/serialization/type_info_implementation.hpp> // This
 #endif
+// HACK: For the same boost 1.58 bug
+#if BOOST_VERSION == 105800
+#include <boost/serialization/type_info_implementation.hpp> // This
+#endif
 
 #include <boost/serialization/shared_ptr.hpp>
So basically I needed the exact same hack as for 1.57 with 1.58 and it seems to work.
Those guys and their includes... unbelievable.

Re: boost 1.58 on arch linux - yet another missing include

Posted: Sun May 24, 2015 10:01 pm
by Geoff the Medio
Perhaps the version check for that include should just be removed entirely?

Re: boost 1.58 on arch linux - yet another missing include

Posted: Sun May 24, 2015 10:06 pm
by Dilvish
Geoff the Medio wrote:Perhaps the version check for that include should just be removed entirely?
I think that might instead lead to different problems with future Boost versions; I would recommend just doing these for the specific versions where we know they are needed, as we discover it. Now that we know what to check for it is fairly straightforward.

Re: boost 1.58 on arch linux - yet another missing include

Posted: Mon May 25, 2015 9:06 am
by Vezzra
Chriss wrote:Those guys and their includes... unbelievable.
Ok, this is getting truly weird... what's going on over there? I assume this bug must have been reported over and over now, what's keeping them from fixing it?

Re: boost 1.58 on arch linux - yet another missing include

Posted: Mon May 25, 2015 12:18 pm
by Chriss
http://imgur.com/gallery/HTisMpC ? ;)

Anyway... I'm trying to narrow it down, had some issues earlier and ended up fixing my boost install because it started to annoy me... That hack above didn't help, didn't know where to hack it otherwise...

Re: boost 1.58 on arch linux - yet another missing include

Posted: Mon May 25, 2015 1:07 pm
by Vezzra
:lol: :lol: :lol: :lol: :lol:
That hack above didn't help, didn't know where to hack it otherwise...
Wait, you mean, our hack to work around the problem for boost versions prior to 1.58 doesn't work for 1.58 anymore? So, instead of getting better, or at least stay as it is, things are getting worse now?

Wow... just wow... *facepalm*

Re: boost 1.58 on arch linux - yet another missing include

Posted: Mon May 25, 2015 1:44 pm
by Dilvish
there is another recent thread about some folks having trouble with boost 1.58 and missing includes. You might want to look for that, I seem to recall there were multiple people & some needed different resolutions than the others, and I'm not sure it all made it into the master branch.

Re: boost 1.58 on arch linux - yet another missing include

Posted: Mon May 25, 2015 2:17 pm
by Chriss
For me, regarding the missing include(s) in boost 1.58, I added the following hack:

Code: Select all

[chris@desk freeorion.git]$ git diff util/Serialize.ipp 
diff --git a/util/Serialize.ipp b/util/Serialize.ipp
index b4027b2..c230721 100644
--- a/util/Serialize.ipp
+++ b/util/Serialize.ipp
@@ -5,12 +5,19 @@
 #include <boost/static_assert.hpp>
 #include <boost/detail/endian.hpp>
 
+#include <boost/version.hpp>
 #if BOOST_VERSION == 105600
 // HACK: The following two includes work around a bug in boost 1.56,
 // which uses them without including. They can be removed once the bug is gone.
 #include <boost/serialization/singleton.hpp> // This
 #include <boost/serialization/extended_type_info.hpp> //This
 #endif
+// HACK: For a similar boost 1.58 bug
+#if BOOST_VERSION == 105800
+#include <boost/serialization/type_info_implementation.hpp> // This
+#include <boost/archive/basic_archive.hpp> // And this
+#endif
+
 
 #include <boost/serialization/export.hpp>
 #include <boost/serialization/deque.hpp>
It is necessary to add both includes. No hack in Process.h (tried that, did not help, was not in the error message, too).

Re: boost 1.58 on arch linux - yet another missing include

Posted: Mon May 25, 2015 2:22 pm
by Chriss
Vezzra wrote:Wait, you mean, our hack to work around the problem for boost versions prior to 1.58 doesn't work for 1.58 anymore?
I first tried to copy the 1.57 hack so that it is active for 1.58 too, but that did not change the situation. So it seems to be another issue in 1.58 than in 1.57, and the issue in 1.57 is gone.

Re: boost 1.58 on arch linux - yet another missing include

Posted: Sat May 30, 2015 12:00 pm
by adesst
Chriss wrote:
Vezzra wrote:Wait, you mean, our hack to work around the problem for boost versions prior to 1.58 doesn't work for 1.58 anymore?
I first tried to copy the 1.57 hack so that it is active for 1.58 too, but that did not change the situation. So it seems to be another issue in 1.58 than in 1.57, and the issue in 1.57 is gone.
The hack actually works on my case. Also you need to add these options at your CMakeCache.txt or with ccmake ,
With ccmake
CMAKE_CXX_FLAGS -DBOOST_VERSION=105800
CMAKE_C_FLAGS -DBOOST_VERSION=105800
Or modify CMakeCache.txt,
CMAKE_CXX_FLAGS:STRING=-DBOOST_VERSION=105800
CMAKE_C_FLAGS:STRING=-DBOOST_VERSION=105800
Without above options the hacked block of #IF #ELSE are not executed.

Re: boost 1.58 on arch linux - yet another missing include

Posted: Sat May 30, 2015 6:25 pm
by Dilvish
adesst wrote:Also you need to add these options at your CMakeCache.txt or with ccmake ,
With ccmake
CMAKE_CXX_FLAGS -DBOOST_VERSION=105800
CMAKE_C_FLAGS -DBOOST_VERSION=105800
Or modify CMakeCache.txt,
CMAKE_CXX_FLAGS:STRING=-DBOOST_VERSION=105800
CMAKE_C_FLAGS:STRING=-DBOOST_VERSION=105800
Without above options the hacked block of #IF #ELSE are not executed.
That should not be the case, the value should be set by including the header boost/version.hpp-- was there some file where it is needed but missing?

Re: boost 1.58 on arch linux - yet another missing include

Posted: Sun May 31, 2015 8:39 pm
by Chriss
Yes, see:
Already had a Hack for 1.57, but no version.h
Chriss wrote:For me, regarding the missing include(s) in boost 1.58, I added the following hack:

Code: Select all

[chris@desk freeorion.git]$ git diff util/Serialize.ipp 
diff --git a/util/Serialize.ipp b/util/Serialize.ipp
index b4027b2..c230721 100644
--- a/util/Serialize.ipp
+++ b/util/Serialize.ipp
@@ -5,12 +5,19 @@
 #include <boost/static_assert.hpp>
 #include <boost/detail/endian.hpp>
 
+#include <boost/version.hpp>
 #if BOOST_VERSION == 105600
 // HACK: The following two includes work around a bug in boost 1.56,
 // which uses them without including. They can be removed once the bug is gone.
 #include <boost/serialization/singleton.hpp> // This
 #include <boost/serialization/extended_type_info.hpp> //This
 #endif
+// HACK: For a similar boost 1.58 bug
+#if BOOST_VERSION == 105800
+#include <boost/serialization/type_info_implementation.hpp> // This
+#include <boost/archive/basic_archive.hpp> // And this
+#endif
+
 
 #include <boost/serialization/export.hpp>
 #include <boost/serialization/deque.hpp>
It is necessary to add both includes. No hack in Process.h (tried that, did not help, was not in the error message, too).

Re: boost 1.58 on arch linux - yet another missing include

Posted: Mon Jun 01, 2015 3:32 pm
by adesst
Chriss wrote:Yes, see:
Already had a Hack for 1.57, but no version.h
Chriss wrote:For me, regarding the missing include(s) in boost 1.58, I added the following hack:

Code: Select all

[chris@desk freeorion.git]$ git diff util/Serialize.ipp 
diff --git a/util/Serialize.ipp b/util/Serialize.ipp
index b4027b2..c230721 100644
--- a/util/Serialize.ipp
+++ b/util/Serialize.ipp
@@ -5,12 +5,19 @@
 #include <boost/static_assert.hpp>
 #include <boost/detail/endian.hpp>
 
+#include <boost/version.hpp>
 #if BOOST_VERSION == 105600
 // HACK: The following two includes work around a bug in boost 1.56,
 // which uses them without including. They can be removed once the bug is gone.
 #include <boost/serialization/singleton.hpp> // This
 #include <boost/serialization/extended_type_info.hpp> //This
 #endif
+// HACK: For a similar boost 1.58 bug
+#if BOOST_VERSION == 105800
+#include <boost/serialization/type_info_implementation.hpp> // This
+#include <boost/archive/basic_archive.hpp> // And this
+#endif
+
 
 #include <boost/serialization/export.hpp>
 #include <boost/serialization/deque.hpp>
It is necessary to add both includes. No hack in Process.h (tried that, did not help, was not in the error message, too).
Sorry i did not carefully read Chriss previous post. That he did add the version.hpp so no need to add the build options.

@Dilvish, i am catching up with boost and thanks for the link.