Linking Problems

Questions, problems and discussion about compiling FreeOrion.

Moderator: Oberlus

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

Re: Linking Problems

#16 Post by Vezzra »

Foocaux wrote:I've got 3GB of ram & win7 32 bits
OUCH :shock: I'm surprised that you can build FO at all. When I joined the project almost 3 yeary ago I utterly failed to compile FO on Win until I set up a VM with 4GB of RAM and Win7 64bit. Even that setup is a pain, but at least it works.

User avatar
Foocaux
Space Squid
Posts: 78
Joined: Sat Jul 26, 2014 7:14 am

Re: Linking Problems

#17 Post by Foocaux »

It's definitely touch and go! :)
I keep telling the linker "I don't want anything fancy, just a basic .exe" & it keeps going, "Nonono, I'll optimise it for you, no problem at all!" and for at least 1 in 3 attempts it falls over trying to do so, by cleverly running out of memory thanks to them fancy optimisation tables... grrr.

I might have found a way to stop it bloating to 1.7Gb to build a 13Mb executable, though.

We'll see...
The small print: Any code contribution I make to FreeOrion is made under GPL v2.0, any graphic contribution is under CC-by-SA 3.0

User avatar
Foocaux
Space Squid
Posts: 78
Joined: Sat Jul 26, 2014 7:14 am

Re: Linking Problems

#18 Post by Foocaux »

I seem to have provisionally won the battle with VS2010 - I can compile FO under windows7 32 bits, 3Gb ram, and avoid link memory errors.

To minimise the memory footprint for the VS 2010 linker, the most important project level settings seem to be as follows:

C/C++ > Optimization > Whole Program Optimization > No
Linker > General > Enable Incremental Linker > No (/INCREMENTAL:NO)
Linker > Manifest File > Generate Manifest > No (/MANIFEST:NO)
Linker > Debugging > Generate Debug Info > No
Linker > Optimization > References > No (/OPT:NOREF)
Linker > Optimization > Enable COMDAT Folding> No (/OPT:NOICF)
Linker > Optimization > Link Time Code Generation> Default

After changing these settings for the FreeOrion, FreeOrionCA, and FreeOrionD projects the whole FreeOrion solution did compile without problems.

YMMV, but for me it's been working ok 6 times out of 6, with other apps running too (notepad++, firefox).

Of course, changing those settings means the executables themselves aren't as fast or small as they would be with the standard FO compile settings, and if one of the exes crashes, no debug info means guessing what went wrong the hard way.

Still, 2 days ago I wasn't able to compile FO on my old laptop at all, so I'm not going to complain too much*! :D

Cheers everyone.


*I do reserve the right to say 'grr, microsoft bloatware' at least 5 times a day. It's a basic human right! :)
The small print: Any code contribution I make to FreeOrion is made under GPL v2.0, any graphic contribution is under CC-by-SA 3.0

Post Reply