Building FlightGear - Debian _FlightGear stable/3.2 on Debian _FlightGear 3.2 with Git _FlightGear 3.2 Scripted Compilation ======= FlightGear stable/3.2 on Debian ======== Requirements and Preparations A bunch of packages (as well as some of their dependencies) are required to compile FlightGear: Tools su -c "apt-get install automake cmake g++ gcc git make sed subversion" Dependencies su -c "apt-get install \ freeglut3-dev libboost-dev libcurl4-openssl-dev libdbus-1-dev \ libfltk1.3-dev libgtkglext1-dev libjpeg8-dev libopenal-dev \ librsvg2-dev libxml2-dev" If you prefer you might replace "libcurl4-openssl-dev" by "libcurl4-gnutls-dev". If "libjpeg8-dev" breaks package dependencies, just install one of the other versions' -dev. Add "libudev-dev" if you need FG's feature -D EVENT_INPUT=ON. Zeichen 144 icon.png During installation development packages of libraries which are going to be compiled must not be installed. They can safely be re-installed after compilation. Namely here these might be "libplib-dev", "libopenscenegraph-dev" and "simgear-dev". Build and install Because we are going to install versions different to the ones in the Debian repositories, it is recommended to install FlightGear in a place independent of the base system, such as /usr/local/FG-3.2 or $HOME/FG-3.2. This way also has the advantage of easily managing several FlightGear versions, even with different versions of OpenSceneGraph and/or plib, simply by altering the installation prefix. I suggest to make this directory writeable by the user so there is no need to become root for the make -j2 install commands. We'll use $FG_INSTALL_DIR as a placeholder for this directory. Another placeholder will be $FG_SRC_DIR, it stands for the absolute path to the directory which is supposed to keep the folders of the various source codes. So, in the instructions below, you have to replace these with the local paths or even export them (in every terminal you're using them) for the process: export FG_INSTALL_DIR=$HOME/FG-3.2-rc1 && mkdir $FG_INSTALL_DIR export FG_SRC_DIR=$HOME/src && mkdir $FG_SRC_DIR Have in mind that the data is a relatively large download (GIT about 8 GiB (required disk space 18 GiB) and growing / 3.2 about 1.2 GB). 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 laymen section. For more/advanced cmake options and SimGear's and FlightGear's optional features see the cmake article. plib 3.2 and GIT: Latest SVN is required. cd $FG_SRC_DIR svn co https://svn.code.sf.net/p/plib/code/trunk plib.svn cd plib.svn sed s/PLIB_TINY_VERSION\ \ 5/PLIB_TINY_VERSION\ \ 6/ -i src/util/ul.h ./autogen.sh ./configure --prefix=$FG_INSTALL_DIR make -j2 install OpenSceneGraph 3.2's optimum version is OSG 3.2.0. GIT users, especially developers, may want to use the latest DeveloperRelease or even bleeding edge code here instead. Note: FG 3.2.0 proved to be unstable with OSG 3.2.1! 3.2 and GIT: cd $FG_SRC_DIR svn co http://svn.openscenegraph.org/osg/OpenSceneGraph/tags/OpenSceneGraph-3.2.0 mkdir build-osg; cd build-osg cmake -D CMAKE_BUILD_TYPE="Release" -D LIB_POSTFIX="" \ -D CMAKE_INSTALL_PREFIX:PATH="$FG_INSTALL_DIR" $FG_SRC_DIR/OpenSceneGraph-3.2.0 make -j2 install SimGear 3.2 and GIT: cd $FG_SRC_DIR git clone git://mapserver.flightgear.org/simgear simgear.git 3.2 only: cd simgear.git git checkout origin/release/3.2.0 3.2 and GIT: mkdir $FG_SRC_DIR/build-sg; cd $FG_SRC_DIR/build-sg cmake -D CMAKE_INSTALL_PREFIX:PATH="$FG_INSTALL_DIR" $FG_SRC_DIR/simgear.git make -j2 install *----------------------- FlightGear source 3.2 and GIT: export SIMGEAR_DIR=$FG_INSTALL_DIR/include/simgear cd $FG_SRC_DIR git clone git://mapserver.flightgear.org/flightgear flightgear.git 3.2 only: cd flightgear.git git checkout origin/release/3.2.0 3.2 and GIT: mkdir $FG_SRC_DIR/build-fg; cd $FG_SRC_DIR/build-fg cmake -D CMAKE_INSTALL_PREFIX:PATH="$FG_INSTALL_DIR" $FG_SRC_DIR/flightgear.git make -j2 install *=== FlightGear data 3.2 only: Please have a look at the mirror list for a server close to your location. cd $FG_INSTALL_DIR #wget http://mirrors.ibiblio.org/flightgear/ftp/Shared/FlightGear-data-3.2.0.tar.bz2 #wget ftp://ftp.snt.utwente.nl/pub/software/flightgear/ftp/Shared/FlightGear-data-3.2.0-rc1.tar.bz2 wget http://ftp.igh.cnrs.fr/pub/flightgear/ftp/Shared/FlightGear-data-3.2.0-rc1.tar.bz2 tar xjf FlightGear-data-3.2.0-rc1.tar.bz2 GIT only: For slow/unstable internet connections it is recommended to download the fgdata.bundle instead of cloning the data. cd $FG_INSTALL_DIR git clone git://mapserver.flightgear.org/fgdata fgdata *----------------------- Trial run and finishing process When all the builds are done and the data download has finished it is time for a test run: export LD_LIBRARY_PATH=$FG_INSTALL_DIR/lib/:$LD_LIBRARY_PATH $FG_INSTALL_DIR/bin/fgfs --fg-root=$FG_INSTALL_DIR/fgdata The fgfs binary needs to find our self compiled libraries at runtime 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 $HOME/.bashrc to have this as a persistent setting (may cause problems, if one has installed more than one version of FlightGear!). Have in mind, the $FG_INSTALL_DIR and $FG_SRC_DIR variables are available for this session only. For future use of these lines, replace them by the real paths. To avoid the need to give the path to the fgfs command each time, you might consider to create a symlink at a place that is listed in $PATH: ln -s $FG_INSTALL_DIR/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 compiling fgrun or check out another launcher. Optional Software Zeichen 101 icon.png Some of the below instructions possibly are not up to date. Please feel free to revise them. Feel free to add the commands to install other FlightGear related projects. Atlas One more Package has to be installed: "libglew1.5-dev" cd $FG_SRC_DIR git clone http://mapserver.flightgear.org/git/atlas cd atlas ./autogen.sh ./configure --prefix=$FG_INSTALL_DIR --with-fgbase=$FG_INSTALL_DIR/data make -j2 install cp -R $FG_SRC_DIR/atlas/src/data/* $FG_INSTALL_DIR/data/Atlas $FG_INSTALL_DIR/bin/Atlas fgcom 3.0 There is nothing to compile because FGCom 3.0 is compiled with FlightGear. If you can't compile FlightGear you can download a pre-built binary at http://fgcom.flightgear.org/download fgcom (FG 2.12 and former) For fgcom install package "libasound2-dev". cd $FG_SRC_DIR git clone http://mapserver.flightgear.org/git/fgcom fgcom.git cd fgcom.git git checkout -b next origin/next mkdir $FG_SRC_DIR/build-fgcom; cd $FG_SRC_DIR/build-fgcom cmake -D CMAKE_INSTALL_PREFIX:PATH="$FG_INSTALL_DIR" $FG_SRC_DIR/fgcom.git make -j2 install Create an .alsoftrc file as shown in FGCOM Testing. fgrun Package "fluid" has to be installed. 3.2 and GIT: cd $FG_SRC_DIR git clone git://gitorious.org/fg/fgrun.git fgrun.git 3.2 only: cd fgrun.git git checkout origin/release/3.2.0 3.2 and GIT: mkdir $FG_SRC_DIR/build-fgrun; cd $FG_SRC_DIR/build-fgrun cmake -D CMAKE_INSTALL_PREFIX:PATH="$FG_INSTALL_DIR" $FG_SRC_DIR/fgrun.git make -j2 install Execute it: export LD_LIBRARY_PATH=$FG_INSTALL_DIR/lib/:$LD_LIBRARY_PATH $FG_INSTALL_DIR/bin/fgrun TaxiDraw Zeichen 101 icon.png Obsolete for airport creation, use WorldEditor instead. It is still useful for working on ground networks. To compile TaxiDraw we need to install some more packages: either "libcurl4-gnutls-dev" or "libcurl4-openssl-dev" for curl.h "wx2.8-headers" (at least, maybe even more than just that one. Please report! su -c "aptitude install [libcurl4-gnutls-dev|libcurl4-openssl-dev]" cd $FG_SRC_DIR git clone git://mapserver.flightgear.org/taxidraw cd taxidraw ./autogen.sh ./configure --prefix=$FG_INSTALL_DIR make -j2 install TerraGear Automatic Installation link If you are familiar with "download_and_compile.sh" script from Brisa you can donwload this script: http://clement.delhamaide.free.fr/download_and_compile_tg.sh This script is similar to Brisa's one (only usable for Debian/Mint/Ubuntu). This script installs TerraGear (latest version) and terragear-gui. How to use it? sh terragear_download_and_compile.sh -j 2 ALL Need some help? Look at forum topics: http://forum.flightgear.org/viewtopic.php?f=20&t=14849 After success installation you can exectute this command line in the terragear/bin directory in order to display every --help for each binary files: cd terragear/bin && for i in `ls`; do echo ""; echo "################# "$i" ##############"; ./$i --help; done Basic Installation To resolve some of the dependencies of TerraGear the GIT sections of steps plib, OpenSceneGraph and SimGear have to be done first. Additionally some packages and their dependencies have to be installed: su -c "apt-get install \ libgdal-dev libtiff4-dev libboost-signals-dev libboost-system-dev libboost-thread-dev" Squeeze users have to compile the CGAL dependency. On Wheezy just install package "libcgal-dev" instead. cd $FG_SRC_DIR wget https://gforge.inria.fr/frs/download.php/31174/CGAL-4.0.2.tar.bz2 tar xjf CGAL-4.0.2.tar.bz2 mkdir $FG_SRC_DIR/build-cgal; cd $FG_SRC_DIR/build-cgal cmake -D CMAKE_INSTALL_PREFIX:PATH="$FG_INSTALL_DIR" $FG_SRC_DIR/CGAL-4.0.2 make -j2 install Compile TerraGear: cd $FG_SRC_DIR git clone git://git.gitorious.org/fg/terragear.git mkdir $FG_SRC_DIR/build-tg; cd $FG_SRC_DIR/build-tg cmake -D CMAKE_INSTALL_PREFIX:PATH="$FG_INSTALL_DIR" $FG_SRC_DIR/terragear make -j2 install #-------------------------------------------------------------------------- ====== FlightGear 3.2 with Git ===== Requirements Before you can compile FlightGear, you need to have the following installed on your computer: C++ compiler These are: c++, cpp, gcc, g++ found under the /usr/bin directory. You will also need to have the tools autoconf and automake1.9 installed. GIT See FlightGear and Git. OpenGL support More specifically, your system needs the support for hardware accelerated graphics. You can check for this by running the following in a command line: $ glxinfo | grep direct Note: To run the above command, you need to have the tool mesa-utils installed. You should then see: direct rendering: Yes This means you are good to go as far as OpenGL support is concerned. If you see: direct rendering: No Don't panic yet. This may just mean some required libraries for hardware accelerated graphic are missing. Go ahead and try installing plib 1.8.5 and its dependencies first. If you still get the above message, then you will need to do some googling and troubleshoot yourself. Dependencies FlightGear is dependent on quite a few number of libraries. You do not need to compile all of them yourself, but you will at least need to have their development version installed. For example, the development version for package plib1.8.5 is plib1.8.5-dev. The dependency is summarized in the following tree. Please note that each library has its own dependencies, and most of these are not shown here. FlightGear OpenAL SimGear PLIB. Since March 2008, you will need version 1.8.5 - your distro probably supplies 1.8.4 still. For versions pre March 2008: (Free)GLUT or SDL (We recommend the use of SDL over Free/GLUT, however since March 2008, FreeGLUT as well as SDL are both considered deprecated, please only use --enable-osgviewer during configuration instead) OpenSceneGraph (check link for compatible versions) You also need the development files for several basic libraries to build the software, among them the following (the package names are for Debian and derivatives(?)): libfreetype6-dev libjpeg62-dev libungif4-dev libtiff4-dev libpng12-dev libxmu-dev libxi-dev zlib1g-dev libglut3-dev If you attack the above dependencies in the order listed below, you should be good: glut Most distributions include glut packages, although you may have to hunt for them. Make sure you install both the glut and glut-devel packages, otherwise FlightGear may be able to compile but won't run correctly. zlib Most distributions install the basic zlib libraries by default, but not the development portions. If you don't have zlib.h, you probably need to install the zlib-devel package for your distribution. plib Portability libraries and scene graph. OpenSceneGraph simgear Simulation support libraries. If you are building FlightGear from Git, you need the Git version of SimGear. If you have strange build errors, one of the first things to check is that you have an up-to-date version of SimGear built and installed. Compiling Assuming you are root, do: # cd /usr/local/src Note: When tracking a fast changing software like FlightGear/Git it is highly advisable to install it in a separate directory. That way one can also easily build and reinstall without being root, which greatly reduces the risk of messing up one's system. To install in a directory of your choice add the --prefix argument to configure. E.g. ./configure --prefix=$HOME/FlightGear. I would recommend installing all of OSG, plib, SimGear and FlightGear with the same prefix. Getting and compiling SimGear Step 1: Clone the SimGear git repository and set it up to track the 'next' branch. $ git clone git://gitorious.org/fg/simgear.git or if the git port is firewalled on you network, use the http transport $ git clone http://gitorious.org/fg/simgear.git By default after cloning you should have a local next branch that tracks the master next branch. It can be updated it with git pull. Step 2: The source code will be downloaded into a directory called simgear. Next, go into the directory and make preparations for the compilation: $ cd simgear $ cmake . Note that if you don't want to install simgear globally on the system but in a specific directory, you can do so by adding -DCMAKE_INSTALL_PREFIX==/path/to/your/fgInstallation to the cmake command Step 3: Compile and install SimGear by doing: $ make; make install Note: with gcc 4.2 or later,on some platforms, you can get compiling errors about alc.h like: '' has incomplete type take a look at http://bugs.gentoo.org/166723 Getting and compiling FlightGear Step 1: Clone the FlightGear git repository and set it up to track the 'next' branch. $ git clone git://gitorious.org/fg/flightgear.git By default after cloning you should have a local next branch that tracks the master next branch. It can be updated it with git pull. Step 2: Next, go into the folder and make preparations for the compilation: $ cd flightgear $ ./autogen.sh $ ./configure Note that if you don't want to install simgear globally on the system but in a specific directory, you can do so by adding --prefix=/path/to/your/fgInstallation to the ./configure command. If you didn't install OSG globally or in the same prefix as SimGear and FlightGear, you have to pass the OSG directory to the configure-command like this: $ ./configure --prefix=/path/to/fgInstallation --with-osg=/path/to/osg/installation --enable-osgviewer In this case you have to tell your system where to find the OSG libraries before you can run flightgear: $ export LD_LIBRARY_PATH=/path/to/osgInstallation/lib:$LD_LIBRARY_PATH Step 3: Now you can compile and install Flightgear by: $ make; make install Step 4: Clone the data directory: $ git clone git://gitorious.org/fg/fgdata.git The data directory is large (almost 2.5GB) so it will take considerable time to download. There mirror of fgdata that might be faster to download from: $ git clone git://mapserver.flightgear.org/fgdata The mirror is synchronized with the master so either will do. And install it in (or as) /usr/local/share/FlightGear $ mv fgdata /usr/local/share/flightgear #-------------------------------------------------------------------------- ======= FlightGear 3.2 Scripted Compilation ======= download the newest script with this command: wget -O download_and_compile.sh https://www.gitorious.org/fg/fgmeta/raw/next:download_and_compile.sh The conversion will: move or remove source directories for compatibility remove the build directory remove the install directory except for fgdata Cut to the Chase: for the impatient cd wget download_and_compile.sh https://www.gitorious.org/fg/fgmeta/raw/next:download_and_compile.sh chmod +x download_and_compile.sh mkdir -p stable mkdir -p next cd stable ../download_and_compile.sh -s cd ../next ../download_and_compile.sh -p n Disk Space Requirements As of 02/2013, this script will by at least require 24-30 gb of disk space, note that this includes the downloaded source trees and the build files, but also the fgdata checkout (which accounts approx. for 50% of the whole thing). List of compiled programs The script is able to download and compile: FlightGear (And all the data needed to use it) Fgrun FGo! FGX Terragear TerraGear_GUI OpenRadar OpenRTI Note that openRTI is just another optional dependency for HLA support: http://wiki.flightgear.org/FlightGear_HLA_support_(High_Level_Architecture) For the time being, you should be just fine building without HLA support. Eventually, the idea is for HLA to replace the existing MP system and even increasingly distribute the FlightGear architecture such that more and more components can be more easily run in separate threads or even separate processes, possibly even on different machines. So this is going to be an important feature for professional users, using several computers and screens to create a comprehensive and immersive simulation environment. At the moment, it's probably safe to say that HLA is only of interest to developers and people willing to play with experimental features. When building Next you may see build errors Keeping in mind that this script compiles bleeding edge software versions, using latest debian derivered distros, it can happen that the program that was successfully compiling last week, today does not. Building the stable version should always work unless there is a problem with the script Download You can download the script here: Primary site: download_and_compile.sh Mirror: download_and_compile.sh (not recently updated) The script is maintained in the FlightGear main repository. Remember to update this script whenever a new FlightGear version is released, so that you'll be able to download the latest stable revision. There is also another option for building FlightGear and all its dependencies in an automated fashion, please refer to: http://geoffmclane.com/fg/fgfs-052.htm Known Pitfalls FlightGear versions <= 3.0 are known to have a cmake build system issue related to NOT automatically reconfiguring the SG/FG sources after updating the version files in in $SG_SRC and $FG_SRC, which basically means that using "git pull" to update your source trees (via the d&c script) will create the latest binaries, but they may not be looking for the right base package data, because the source trees are still using the old version files found in the cmake cache. This has been encountered by various contributors, including at least one core developer. To work around this issue, simply switch to your SG/FG build directories and reconfigure each tree by running "cmake ." - for further info, see [1][2]. This should probably be removed. Stable is 3.0. Instructions To run download_and_compile.sh, just save it in a directory called for example: ~/fgfs then execute it (no need to execute it as root). Here is for example a sequence of commands to get the script from the master branch. You can replace master with next to get a later version of the script if one is available: mkdir ~/fgfs cd ~/fgfs wget http://www.gitorious.org/fg/fgmeta/raw/download_and_compile.sh chmod 755 download_and_compile.sh You have two options now: build the latest stable FlightGear release or build the current development version (bleeding edge). After building stable or the latest, if you need to build a different version, try the instructions for Avoiding Multiple Downloads of fgdata. Build the latest stable FlightGear release When executing the script, use the "-s" option to build the latest stable release: ./download_and_compile.sh -s Build the current FlightGear development version When executing the script without any options, the latest development version is built. Warning: The development version of Flightgear changes on an almost daily basis. It provides the latest features, but is not always guaranteed to work reliably. If you're unfamiliar with software testing, you may prefer to use the latest stable release. ./download_and_compile.sh Once the script is finished, you will successfully get Flightgear and Fgrun installed in the ~/fgfs directory. Launching FlightGear When using brisa's script, the two FG dependencies/libs are usually not installed system-wide, but in a custom location (that makes it possible, to easily use different OSG/SG/FG versions on a single system, i.e. for testing purposes - but also to have separate build trees (optimized/debug) ) - which is why you either need to set LD_LIBRARY_PATH or simply use Brisa's script to run everything (something like run_fgfs.sh, which automatically sets up all environment variables according to your build settings). To run your new git installation of FlightGear you have to launch the run_fgfs.sh command under the same folder, for example: cd ~/fgfs sh run_fgfs.sh Launching Fgrun Fgrun-page2.jpg For many users it's more comfortable having FlightGear launched by the graphical utility Fgrun which is installed as well in the same folder. You have to launch the run_fgrun.sh command, for example: cd ~/fgfs sh run_fgrun.sh fgrun will save its settings in ~/.fltk/flightgear.org/fgrun.prefs you may want to save copies of the preferences customized for stable and next. Launching Fgo! Fgo01.jpg This is a graphical utility written in python, You have to launch the run_fgo.sh command, for example: cd ~/fgfs sh run_fgo.sh Remember that the first time you run it, you have to go to preferences and set the binary and fgdata path (Do no set the working directory, you don't need it). Additional programs If you wish to get all the other programs, you need to launch the script adding the "ALL" option to the command line: ./download_and_compile.sh ALL This, will also install FGCOM, FGComGui and Atlas Launching FGCOM FGCOM is the system used by FlightGear to simulate radio communications between users. Launch it using the run_fgcom.sh command: cd ~/fgfs sh run_fgcom.sh Launching Terrasync Your FlightGear compilation comes with the Terrasync program too, so if you want to use it: cd ~/fgfs sh run_terrasync.sh -S -p 5500 -d /folder/with/sceneries Where: /folder/with/sceneries is the folder containing the sceneries data. Then launch fgfs with the --fg-scenery=/folder/with/sceneries --atlas=socket,out,5,localhost,5500,udp option Troubleshooting Compilation errors Here we are, no fear, if you wish to use programs from the cvs/svn/git repositories, you might face compilation errors that will prevent you to have a working copy of one or more of the programs provided by this script. What can be the causes that prevent us from successfully compiling? As far as I know those: Software developers introduce a new functionality with a new piece of code that prevents the compilation under your architecture, this can happen working with cvs/svn/git sources. The program refuses to compile because of a divergence in the libraries on which it depends. For example FlightGear might not compile because OSG has been modified, while OSG itself compiles fine, FG won't. One or more repositories are down and you can't get the library you need. (Both from cvs/svn/git or apt-get) There is a simple solution to the above errors: wait and relaunch the script after some time (hours or days), if software developers repair or synchronize their code with the newly updated libraries (which generally happens eventually), your FlightGear will compile fine as if the previous error never took place. Sometimes it happens that the script fails to compile only fgrun, fgcom or atlas, if you then see the run_fgfs.sh file it means that FlightGear installation was successful and you can safely run it. Options The script by default (without any option) will only compile FlightGear and Fgrun. To make it compile all, you need to launch the script with the ALL parameter. i.e.: ./download_and_compile.sh ALL Compiling only one program If you wish to recompile only one of the programs you can launch the script with one of the following parameters: PLIB (to compile and install only plib) OSG (to compile and install only OpenSceneGraph) SIMGEAR (to compile and install only Simgear) FGFS (to compile and install only FlightGear) DATA (to download / update only data files for FlightGear) FGRUN (to compile and install only Fgrun) TERRAGEAR (to compile and install only terragear!) TERRAGEARGUI (to compile and install only terrageargui!) OPENRADAR (to compile and install only OpenRadar!) FGO (to compile and install only Fgo!) Fast updating There is a second parameter UPDATE that allows you to just update your installation. i.e.: This will only update FGFS ./download_and_compile.sh FGFS UPDATE Compiling last stable versions (Experimental) Even if the script fetches data and sources from bleeding edge developers repositories (which sometimes do not compile), you can still force the script to download latest known versions of the software that were compiling successfully by adding the -s option. ./download_and_compile.sh -s How does it work? Inside the script there is a small list with latest known versions of successfully compiling revisions, it will download from svn/git those specific revisions, which have been found able to compile together. Warning: If you run this option inside a folder where you previously compiled fgfs, it will probably fail to compile, you better run the script with this option inside an empty folder or a folder whith the same fgfs version compiled previously. Advanced options Skip download of packages using -p n option Skip compilation of programs using -c n option Skip retrieving software updates using -d n option Skip reconfigure (make clean) using -r n option For example, if you are a developer and wish to quickly recompile and reinstall only your own modifications for FlightGear do this: ./download_and_compile.sh -p n -d n -r n FGFS this will only recompile modifications and reinstall them. Multicore Acceleration Using the option -j x (where x is the number of your CPU-Cores you wish to assign to the job) will speed up the whole compilation process considerably. Disk usage Having both compiled program, source code, and data from git requires some hard disk space: It will take something like 13 GB of space. If you don't have a fast machine, it will require several hours of compilation time. Optimus technology If your computer has a GPU with optimus technology, you need a dedicated script in order to make FG running with the powerful GPU. After having installed required tools (Bumblebee) you just need to run this command line in your FG installation directory (where you executed ./download_and_compile.sh) : sed 's|\./fgfs|optirun ./fgfs|' run_fgfs.sh > run_fgfs_optirun.sh && chmod +x run_fgfs_optirun.sh Now you can run FG with ./run_fgfs_optirun.sh Remove warning message for DDS files You can remove the warning message displayed when DDS files are parsed by SimGear by adding the following line just after cd "simgear" line : sed -i s/SG_ALERT,\ \"Image/SG_WARN,\ \"Image/g simgear/scene/model/ModelRegistry.cxx wget -O download_and_compile.sh https://www.gitorious.org/fg/fgmeta/raw/next:download_and_compile.sh The conversion will: move or remove source directories for compatibility remove the build directory remove the install directory except for fgdata Cut to the Chase: for the impatient cd wget download_and_compile.sh https://www.gitorious.org/fg/fgmeta/raw/next:download_and_compile.sh chmod +x download_and_compile.sh mkdir -p stable mkdir -p next cd stable ../download_and_compile.sh -s cd ../next ../download_and_compile.sh -p n Disk Space Requirements As of 02/2013, this script will by at least require 24-30 gb of disk space, note that this includes the downloaded source trees and the build files, but also the fgdata checkout (which accounts approx. for 50% of the whole thing). List of compiled programs The script is able to download and compile: FlightGear (And all the data needed to use it) Fgrun FGo! FGX Terragear TerraGear_GUI OpenRadar OpenRTI Note that openRTI is just another optional dependency for HLA support: http://wiki.flightgear.org/FlightGear_HLA_support_(High_Level_Architecture) For the time being, you should be just fine building without HLA support. Eventually, the idea is for HLA to replace the existing MP system and even increasingly distribute the FlightGear architecture such that more and more components can be more easily run in separate threads or even separate processes, possibly even on different machines. So this is going to be an important feature for professional users, using several computers and screens to create a comprehensive and immersive simulation environment. At the moment, it's probably safe to say that HLA is only of interest to developers and people willing to play with experimental features. When building Next you may see build errors Keeping in mind that this script compiles bleeding edge software versions, using latest debian derivered distros, it can happen that the program that was successfully compiling last week, today does not. Building the stable version should always work unless there is a problem with the script Download You can download the script here: Primary site: download_and_compile.sh Mirror: download_and_compile.sh (not recently updated) The script is maintained in the FlightGear main repository. Remember to update this script whenever a new FlightGear version is released, so that you'll be able to download the latest stable revision. There is also another option for building FlightGear and all its dependencies in an automated fashion, please refer to: http://geoffmclane.com/fg/fgfs-052.htm Known Pitfalls FlightGear versions <= 3.0 are known to have a cmake build system issue related to NOT automatically reconfiguring the SG/FG sources after updating the version files in in $SG_SRC and $FG_SRC, which basically means that using "git pull" to update your source trees (via the d&c script) will create the latest binaries, but they may not be looking for the right base package data, because the source trees are still using the old version files found in the cmake cache. This has been encountered by various contributors, including at least one core developer. To work around this issue, simply switch to your SG/FG build directories and reconfigure each tree by running "cmake ." - for further info, see [1][2]. This should probably be removed. Stable is 3.0. Instructions To run download_and_compile.sh, just save it in a directory called for example: ~/fgfs then execute it (no need to execute it as root). Here is for example a sequence of commands to get the script from the master branch. You can replace master with next to get a later version of the script if one is available: mkdir ~/fgfs cd ~/fgfs wget http://www.gitorious.org/fg/fgmeta/raw/download_and_compile.sh chmod 755 download_and_compile.sh You have two options now: build the latest stable FlightGear release or build the current development version (bleeding edge). After building stable or the latest, if you need to build a different version, try the instructions for Avoiding Multiple Downloads of fgdata. Build the latest stable FlightGear release When executing the script, use the "-s" option to build the latest stable release: ./download_and_compile.sh -s Build the current FlightGear development version When executing the script without any options, the latest development version is built. Warning: The development version of Flightgear changes on an almost daily basis. It provides the latest features, but is not always guaranteed to work reliably. If you're unfamiliar with software testing, you may prefer to use the latest stable release. ./download_and_compile.sh Once the script is finished, you will successfully get Flightgear and Fgrun installed in the ~/fgfs directory. Launching FlightGear When using brisa's script, the two FG dependencies/libs are usually not installed system-wide, but in a custom location (that makes it possible, to easily use different OSG/SG/FG versions on a single system, i.e. for testing purposes - but also to have separate build trees (optimized/debug) ) - which is why you either need to set LD_LIBRARY_PATH or simply use Brisa's script to run everything (something like run_fgfs.sh, which automatically sets up all environment variables according to your build settings). To run your new git installation of FlightGear you have to launch the run_fgfs.sh command under the same folder, for example: cd ~/fgfs sh run_fgfs.sh Launching Fgrun Fgrun-page2.jpg For many users it's more comfortable having FlightGear launched by the graphical utility Fgrun which is installed as well in the same folder. You have to launch the run_fgrun.sh command, for example: cd ~/fgfs sh run_fgrun.sh fgrun will save its settings in ~/.fltk/flightgear.org/fgrun.prefs you may want to save copies of the preferences customized for stable and next. Launching Fgo! Fgo01.jpg This is a graphical utility written in python, You have to launch the run_fgo.sh command, for example: cd ~/fgfs sh run_fgo.sh Remember that the first time you run it, you have to go to preferences and set the binary and fgdata path (Do no set the working directory, you don't need it). Additional programs If you wish to get all the other programs, you need to launch the script adding the "ALL" option to the command line: ./download_and_compile.sh ALL This, will also install FGCOM, FGComGui and Atlas Launching FGCOM FGCOM is the system used by FlightGear to simulate radio communications between users. Launch it using the run_fgcom.sh command: cd ~/fgfs sh run_fgcom.sh Launching Terrasync Your FlightGear compilation comes with the Terrasync program too, so if you want to use it: cd ~/fgfs sh run_terrasync.sh -S -p 5500 -d /folder/with/sceneries Where: /folder/with/sceneries is the folder containing the sceneries data. Then launch fgfs with the --fg-scenery=/folder/with/sceneries --atlas=socket,out,5,localhost,5500,udp option Troubleshooting Compilation errors Here we are, no fear, if you wish to use programs from the cvs/svn/git repositories, you might face compilation errors that will prevent you to have a working copy of one or more of the programs provided by this script. What can be the causes that prevent us from successfully compiling? As far as I know those: Software developers introduce a new functionality with a new piece of code that prevents the compilation under your architecture, this can happen working with cvs/svn/git sources. The program refuses to compile because of a divergence in the libraries on which it depends. For example FlightGear might not compile because OSG has been modified, while OSG itself compiles fine, FG won't. One or more repositories are down and you can't get the library you need. (Both from cvs/svn/git or apt-get) There is a simple solution to the above errors: wait and relaunch the script after some time (hours or days), if software developers repair or synchronize their code with the newly updated libraries (which generally happens eventually), your FlightGear will compile fine as if the previous error never took place. Sometimes it happens that the script fails to compile only fgrun, fgcom or atlas, if you then see the run_fgfs.sh file it means that FlightGear installation was successful and you can safely run it. Options The script by default (without any option) will only compile FlightGear and Fgrun. To make it compile all, you need to launch the script with the ALL parameter. i.e.: ./download_and_compile.sh ALL Compiling only one program If you wish to recompile only one of the programs you can launch the script with one of the following parameters: PLIB (to compile and install only plib) OSG (to compile and install only OpenSceneGraph) SIMGEAR (to compile and install only Simgear) FGFS (to compile and install only FlightGear) DATA (to download / update only data files for FlightGear) FGRUN (to compile and install only Fgrun) TERRAGEAR (to compile and install only terragear!) TERRAGEARGUI (to compile and install only terrageargui!) OPENRADAR (to compile and install only OpenRadar!) FGO (to compile and install only Fgo!) Fast updating There is a second parameter UPDATE that allows you to just update your installation. i.e.: This will only update FGFS ./download_and_compile.sh FGFS UPDATE Compiling last stable versions (Experimental) Even if the script fetches data and sources from bleeding edge developers repositories (which sometimes do not compile), you can still force the script to download latest known versions of the software that were compiling successfully by adding the -s option. ./download_and_compile.sh -s How does it work? Inside the script there is a small list with latest known versions of successfully compiling revisions, it will download from svn/git those specific revisions, which have been found able to compile together. Warning: If you run this option inside a folder where you previously compiled fgfs, it will probably fail to compile, you better run the script with this option inside an empty folder or a folder whith the same fgfs version compiled previously. Advanced options Skip download of packages using -p n option Skip compilation of programs using -c n option Skip retrieving software updates using -d n option Skip reconfigure (make clean) using -r n option For example, if you are a developer and wish to quickly recompile and reinstall only your own modifications for FlightGear do this: ./download_and_compile.sh -p n -d n -r n FGFS this will only recompile modifications and reinstall them. Multicore Acceleration Using the option -j x (where x is the number of your CPU-Cores you wish to assign to the job) will speed up the whole compilation process considerably. Disk usage Having both compiled program, source code, and data from git requires some hard disk space: It will take something like 13 GB of space. If you don't have a fast machine, it will require several hours of compilation time. Optimus technology If your computer has a GPU with optimus technology, you need a dedicated script in order to make FG running with the powerful GPU. After having installed required tools (Bumblebee) you just need to run this command line in your FG installation directory (where you executed ./download_and_compile.sh) : sed 's|\./fgfs|optirun ./fgfs|' run_fgfs.sh > run_fgfs_optirun.sh && chmod +x run_fgfs_optirun.sh Now you can run FG with ./run_fgfs_optirun.sh Remove warning message for DDS files You can remove the warning message displayed when DDS files are parsed by SimGear by adding the following line just after cd "simgear" line : sed -i s/SG_ALERT,\ \"Image/SG_WARN,\ \"Image/g simgear/scene/model/ModelRegistry.cxx