boost 1.58 on arch linux - yet another missing include

Questions, problems and discussion about compiling FreeOrion.

Moderator: Oberlus

Post Reply
Message
Author
Chriss
Dyson Forest
Posts: 231
Joined: Sun May 11, 2008 10:50 am

boost 1.58 on arch linux - yet another missing include

#1 Post by Chriss »

[[email protected] 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

[[email protected] 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.
Attached patches are released under GPL 2.0 or later.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 12802
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

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

#2 Post by Geoff the Medio »

Perhaps the version check for that include should just be removed entirely?

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

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

#3 Post 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.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

User avatar
Vezzra
Release Manager, Design
Posts: 5450
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

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

#4 Post 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?

Chriss
Dyson Forest
Posts: 231
Joined: Sun May 11, 2008 10:50 am

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

#5 Post 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...
Attached patches are released under GPL 2.0 or later.

User avatar
Vezzra
Release Manager, Design
Posts: 5450
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

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

#6 Post 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*

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

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

#7 Post 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.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

Chriss
Dyson Forest
Posts: 231
Joined: Sun May 11, 2008 10:50 am

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

#8 Post by Chriss »

For me, regarding the missing include(s) in boost 1.58, I added the following hack:

Code: Select all

[[email protected] 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).
Attached patches are released under GPL 2.0 or later.

Chriss
Dyson Forest
Posts: 231
Joined: Sun May 11, 2008 10:50 am

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

#9 Post 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.
Attached patches are released under GPL 2.0 or later.

User avatar
adesst
Space Floater
Posts: 18
Joined: Tue May 05, 2015 10:38 am

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

#10 Post 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.

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

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

#11 Post 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?
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

Chriss
Dyson Forest
Posts: 231
Joined: Sun May 11, 2008 10:50 am

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

#12 Post 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

[[email protected] 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).
Attached patches are released under GPL 2.0 or later.

User avatar
adesst
Space Floater
Posts: 18
Joined: Tue May 05, 2015 10:38 am

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

#13 Post 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

[[email protected] 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.

Post Reply