Building FlightGear - Debian: Difference between revisions

m
Marked as WIP
m (added dependency libasound2-dev to fgcom)
m (Marked as WIP)
Line 1: Line 1:
HowTo build [[FlightGear]] [[Changelog_2.8.0|2.8.0]] or bleeding edge development version, hereinafter simply called ''[[GIT]]'', on GNU/Linux [http://www.debian.org/ Debian] '''Stable''' 6.x (Squeeze) and '''Testing''' (Wheezy).
{{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]].
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]].
If you don't want to get your hands dirty, have a look at [[Scripted Compilation on Linux Debian/Ubuntu]].
Line 28: Line 32:
osg: libxml2-dev libcurl4-gnutls-dev/libcurl4-openssl-dev libgtkglext1-dev libopenal-dev libpng12-dev librsvg2-dev libtiff4-dev
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
sg: libalut-dev libboost1.42-dev libsvn-dev
fg: freeglut3-dev (libfltk1.1-dev fluid) (libudev-dev)
fg: freeglut3-dev (libfltk1.1-dev (für fgadmin) fluid) (libudev-dev)
-->
-->




== Build and install ==
== 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 install</code> commands. We'll use <code>$prefix</code> as a placeholder for this directory. <br />
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:
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 prefix=$HOME/FG-2.8.0 && mkdir $prefix
  export srcdir=$HOME/src && mkdir $srcdir
  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.
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.
Line 44: Line 50:


=== libopenal ===
=== libopenal ===
<!-- To be removed in summer 2012 -->
<!-- To be removed in summer 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.
<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
  cd $srcdir
Line 63: Line 69:
  ./autogen.sh
  ./autogen.sh
  ./configure --prefix=$prefix
  ./configure --prefix=$prefix
  make install
  make -j2 install
<!--If it does not compile, go back some revisions. Before invoking the <code>sed</code> command do:
<!--If it does not compile, go back some revisions. Before invoking the <code>sed</code> command do:
  svn update -r2166 -->
  svn update -r2166 -->
Line 69: Line 75:


=== [[OpenSceneGraph]] ===
=== [[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 />
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>
<u>2.8.0 and GIT:</u>
Line 76: Line 84:
  cmake -D CMAKE_BUILD_TYPE="Release" -DLIB_POSTFIX="" \
  cmake -D CMAKE_BUILD_TYPE="Release" -DLIB_POSTFIX="" \
       -D CMAKE_INSTALL_PREFIX:PATH="$prefix" $srcdir/OpenSceneGraph
       -D CMAKE_INSTALL_PREFIX:PATH="$prefix" $srcdir/OpenSceneGraph
  make install
  make -j2 install




Line 91: Line 99:
  mkdir $srcdir/sg-build && cd $srcdir/sg-build
  mkdir $srcdir/sg-build && cd $srcdir/sg-build
  cmake -D CMAKE_INSTALL_PREFIX:PATH="$prefix" $srcdir/simgear
  cmake -D CMAKE_INSTALL_PREFIX:PATH="$prefix" $srcdir/simgear
  make install
  make -j2 install




Line 106: Line 114:
  mkdir $srcdir/fg-build && cd $srcdir/fg-build
  mkdir $srcdir/fg-build && cd $srcdir/fg-build
  cmake -D CMAKE_INSTALL_PREFIX:PATH="$prefix" $srcdir/flightgear
  cmake -D CMAKE_INSTALL_PREFIX:PATH="$prefix" $srcdir/flightgear
  make install
  make -j2 install




Line 125: Line 133:
  export LD_LIBRARY_PATH=$prefix/lib/:$LD_LIBRARY_PATH
  export LD_LIBRARY_PATH=$prefix/lib/:$LD_LIBRARY_PATH
  $prefix/bin/fgfs --fg-root=$prefix/data
  $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.
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:
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
  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!]].  
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!]]-->.  




Line 147: Line 155:
  ./autogen.sh
  ./autogen.sh
  ./configure --prefix=$prefix --with-fgbase=$prefix/data
  ./configure --prefix=$prefix --with-fgbase=$prefix/data
  make install
  make -j2 install
  cp -R $srcdir/atlas/src/data/* $prefix/data/Atlas
  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:
<!--If it does not compile, go back some commits. Before invoking the <code>autogen.sh</code> command do:
Line 168: Line 176:
  svn co https://appfgcom.svn.sourceforge.net/svnroot/fgcom/trunk fgcom
  svn co https://appfgcom.svn.sourceforge.net/svnroot/fgcom/trunk fgcom
  cd fgcom/src
  cd fgcom/src
  make INSTALL_BIN=$prefix/bin INSTALL_DIR=$prefix/fgcom \
  make -j2 install_BIN=$prefix/bin INSTALL_DIR=$prefix/fgcom \
     PLIB_PREFIX=$prefix [OPENAL_PREFIX=$prefix] install
     PLIB_PREFIX=$prefix [OPENAL_PREFIX=$prefix] install
Create an .alsoftrc file as shown in [[FGCOM_Testing#Special_for_Linux_.28.alsoftrc.29|FGCOM Testing]].
Create an .alsoftrc file as shown in [[FGCOM_Testing#Special_for_Linux_.28.alsoftrc.29|FGCOM Testing]].
Line 182: Line 190:
  mkdir $srcdir/fgrun-build && cd $srcdir/fgrun-build
  mkdir $srcdir/fgrun-build && cd $srcdir/fgrun-build
  LANG=; cmake -D CMAKE_INSTALL_PREFIX:PATH="$prefix" $srcdir/fgrun-1.6.2
  LANG=; cmake -D CMAKE_INSTALL_PREFIX:PATH="$prefix" $srcdir/fgrun-1.6.2
  make install
  make -j2 install


<u>GIT only:</u>
<u>GIT only:</u>
Line 189: Line 197:
  mkdir $srcdir/fgrun-build && cd $srcdir/fgrun-build
  mkdir $srcdir/fgrun-build && cd $srcdir/fgrun-build
  LANG=; cmake -D CMAKE_INSTALL_PREFIX:PATH="$prefix" $srcdir/fgrun
  LANG=; cmake -D CMAKE_INSTALL_PREFIX:PATH="$prefix" $srcdir/fgrun
  make install
  make -j2 install


<u>2.8.0 and GIT:</u>
<u>2.8.0 and GIT:</u>
Line 207: Line 215:
  ./autogen.sh
  ./autogen.sh
  ./configure --prefix=$prefix
  ./configure --prefix=$prefix
  make install
  make -j2 install




Line 247: Line 255:
  sed "s|/usr/local/lib|$prefix/lib|" -i Makefile
  sed "s|/usr/local/lib|$prefix/lib|" -i Makefile
  sed "s|/usr/local/include|$prefix/include|" -i Makefile
  sed "s|/usr/local/include|$prefix/include|" -i Makefile
  make install
  make -j2 install
   
   
  # newmat install
  # newmat install
Line 263: Line 271:
  ./configure --prefix=$prefix
  ./configure --prefix=$prefix
  sed s/-O2// -i src/Lib/TriangleJRS/Makefile
  sed s/-O2// -i src/Lib/TriangleJRS/Makefile
  make install
  make -j2 install




392

edits