Board index FlightGear Support Compiling

Suggested changes to WIKI-Page Building FlightGear - Debian

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

Suggested changes to WIKI-Page Building FlightGear - Debian

Postby danielHL » Fri May 02, 2014 7:36 pm

Hi everyone,

I just spent two days building Flightgear GIT on Debian. I followed the great wiki guide "Building FlightGear - Debian". Some problems came up, but my experiences gained from several LinuxFromScratch-runs have finally paid out ;-)

I would suggest the following changes to the guide:

OpenSceneGraph:
FG GIT only (currently?) only builds against OpenSceneGraph-3.2.0, not against newer releases. Errors would be linker problems concerning libosg when building FG.

SimGear and FlightGear:
I had to add "-D CMAKE_PREFIX_PATH="$FG_INSTALL_DIR" to the cmake options to avoid various linker problems. Otherwise, the script couldn't find the self-built libOSG and libsimgear but defaulted to my older system installation in /usr/lib etc. Seems useful to add this if you want to keep the FlightGear-version of your distribution installed aswell.
e.g.:
cmake -D CMAKE_INSTALL_PREFIX="$FG_INSTALL_DIR" -D CMAKE_PREFIX_PATH="$FG_INSTALL_DIR" $FG_SRC_DIR/simgear.git

Atlas:
Had to change the ./configure-Line to
./configure --prefix=$FG_INSTALL_DIR --with-fgbase=$FG_INSTALL_DIR/data --with-plib=$FG_INSTALL_DIR --with-simgear=$FG_INSTALL_DIR --with-osg=$FG_INSTALL_DIR --enable-simgear-shared

Errors with the wiki-suggested line were ld defaulting to system versions of plib, libosg and simgear. Also, the linker somehow expects static libraries if not told otherwise (--enable-simgear-shared).

I don't know if this happens to all debian users, but i only got FG to build correctly using these altered commands. Can someone verify this, please? Who do I need to inform to get these changes on the fg-wiki?

CU
Daniel
danielHL
 
Posts: 280
Joined: Fri May 02, 2014 7:23 pm
Callsign: D-FMPW
Version: next
OS: Linux

Re: Suggested changes to WIKI-Page Building FlightGear - Deb

Postby Hooray » Fri May 02, 2014 7:41 pm

Hi & welcome, and thanks for pointing out such problems.
Regarding updating the article, please feel free to do it yourself, it's a wiki after all - you only need to register an account, you can add your comments next to the other instructions for now.
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: Suggested changes to WIKI-Page Building FlightGear - Deb

Postby sanhozay » Fri May 02, 2014 9:54 pm

danielHL wrote in Fri May 02, 2014 7:36 pm:FG GIT only (currently?) only builds against OpenSceneGraph-3.2.0, not against newer releases. Errors would be linker problems concerning libosg when building FG.

Did you mean older here? I had a similar issue with Xubuntu 13.10 where I had to download and compile OSG because the packaged version was too old.

SimGear and FlightGear:
I had to add "-D CMAKE_PREFIX_PATH="$FG_INSTALL_DIR" to the cmake options to avoid various linker problems. Otherwise, the script couldn't find the self-built libOSG and libsimgear but defaulted to my older system installation in /usr/lib etc. Seems useful to add this if you want to keep the FlightGear-version of your distribution installed aswell.
e.g.:
cmake -D CMAKE_INSTALL_PREFIX="$FG_INSTALL_DIR" -D CMAKE_PREFIX_PATH="$FG_INSTALL_DIR" $FG_SRC_DIR/simgear.git

Looking at my little build script, I think I ran into a similar issue but solved it with CMAKE_INSTALL_PREFIX. Additionally, I had to define CMAKE_LIBRARY_PATH to pick up the compiled OSG library.

Did you have to set LD_LIBRARY_PATH to pick up OSG at runtime?

You might want to use "-D CMAKE_BUILD_TYPE=Release" too, so that you get the right optimizer flags.
sanhozay
 
Posts: 1207
Joined: Thu Dec 26, 2013 12:57 pm
Location: EGNM
Callsign: G-SHOZ
Version: Git
OS: Ubuntu 16.04

Re: Suggested changes to WIKI-Page Building FlightGear - Deb

Postby curVV » Tue May 06, 2014 6:43 pm

Did you have to set LD_LIBRARY_PATH to pick up OSG at runtime?


I had to. I thought FG automagically looked in FG_install_dir/lib for libraries.
curVV
 
Posts: 7
Joined: Mon May 05, 2014 7:57 pm

Re: Suggested changes to WIKI-Page Building FlightGear - Deb

Postby Hooray » Tue May 06, 2014 7:13 pm

only if -DCMAKE_INSTALL_PREFIX is set accordingly for all dependencies (especially OSG, SG & FG)
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: Suggested changes to WIKI-Page Building FlightGear - Deb

Postby curVV » Tue May 06, 2014 8:11 pm

What's the difference between these two:

-DCMAKE_INSTALL_PREFIX
and
-DCMAKE_PREFIX_PATH

I set both to install dir building OSG, SG and FG but still it complained about not finding libosgText.so.100... until I set LD_LIBRARY_PATH.
curVV
 
Posts: 7
Joined: Mon May 05, 2014 7:57 pm


Return to Compiling

Who is online

Users browsing this forum: No registered users and 2 guests