Building FlightGear - Debian: Difference between revisions

reviewed for 2.4.0
(Revert changes due to issues between FGFs and OSG)
(reviewed for 2.4.0)
Line 1: Line 1:
HowTo build FlightGear 2.2.0 or bleeding edge development version, hereinafter simply called ''GIT'', on GNU/Linux Debian '''Stable''' 6.x (Squeeze) and '''Testing''' (Wheezy).
HowTo build FlightGear 2.4.0 or bleeding edge development version, hereinafter simply called ''GIT'', on GNU/Linux Debian '''Stable''' 6.x (Squeeze) and '''Testing''' (Wheezy).


Even on Debian '''Oldstable''' 5.x (Lenny) this guide will work for both, 2.2.0 and GIT. At least until one or more dependencies of the GIT version are changing or beeing added.
Even on Debian '''Oldstable''' 5.x (Lenny) this guide will work for both, 2.4.0 and GIT. At least until one or more dependencies of the GIT version are changing or beeing added.


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]].
Line 26: Line 26:


== 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 FG-2.2.0 and/or GIT in a place independent to the base system such as /usr/local/FG-2.2.0, /opt/FG-2.2.0 or in a subdirectory of your $HOME. I suggest to make it writeable by the user that there is no need to become root for the <code>make install</code> commands. I'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 FG-2.4.0 and/or GIT in a place independent to the base system such as /usr/local/FG-2.4.0, /opt/FG-2.4.0 or in a subdirectory of your $HOME. I suggest to make it writeable by the user that there is no need to become root for the <code>make install</code> commands. I'll use <code>$prefix</code> as a placeholder for this directory. <br />
Another one 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 one 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=[path to install to]
  export prefix=[path to install to]
  export srcdir=[path to sources]
  export srcdir=[path to sources]


Have in mind that the data is a relatively large download (GIT about 3.5 GB and 2.2.0 300 MB). So, to save some time, it is a good idea to fetch it while building the sources.
Have in mind that the data is a relatively large download (GIT about 3.5 GB and 2.4.0 410 MB). So, to save some time, it is a good idea to fetch it while building the sources.


For some basic info on git commands for FlightGear users we have a [[Git#For dummies|git for dummies]] section.
For some basic info on git commands for FlightGear users we have a [[Git#For dummies|git for dummies]] section.
Line 58: Line 58:


=== OpenSceneGraph ===
=== OpenSceneGraph ===
 
<u>GIT</u> users, especially developers, may want to use the latest release or even bleeding edge code here. Have in mind that, at the time of the FlightGear 2.4.0 release, there are some issues with newer versions than 2.9.10!
 
  ln -s lib $prefix/lib64  # 64bit OS' only, if lib64 does not exist
  ln -s lib $prefix/lib64  # 64bit OS' only, if lib64 does not exist
  cd $srcdir
  cd $srcdir
  svn co http://www.openscenegraph.org/svn/osg/OpenSceneGraph/tags/OpenSceneGraph-2.9.10 OpenSceneGraph
  svn co http://www.openscenegraph.org/svn/osg/OpenSceneGraph/tags/OpenSceneGraph-2.9.10 OpenSceneGraph  
  mkdir osg-build && cd osg-build
  mkdir osg-build && cd osg-build
  cmake -D CMAKE_BUILD_TYPE="Release" \
  cmake -D CMAKE_BUILD_TYPE="Release" \
       -D CMAKE_INSTALL_PREFIX:PATH="$prefix" $srcdir/OpenSceneGraph
       -D CMAKE_INSTALL_PREFIX:PATH="$prefix" $srcdir/OpenSceneGraph
  make install
  make install


=== SimGear ===
=== SimGear ===
<u>2.2.0 and GIT:</u>
<u>2.4.0 and GIT:</u>
  cd $srcdir
  cd $srcdir
  git clone git://gitorious.org/fg/simgear.git simgear
  git clone git://mapserver.flightgear.org/simgear
  cd simgear
  cd simgear


<u>2.2.0 only:</u>
<u>2.4.0 only:</u>
  git checkout -b releases/2.2.0 origin/releases/2.2.0
  git checkout -b 2.4.0 origin/release/2.4.0


<u>2.2.0 and GIT:</u>
<u>2.4.0 and GIT:</u>
  ./autogen.sh
  ./autogen.sh
  ./configure --prefix=$prefix <!--CPPFLAGS=-I$prefix/include/-->
  ./configure --prefix=$prefix <!--CPPFLAGS=-I$prefix/include/-->
Line 84: Line 84:


=== FlightGear source ===
=== FlightGear source ===
<u>2.2.0 and GIT:</u>
<u>2.4.0 and GIT:</u>
  cd $srcdir
  cd $srcdir
  git clone git://gitorious.org/fg/flightgear.git flightgear
  git clone git://mapserver.flightgear.org/flightgear
  cd flightgear
  cd flightgear


<u>2.2.0 only:</u>
<u>2.4.0 only:</u>
  git checkout -b releases/2.2.0 origin/releases/2.2.0
  git checkout -b 2.4.0 origin/release/2.4.0


<u>2.2.0 and GIT:</u>
<u>2.4.0 and GIT:</u>
  ./autogen.sh
  ./autogen.sh
  ./configure --prefix=$prefix <!--CPPFLAGS=-I$prefix/include/-->
  ./configure --prefix=$prefix
  make install
  make install




=== FlightGear data ===
=== FlightGear data ===
<u>2.2.0 only:</u>
<u>2.4.0 only:</u>
At the time of writing, 2.2.0 is not yet released, there is no tar archive for the data available. Test pilots for this release are advised to use the ''release/2.2.0'' branch from git. The following URL for wget will be updated, if it is not working, as soon as 2.2.0 is released.
  cd $prefix
  cd $prefix
  wget http://mirrors.ibiblio.org/pub/mirrors/flightgear/ftp/Shared/FlightGear-data-2.2.0.tar.bz2
  wget http://mirrors.ibiblio.org/pub/mirrors/flightgear/ftp/Shared/FlightGear-data-2.4.0.tar.bz2
  tar xjf FlightGear-data-2.2.0.tar.bz2
  tar xjf FlightGear-data-2.4.0.tar.bz2


<u>GIT only:</u>
<u>GIT only:</u>
Line 109: Line 108:
FlightGear's primary git server on gitorious is known to have trouble cloning the data, the mapserver's mirror usually has no problems:
FlightGear's primary git server on gitorious is known to have trouble cloning the data, the mapserver's mirror usually has no problems:
  cd $prefix
  cd $prefix
  git clone git://mapserver.flightgear.org/fgdata
  git clone git://mapserver.flightgear.org/fgdata data




Line 115: Line 114:
When all the builds are done and the data download has finished it is time for a test run:
When all the builds are done and the data download has finished it is time for a test run:
  export LD_LIBRARY_PATH=$prefix/lib/:$LD_LIBRARY_PATH
  export LD_LIBRARY_PATH=$prefix/lib/:$LD_LIBRARY_PATH
  $prefix/bin/fgfs --fg-root=$prefix/fgdata
  $prefix/bin/fgfs --fg-root=$prefix/data


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!]]. 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.
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!]]. 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.
392

edits