Problem Compiling

Questions, problems and discussion about compiling FreeOrion.

Moderator: Oberlus

Post Reply
Message
Author
jackbunny
Krill Swarm
Posts: 11
Joined: Thu Jul 03, 2008 8:35 pm

Problem Compiling

#1 Post by jackbunny »

No I haven't dissapeared yet. Been busy with the holiday, but still looking at the code whenever I get a chance. Got it all compiling fine in windows, but I was trying to get it up and going in Ubuntu. I'm a bit of a Linux newb so I'm having difficulty getting scons to compile GG. Here's the config.log file from FreeOrion/GG:

Code: Select all

file /home/jackbunny/freeorion/FreeOrion/GG/SConstruct,line 266:
	Configure(confdir = .sconf_temp)
scons: Configure: Checking for pkg-config... 
pkg-config --atleast-pkgconfig-version 0.15.0
close failed: [Errno 9] Bad file descriptor
scons: Configure: yes

scons: Configure: Checking for C++ header file boost/shared_ptr.hpp... 
.sconf_temp/conftest_1.cpp <-
  |
  |#include "boost/shared_ptr.hpp"
  |
  |
g++ -o .sconf_temp/conftest_1.o -c .sconf_temp/conftest_1.cpp
close failed: [Errno 9] Bad file descriptor
scons: Configure: yes

scons: Configure: Checking Boost version >= 1.35... 
scons: Configure: (cached) no

scons: Configure: Boost configuration... 
scons: Configure: (cached) no
I've got latest version of all packages mentioned in the Wiki.
Any help would be greatly appreciated. Thanks guys.

User avatar
loonycyborg
Compilation Expert
Posts: 219
Joined: Thu Jul 06, 2006 10:30 pm
Location: Russia/Moscow

Re: Problem Compiling

#2 Post by loonycyborg »

FreeOrion now requires boost 1.35 while according to packages.ubuntu.com ubuntu still has 1.34.1 . Either wait until 1.35 makes it to repo or compile and install it manually and then pass its location to scons:

Code: Select all

scons configure with_boost_include=/usr/local/include/boost-1_35 with_boost_libdir=/usr/local/lib/ boost_lib_suffix=-gcc41-mt
In Soviet Russia, forum posts YOU!!

tzlaine
Programming Lead Emeritus
Posts: 1092
Joined: Thu Jun 26, 2003 1:33 pm

Re: Problem Compiling

#3 Post by tzlaine »

Also, there's a problem with GCC >= 4.1 and the Serialization lib in Boost 1.35 that needs to be patched before FO will run without crashing. You need to apply the patch below. It might not apply cleanly, but it's very small and if it doesn't, it should be obvious how to fix it.

Code: Select all

Index: trunk/boost/serialization/export.hpp
===================================================================
--- trunk/boost/serialization/export.hpp        (revision 43948)
+++ trunk/boost/serialization/export.hpp        (revision 43949)
@@ -119,7 +119,7 @@
         // generates the statically-initialized objects whose constructors
         // register the information allowing serialization of T objects
         // through pointers to their base classes.
-        instantiate_ptr_serialization((T*)0, 0);
+        instantiate_ptr_serialization((T*)0, 0, adl_tag());
         return *this;
     }
     const guid_initializer & export_guid(char const* key, mpl::true_){
Index: trunk/boost/archive/detail/register_archive.hpp
===================================================================
--- trunk/boost/archive/detail/register_archive.hpp     (revision 43948)
+++ trunk/boost/archive/detail/register_archive.hpp     (revision 43949)
@@ -6,6 +6,14 @@

 namespace boost { namespace archive { namespace detail {

+// This is for the sake of GCC 4.1 et. al, which doesn't seem to see
+// the instantiate_ptr_serialization overloads generated by
+// BOOST_SERIALIZATION_REGISTER_ARCHIVE if they lexically follow the
+// call *unless* they are in an associated namespace of one of the
+// arguments.  I am not 100% sure of what the standard says on this
+// point, and am investigating. - Dave A.
+struct adl_tag {};
+
 template <class Archive, class Serializable>
 struct ptr_serialization_support;

@@ -24,7 +32,7 @@
 // in overload resolution with the functions declared by
 // BOOST_SERIALIZATION_REGISTER_ARCHIVE, below.
 template <class Serializable>
-void instantiate_ptr_serialization(Serializable*, int) {}
+void instantiate_ptr_serialization(Serializable*, int, adl_tag ) {}

 // The function declaration generated by this macro never actually
 // gets called, but its return type gets instantiated, and that's
@@ -36,7 +44,7 @@
                                                                         \
 template <class Serializable>                                           \
 typename _ptr_serialization_support<Archive, Serializable>::type        \
-instantiate_ptr_serialization( Serializable*, Archive* );               \
+instantiate_ptr_serialization( Serializable*, Archive*, adl_tag );              \
                                                                         \
 }}}


jackbunny
Krill Swarm
Posts: 11
Joined: Thu Jul 03, 2008 8:35 pm

Re: Problem Compiling

#4 Post by jackbunny »

Still a no go here :(
I applied the patch to Boost and compiled it. Verified that the includes are going to the right patch, but getting the same compile error. Anyone have any other advice? I haven't checked to see if the logs are identical yet (I'm at work), but the error messages are the same.

jackbunny
Krill Swarm
Posts: 11
Joined: Thu Jul 03, 2008 8:35 pm

Re: Problem Compiling

#5 Post by jackbunny »

Success!! :D

After much work, downloading and compiling a new version of the GCC compiler as well as countless other libraries. The game installs and is playable.. now it seems the bug I was intending to work on has already been fixed. :lol: So I guess I'll work on something else.

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

Re: Problem Compiling

#6 Post by Geoff the Medio »

jackbunny wrote:it seems the bug I was intending to work on has already been fixed.
I thought you were going to work on the fleet move lines bug? AFAIK it's still unfixed.

jackbunny
Krill Swarm
Posts: 11
Joined: Thu Jul 03, 2008 8:35 pm

Re: Problem Compiling

#7 Post by jackbunny »

Yeah, that's what I was going to work on. I didn't notice the behavior right off the bat when I started testing earlier, but I only had a couple of minutes to play around. I just hopped on and saw that it's still on the bug list. I will get to work on it.

Post Reply