Building r7165 and later fails on wheezy amd64

Questions, problems and discussion about compiling FreeOrion.

Moderator: Oberlus

Post Reply
Message
Author
Single Player
Space Floater
Posts: 15
Joined: Sun Jul 06, 2014 7:24 pm

Building r7165 and later fails on wheezy amd64

#1 Post by Single Player »

Hi everybody

I'm on Debian wheezy amd64 and get FreeOrion from SVN trunk (for some time now). Since r7165 FreeOrion has failed with the following (full log attached):

Code: Select all

../libfreeorioncommon.so: undefined reference to `void IncapacitationEvent::serialize<boost::archive::binary_iarchive>(boost::archive::binary_iarchive&, unsigned int)'
../libfreeorioncommon.so: undefined reference to `void IncapacitationEvent::serialize<boost::archive::binary_oarchive>(boost::archive::binary_oarchive&, unsigned int)'
../libfreeorioncommon.so: undefined reference to `void BoutBeginEvent::serialize<boost::archive::binary_oarchive>(boost::archive::binary_oarchive&, unsigned int)'
../libfreeorioncommon.so: undefined reference to `void BoutBeginEvent::serialize<boost::archive::binary_iarchive>(boost::archive::binary_iarchive&, unsigned int)'
FreeOrion Revision 7164 was the last one successfully building here -- nothing else changed. Current r7221 still fails.
As these error messages mention boost: wheezy has version 1.49.0.

Any ideas?
Attachments
make.log
build log (with make -j 5 -- sorry for that)
(40.1 KiB) Downloaded 152 times

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

Re: Building r7165 and later fails on wheezy amd64

#2 Post by Dilvish »

I was getting those same errors at first, but doing a fully clean build from the ground up (including telling ccache to recache, but that only applies if you use ccache) got me past them. That seems it was about the first time I can recall having to force a clean build, normally make figures out just fine on its own when it needs to recompile or relink something.
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

Single Player
Space Floater
Posts: 15
Joined: Sun Jul 06, 2014 7:24 pm

Re: Building r7165 and later fails on wheezy amd64

#3 Post by Single Player »

I normally do all my svn update/rebuilds like this (inside the FreeOrion directory):

Code: Select all

make clean
svn up
cmake .
make -j 5
With your suggestion I tried to really make sure that no previous build artifacts were left (again from inside the FreeOrion directory):

Code: Select all

svn export . somewhereelse
cd somewhereelse
cmake .
make -j 5
Same result I'm afraid :(

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

Re: Building r7165 and later fails on wheezy amd64

#4 Post by Vezzra »

The link errors you posted point to changes made in r7165. That commit has been Mitten.O's patch for the revised combat resolution. My guess is that he employed some boost features not present in 1.49. So I think you won't get around to upgrade your boost library.

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

Re: Building r7165 and later fails on wheezy amd64

#5 Post by Dilvish »

Vezzra wrote:So I think you won't get around to upgrade your boost library.
I think Vezzra left out a 'needing' in there -- "you won't get around [needing] to upgrade", not that he was predicting you wouldn't actually upgrade :D

Our compile page does cite boost 1.50 as the min req these days, so that very well may be your problem.
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: 6095
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: Building r7165 and later fails on wheezy amd64

#6 Post by Vezzra »

Dilvish wrote:
Vezzra wrote:So I think you won't get around to upgrade your boost library.
I think Vezzra left out a 'needing' in there -- "you won't get around [needing] to upgrade", not that he was predicting you wouldn't actually upgrade :D
Argh, of course. Well, my excuse is that I'm not a native speaker :mrgreen:

AndrewW
Juggernaut
Posts: 791
Joined: Mon Feb 04, 2013 10:15 pm

Re: Building r7165 and later fails on wheezy amd64

#7 Post by AndrewW »

Vezzra wrote:Argh, of course. Well, my excuse is that I'm not a native speaker :mrgreen:
Blame it on your universal translator.

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

Re: Building r7165 and later fails on wheezy amd64

#8 Post by Dilvish »

Woops! turns out I misremembered what had solved the problem for me, because I ran into it again, even with doing a full clean build... #?%@!

What does fix it for me is reverting my build type to the default blank, rather than Release. Had you by any chance also changed your build type to Release?
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

Single Player
Space Floater
Posts: 15
Joined: Sun Jul 06, 2014 7:24 pm

Re: Building r7165 and later fails on wheezy amd64

#9 Post by Single Player »

Vezzra wrote:
Dilvish wrote:I think Vezzra left out a 'needing' in there -- "you won't get around [needing] to upgrade", not that he was predicting you wouldn't actually upgrade :D
Argh, of course. Well, my excuse is that I'm not a native speaker :mrgreen:
Same here - so no misunderstanding :)

Single Player
Space Floater
Posts: 15
Joined: Sun Jul 06, 2014 7:24 pm

Re: Building r7165 and later fails on wheezy amd64

#10 Post by Single Player »

Dilvish wrote:Woops! turns out I misremembered what had solved the problem for me, because I ran into it again, even with doing a full clean build... #?%@!

What does fix it for me is reverting my build type to the default blank, rather than Release. Had you by any chance also changed your build type to Release?
As in "CMAKE_BUILD_TYPE:STRING=" from CMakeCache.txt? Mine is empty. But you still gave an important clue! I might not have changed cmake build type but I recently changed C(XX)FLAGS for my cmake call:

Code: Select all

CFLAGS="-O3 -march=native" CXXFLAGS="-O3 -march=native" cmake .
This is not the same as build type release but certainly sets e. g. compiler optimization level to that of release.
And to round that off calling cmake again of course just made it reuse the CMakeCache.txt settings in the FO working copy instead of replacing them. Yay for not needing to mess it up every time by hand :D

I could now build r7222 successfully using a really clean (svn exported) FO copy and no cmake arguments at the same time.

Thank you Dilvish for your help!
And Sorry that I only gave a edited versions of my build instructions - I really should have known better!

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

Re: Building r7165 and later fails on wheezy amd64

#11 Post by Dilvish »

Single Player wrote:...sets e. g. compiler optimization level to that of release.
It turned out that I was able to compile and link fine with -O1 (but not -O2), so you probably don't have to entirely give up all optimization...
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
adrian_broher
Programmer
Posts: 1156
Joined: Fri Mar 01, 2013 9:52 am
Location: Germany

Re: Building r7165 and later fails on wheezy amd64

#12 Post by adrian_broher »

Have a look at this GCC bug report:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50560

The behaviour for -O3 is intended, but can be circumvented with an extern declaration or allowing the implementation to to see the declaration of the template function. I need to check how we currently solve this in FO because this isn't the first time that this problem occurs.
Resident code gremlin
Attached patches are released under GPL 2.0 or later.
Git author: Marcel Metz

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

Re: Building r7165 and later fails on wheezy amd64

#13 Post by Dilvish »

Adrian's suggestion has done the trick; compiles fine for me now with -O3 in r7223
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

Post Reply