Hi fellow wiki editors!

To help newly registered users get more familiar with the wiki (and maybe older users too) there is now a {{Welcome to the wiki}} template. Have a look at it and feel free to add it to new users discussion pages (and perhaps your own).

I have tried to keep the template short, but meaningful. /Johan G


Jump to: navigation, search

Building FlightGear - Debian

520 bytes added, 00:35, 21 February 2013
Marked as WIP
{{WIP|Revise due to update to FG 2.10}} HowTo build [[FlightGear]] <u>[[Changelog_2.8.0|2.8.0]] </u> or bleeding edge development version, hereinafter simply called ''<u>[[GIT]]''</u>, on GNU/Linux [http://www.debian.org/ Debian] '''Stable''' 6.x (Squeeze) and '''Testing''' (Wheezy).
The meaning of this article is to be a short, '''checklist''' like, overview of the specific steps to compile FlightGear and components on Debian. For more detailed information please refer to the main article [[Building_FlightGear_-_Linux | Building FlightGear on Linux]].
[[File:Zeichen_144_icon.png|21px]] For beginners with compiling who want to build version 2.10.x it is highly recommended to follow this guide step by step.
If you don't want to get your hands dirty, have a look at [[Scripted Compilation on Linux Debian/Ubuntu]].
osg: libxml2-dev libcurl4-gnutls-dev/libcurl4-openssl-dev libgtkglext1-dev libopenal-dev libpng12-dev librsvg2-dev libtiff4-dev
sg: libalut-dev libboost1.42-dev libsvn-dev
fg: freeglut3-dev (libfltk1.1-dev (für fgadmin) fluid) (libudev-dev)
== Build and install ==
Because we are going to install versions different to the ones in the repositories, it is recommended to install FlightGear in a place independent of the base system, such as <code>/usr/local/FG-2.8.0</code> or <code>$HOME/FG-2.8.0</code>. This way also has the advantage of easily managing several FlightGear versions, even with different versions of OpenSceneGraph and/or plib. I suggest to make this directory writeable by the user so there is no need to become root for the <code>make -j2 install</code> commands. We'll use <code>$prefix</code> as a placeholder for this directory. <br />
Another placeholder will be <code>$srcdir</code>, it stands for the absolute path to the directory which is supposed to keep the folders of the various source codes. So, in the following instructions, you have to replace these with the local paths or even <code>export</code> them during the process:
export prefix=$HOME/FG-2.8.0 && mkdir $prefix
export srcdir=$HOME/src && mkdir $srcdir
To have a build with debugging symbols add <code>-D CMAKE_BUILD_TYPE="RelWithDebInfo"</code> to SimGear's and FlightGear's cmake options.
Have in mind that the data is a relatively large download (GIT about 5 GB and 2.8.0 650 MB). So, to save some time, it is a good idea to [[#FlightGear data|fetch]] it while building the sources.
=== libopenal ===
<!-- To be removed in summer 2012 2013 -->
<u>Lenny only!</u> The libopenal-dev package in Lenny is too old for [[fgcom]]. For FlightGear it does work but not all features (like doppler) are available, so installing an up to date version is recommended anyway.
cd $srcdir
./configure --prefix=$prefix
make -j2 install
<!--If it does not compile, go back some revisions. Before invoking the <code>sed</code> command do:
svn update -r2166 -->
=== [[OpenSceneGraph]] ===
<u>Squeeze</u> 3.0.1
For <u>2.8.0</u> at least version 3.0.1 is recommended. <u>GIT</u> users, especially developers, may want to use the latest release or even bleeding edge code here instead. <br />
<u>2.8.0 and GIT:</u>
cmake -D CMAKE_BUILD_TYPE="Release" -DLIB_POSTFIX="" \
-D CMAKE_INSTALL_PREFIX:PATH="$prefix" $srcdir/OpenSceneGraph
make -j2 install
mkdir $srcdir/sg-build && cd $srcdir/sg-build
cmake -D CMAKE_INSTALL_PREFIX:PATH="$prefix" $srcdir/simgear
make -j2 install
mkdir $srcdir/fg-build && cd $srcdir/fg-build
cmake -D CMAKE_INSTALL_PREFIX:PATH="$prefix" $srcdir/flightgear
make -j2 install
export LD_LIBRARY_PATH=$prefix/lib/:$LD_LIBRARY_PATH
$prefix/bin/fgfs --fg-root=$prefix/data
Have in mind that <code>fgfs</code> need to find our self compiled libraries and therefore we have to tell the linker (ld) where to find them. That is what the first line here does. You might want to add this line to your <code>$HOME/.bashrc</code> to have this as a persistent setting(may cause problems, if one has installed more than one version of FlightGear!).
To avoid the need to give the path to the <code>fgfs</code> command in the second line, you might consider to create a symlink to a place that is listed in $PATH:
ln -s $prefix/bin/fgfs $HOME/bin/fgfs
For the future, if you want to start FlightGear from command line have a look at [[fgfsrc]], if you prefer a graphical user interface continue with [[#fgrun|compiling fgrun]] <!--or check [[FGo!]]-->.
./configure --prefix=$prefix --with-fgbase=$prefix/data
make -j2 install
cp -R $srcdir/atlas/src/data/* $prefix/data/Atlas
<!--If it does not compile, go back some commits. Before invoking the <code>autogen.sh</code> command do:
svn co https://appfgcom.svn.sourceforge.net/svnroot/fgcom/trunk fgcom
cd fgcom/src
make INSTALL_BIN-j2 install_BIN=$prefix/bin INSTALL_DIR=$prefix/fgcom \
PLIB_PREFIX=$prefix [OPENAL_PREFIX=$prefix] install
Create an .alsoftrc file as shown in [[FGCOM_Testing#Special_for_Linux_.28.alsoftrc.29|FGCOM Testing]].
mkdir $srcdir/fgrun-build && cd $srcdir/fgrun-build
LANG=; cmake -D CMAKE_INSTALL_PREFIX:PATH="$prefix" $srcdir/fgrun-1.6.2
make -j2 install
<u>GIT only:</u>
mkdir $srcdir/fgrun-build && cd $srcdir/fgrun-build
LANG=; cmake -D CMAKE_INSTALL_PREFIX:PATH="$prefix" $srcdir/fgrun
make -j2 install
<u>2.8.0 and GIT:</u>
./configure --prefix=$prefix
make -j2 install
sed "s|/usr/local/lib|$prefix/lib|" -i Makefile
sed "s|/usr/local/include|$prefix/include|" -i Makefile
make -j2 install
# newmat install
./configure --prefix=$prefix
sed s/-O2// -i src/Lib/TriangleJRS/Makefile
make -j2 install

Navigation menu