Board index FlightGear Support Compiling

building git binary for Local Weather development

Building FlightGear from source, and in the need for help?

Re: building git binary for Local Weather development

Postby Hooray » Sun Sep 26, 2010 4:01 pm

So, I tested this. I did get an increase in frame rate (+15) - when building fg from scratch with
Code: Select all
make CXXFLAGS="-march=native -msse -msse2 -O3 -pipe" -j 4


But I only rebuilt fgfs, not osg and simgear - At some point, I will try this, too. To see if it makes any significant difference or not...

However, personally I still prefer a debug binary with debug symbols and without any optimizations.
Please don't send support requests by PM, instead post your questions on the forum so that all users can contribute and benefit
Thanks & all the best,
Hooray
Help write next month's newsletter !
pui2canvas | MapStructure | Canvas Development | Programming resources
Hooray
 
Posts: 12707
Joined: Tue Mar 25, 2008 9:40 am
Pronouns: THOU

Re: building git binary for Local Weather development

Postby Thorsten » Sun Sep 26, 2010 4:07 pm

I'm having an afternoon with my girls today - no coding or compiling 8) - I'll try the flags tomorrow.
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: building git binary for Local Weather development

Postby D-TB7 » Sun Sep 26, 2010 9:07 pm

Hooray wrote:So, I tested this. I did get an increase in frame rate (+15) - when building fg from scratch with
Code: Select all
make CXXFLAGS="-march=native -msse -msse2 -O3 -pipe" -j 4


But I only rebuilt fgfs, not osg and simgear - At some point, I will try this, too. To see if it makes any significant difference or not...

However, personally I still prefer a debug binary with debug symbols and without any optimizations.


Ah, thanks. I also tried this with simgear/flightgear and got a significant improvement on my quite old machine (+10fps). :)

However, I also added "-Wall" to see all warnings. It's wise to use this when optimizing, since the compiler can sometimes detect if the sources break certain rules required for optimization.
The good news is: simgear is really clean (a single warning in a test program only...).
FlightGear also looks quite good - but unfortunately there are several warnings. It's mainly violations of "strict aliasing", e.g. a whole load in the multiplayer module. In fact, these warnings are already a potential problem when compiling with the FG standard "-O2" (which includes "-fstrict-aliasing") - so this is not good. And "-O3" is even more likely to break things here...

And some more problems show up which are completely unrelated to optimization - such as (potential) usage of uninitialized variables. Indeed, some of them look bad... :(

Well, I guess these issues should be discussed on the mailing list. But, just be warned when optimizing - doesn't seem to be completely safe right now...

cheers,
ThorstenB (D-TB7)
User avatar
D-TB7
 
Posts: 17
Joined: Sun Aug 29, 2010 4:31 pm
Location: Germany
Callsign: D-TB7
IRC name: ThorstenB
Version: GIT
OS: Linux

Re: building git binary for Local Weather development

Postby Thorsten » Mon Sep 27, 2010 11:11 am

Okay, I built Flightgear with

Code: Select all
make CXXFLAGS="-s -O3 -march=i686"


and that seems to help a bit - I was able to have some clouds with a decent framerate most of the time. I'll now try to do the same for simgear as well - should these flags also be used for compiling OSG?

Definitely weird - the framerate depends strongly on my view direction. If I view the same scenery either through the cockpit front window (i.e. normal) and through the side window (i.e. passing by), I see almost a factor 2 in framerate - apparently seeing cockpit instruments is very expensive...
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: building git binary for Local Weather development

Postby AndersG » Mon Sep 27, 2010 3:55 pm

Thorsten wrote:Definitely weird - the framerate depends strongly on my view direction. If I view the same scenery either through the cockpit front window (i.e. normal) and through the side window (i.e. passing by), I see almost a factor 2 in framerate - apparently seeing cockpit instruments is very expensive...


If you did build OSG in debug mode that costs a lot. Make sure the cmake build type is set to Release or RelWithDbgInfo(?).

/Anders
Callsign: SE-AG
Aircraft (uhm...): Submarine Scout, Zeppelin NT, ZF Navy free balloon, Nordstern, Hindenburg, Short Empire flying-boat, ZNP-K, North Sea class, MTB T21 class, U.S.S. Monitor, MFI-9B, Type UB I submarine, Gokstad ship, Renault FT.
AndersG
 
Posts: 2525
Joined: Wed Nov 29, 2006 10:20 am
Location: Göteborg, Sweden
Callsign: SE-AG
OS: Debian GNU Linux

Re: building git binary for Local Weather development

Postby Thorsten » Mon Sep 27, 2010 4:40 pm

If you did build OSG in debug mode that costs a lot. Make sure the cmake build type is set to Release or RelWithDbgInfo(?).


Sorry, I'm just learning how to build the whole thing myself - where in the whole process would I set what flag to what?
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: building git binary for Local Weather development

Postby AndersG » Mon Sep 27, 2010 5:56 pm

You can set the build type in ccmake or from the commandline, see http://wiki.flightgear.org/index.php/OpenSceneGraph#Compiling_OpenSceneGraph.

/Anders
Callsign: SE-AG
Aircraft (uhm...): Submarine Scout, Zeppelin NT, ZF Navy free balloon, Nordstern, Hindenburg, Short Empire flying-boat, ZNP-K, North Sea class, MTB T21 class, U.S.S. Monitor, MFI-9B, Type UB I submarine, Gokstad ship, Renault FT.
AndersG
 
Posts: 2525
Joined: Wed Nov 29, 2006 10:20 am
Location: Göteborg, Sweden
Callsign: SE-AG
OS: Debian GNU Linux

Re: building git binary for Local Weather development

Postby Thorsten » Tue Sep 28, 2010 9:27 am

Thanks, recompining OSG with the set of options indicated in the Wiki made a lot of difference. I think it's now almost as fast as my 2.0.0 :D

GIT still gives me periodical messages

Code: Select all
 Error: connect() failed in make_client_socket()
SG_IO_OUT socket creation failed


to the console - any idea what it is trying to do?
Thorsten
 
Posts: 12490
Joined: Mon Nov 02, 2009 9:33 am

Re: building git binary for Local Weather development

Postby AndersG » Tue Sep 28, 2010 4:08 pm

Thorsten wrote:any idea what it is trying to do?


Great that recompiling OSG helped. My first suspect would be that real weather fetch is active but failing to connect unless you have other protocols added to your command line.

Cheers,

Anders
Callsign: SE-AG
Aircraft (uhm...): Submarine Scout, Zeppelin NT, ZF Navy free balloon, Nordstern, Hindenburg, Short Empire flying-boat, ZNP-K, North Sea class, MTB T21 class, U.S.S. Monitor, MFI-9B, Type UB I submarine, Gokstad ship, Renault FT.
AndersG
 
Posts: 2525
Joined: Wed Nov 29, 2006 10:20 am
Location: Göteborg, Sweden
Callsign: SE-AG
OS: Debian GNU Linux

Previous

Return to Compiling

Who is online

Users browsing this forum: No registered users and 4 guests