FreeOrion

Forums for the FreeOrion project
It is currently Sat Jul 26, 2014 9:06 am

All times are UTC




Post new topic Reply to topic  [ 41 posts ]  Go to page Previous  1, 2, 3
Author Message
PostPosted: Sat Oct 02, 2010 11:13 pm 
Offline
Space Floater

Joined: Sun Sep 26, 2010 11:05 pm
Posts: 22
Quote:
Just start with removing them from the serialize function, as suggested above.

Done. I stripped the function to just:
Code:
template <class Archive>
void System::serialize(Archive& ar, const unsigned int version)
{
    printf("Serialize System\n");
    ar  & BOOST_SERIALIZATION_BASE_OBJECT_NVP(UniverseObject);
}

It still failed at the same spot. Are trying to remove the members from System still worth it now?


Top
 Profile  
 
PostPosted: Sat Oct 02, 2010 11:38 pm 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 9735
Location: Munich
q1w2e3r4 wrote:
The only output I get is:
Code:
main() caught exception(std::exception): unregistered class
which leads to me do believe debugging is not on somehow. And that is why I am not seeing the other serializing messages from the code posted earlier in this thread.

I think you're confused about what Logger().debugStream() does. It doesn't output anything to the console, ever. Rather, it outputs to freeorion.log or freeoriond.log (for the client or server, respecitvely) which should be located in ~/.freeorion/

Could you have a look in those files and see what debug lines are present from the changes to Universe::serialized as discussed in this post? viewtopic.php?p=43834#p43834

q1w2e3r4 wrote:
Are trying to remove the members from System still worth it now?
Probably not.

As a random guess, could you try replacing the contents of SerializeUniverseExports.ipp, after the #include lines, with
Code:
BOOST_CLASS_EXPORT(System)
BOOST_CLASS_EXPORT(Planet)
BOOST_CLASS_EXPORT(Building)
BOOST_CLASS_EXPORT(Fleet)
BOOST_CLASS_EXPORT(Ship)
(if you haven't already), and if that doesn't work,
Code:
BOOST_CLASS_EXPORT(Planet)
BOOST_CLASS_EXPORT(Building)
BOOST_CLASS_EXPORT(Fleet)
BOOST_CLASS_EXPORT(Ship)
BOOST_CLASS_EXPORT(System)
where I've changed the order of exporting, and if that doesn't work,
Code:
BOOST_CLASS_EXPORT(Planet)
BOOST_CLASS_EXPORT(Building)
BOOST_CLASS_EXPORT(Fleet)
BOOST_CLASS_EXPORT(Ship)
BOOST_CLASS_EXPORT_GUID(System, "System")


Top
 Profile  
 
PostPosted: Sun Oct 03, 2010 2:52 am 
Offline
Space Floater

Joined: Sun Sep 26, 2010 11:05 pm
Posts: 22
Quote:
I think you're confused about what Logger().debugStream() does.

You are right, I was. I have now been enlightened. I have attached the log for when I compiled with the removed members of System::serialize()

I did a few test compiles with moving around the Boost macros in your suggestions. They all failed. Also, browsing among boost/serialization/export.hpp, I find that BOOST_CLASS_EXPORT just expands to be BOOST_CLASS_EXPORT_GUID anyways. And BOOST_CLASS_EXPORT_GUID expands to:
Code:
BOOST_CLASS_EXPORT_KEY2(System, "System")
BOOST_CLASS_EXPORT_IMPLEMENT(System)

The hack in SerializeUniverseExports.ipp is a rewrite of BOOST_CLASS_EXPORT_KEY2 without the inline piece of code.


Attachments:
freeoriond.log.zip [13.34 KiB]
Downloaded 34 times
Top
 Profile  
 
PostPosted: Sun Oct 03, 2010 3:48 am 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 9735
Location: Munich
Another random idea from googling: Could you try adding this to the start of Universe::serialize in SerializeUniverse.cpp?
Code:
ar.template register_type<System>();


Top
 Profile  
 
PostPosted: Sun Oct 03, 2010 5:43 am 
Offline
Space Floater

Joined: Sun Sep 26, 2010 11:05 pm
Posts: 22
It worked!

I did a few extra compiles with varying optimizations just to make sure. Inlining is working again. Also, the hack in SerializeUniverseExports.ipp is no longer necessary.

Could you explain what that line of code is actually doing? I am curious.

q


Top
 Profile  
 
PostPosted: Sun Oct 03, 2010 6:27 am 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 9735
Location: Munich
q1w2e3r4 wrote:
It worked!

Hmm.

Quote:
Could you explain what that line of code is actually doing? I am curious.

I don't know... I just found it in some serialization example code here and thought it sounded worth a try, since it appears to involve registering a class, and the exception is about an unregistered class. Why that is necessary for System only, or why it's not done already by exporting the class, I have no idea...

Edit: I've committed some serialization code modifications based on this thread. Could you let me know if they work in GCC?


Top
 Profile  
 
PostPosted: Sun Oct 03, 2010 2:25 pm 
Offline
Space Floater

Joined: Sun Sep 26, 2010 11:05 pm
Posts: 22
Quote:
I've committed some serialization code modifications based on this thread. Could you let me know if they work in GCC?

Works like a charm.

I am going to do another test on a system with a different version of GCC - I've been doing my compiling with GCC 4.4.1, I am going to try on a system with 4.5


Top
 Profile  
 
PostPosted: Sun Oct 03, 2010 2:47 pm 
Offline
Space Krill

Joined: Sat Oct 02, 2010 9:48 pm
Posts: 3
I can also confirm r3806 works for me. I'm finally on turn 1 :D

Debian / gcc 4.3.5 here.


Top
 Profile  
 
PostPosted: Sun Oct 03, 2010 2:52 pm 
Offline
Space Floater

Joined: Sun Sep 26, 2010 11:05 pm
Posts: 22
rats. linking failed with gcc 4.5 on all three executables. attached is the console output of the compilation.

Edit: On second thought, I don't think this has to do with rev 3806 - I think something went wrong with my build environment for openSUSE. Ignore for now...

Edit2: Yeah. something goofy happened to the oS 11.3 build environments in the openSUSE BuildService - unpatched freeorion doesn't link anymore either. I think that rev. 3806 is good.


Attachments:
oS11.3_gcc4.5_x86_64_output.txt.zip [5.3 KiB]
Downloaded 41 times
Top
 Profile  
 
PostPosted: Sun Oct 03, 2010 7:30 pm 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 9735
Location: Munich
Someone on IRC also reports that 3806 works. Looking at your link error, it doesn't make much sense, as that function is defined... It is a templated function, though, so it's possible it's not generating the relevant code for some reason...

Edit: I'm wondering if a similar problem is going to pop up when trying to start 3D battles, since those involve serializing a system object separately from the code I modified as discussed in this thread. Could someone who was getting the unregistered class crash try starting a game with "freeorion --test-3d-combat" and then get into a battle, and see if things work properly?


Top
 Profile  
 
PostPosted: Tue Oct 05, 2010 5:53 pm 
Offline
Programming, Design, and De Facto Lead
User avatar

Joined: Wed Oct 08, 2003 1:33 am
Posts: 9735
Location: Munich
I should probably make a new post for this question (from the previous post), since it might otherwise be missed:
Geoff the Medio wrote:
Edit: I'm wondering if a similar problem is going to pop up when trying to start 3D battles, since those involve serializing a system object separately from the code I modified as discussed in this thread. Could someone who was getting the unregistered class crash try starting a game with "freeorion --test-3d-combat" and then get into a battle, and see if things work properly?


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 41 posts ]  Go to page Previous  1, 2, 3

All times are UTC


Who is online

Users browsing this forum: AhrefsBot and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group