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

Difference between revisions of "Building FlightGear - Linux"

From FlightGear wiki
Jump to: navigation, search
(Added ref to main subject page)
(Requirements)
 
(49 intermediate revisions by 25 users not shown)
Line 1: Line 1:
 
{{Main article|Building Flightgear}}  
 
{{Main article|Building Flightgear}}  
  
__TOC__
+
{{WIP}}
  
This section describes how to build FlightGear on Linux system.
+
This section describes how to build [[FlightGear]] on Linux system.
  
 
Compiling FlightGear is not a task for novice users. Thus, if you're a beginner (we all were once) on a platform which binaries are available for, we recommend postponing this task and just starting with the binary distribution to get you flying.
 
Compiling FlightGear is not a task for novice users. Thus, if you're a beginner (we all were once) on a platform which binaries are available for, we recommend postponing this task and just starting with the binary distribution to get you flying.
 +
 +
openSUSE also provides binary packages of the latest development version, which are continuously updated.
 +
Follow [http://software.opensuse.org/download.html?lang=en&project=games:FlightGear:Unstable&package=fgrun this link] to select your openSUSE version and install, or manually add ''games:FlightGear:Unstable'' to your ''YaST Software Repositories''.
 +
 +
For Ubuntu, there is a PPA that provides the latest development version of FlightGear and SimGear and a recent version of FlightGear data. See [https://launchpad.net/~saiarcot895/+archive/flightgear-edge this page] for more info. To add the PPA, run <tt>sudo apt-add-repository ppa:saiarcot895/flightgear-edge</tt>.
  
 
Or if you develop on Ubuntu or Debian, consider trying the script described in [[Scripted Compilation on Linux Debian/Ubuntu]].
 
Or if you develop on Ubuntu or Debian, consider trying the script described in [[Scripted Compilation on Linux Debian/Ubuntu]].
 +
 +
== Distro-specific instructions ==
 +
=== Debian/Ubuntu ===
 +
* You can use the [[Scripted Compilation on Linux Debian/Ubuntu]] script to have Flightgear compiled in one shot under both Ubuntu and Debian systems.
 +
* Debian users who prefer to build it without script may look at [[Building Flightgear - Debian]].
 +
* Hints for [[Ubuntu]] users.
 +
 +
=== Gentoo ===
 +
* Gentoo users can also use overlays to build FlightGear without much hassle: [[Building Flightgear - Gentoo]].
  
 
== Requirements ==
 
== Requirements ==
 +
{{Note|as of 12/2017, people may have to build using at least OSG 3.4 due to some compilation issues -for details, refer to [[Howto:Building FlightGear without HiDPI support]]}}
 +
Edit 12/9/15 - These instructions are out of date! Do not use for compiling.
 +
 
Before you can compile FlightGear, you need to have the following installed on your computer:
 
Before you can compile FlightGear, you need to have the following installed on your computer:
  
 
'''C++ compiler'''
 
'''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.
+
These are: c++, cpp, gcc, g++ found under the <code>/usr/bin</code> directory.  You will also need to have the tools '''autoconf''' and '''automake1.9''' installed.
  
'''CVS'''
+
'''GIT'''
  
Yes, the program is called 'CVS'.  This is used for downloading the latest set of source code. Windows developers may wish to see [[Using TortoiseCVS with FlightGear]].
+
See [[FlightGear and Git]].
  
 
'''[[OpenGL]] support'''
 
'''[[OpenGL]] support'''
Line 24: Line 41:
 
More specifically, your system needs the support for hardware accelerated graphics.  You can check for this by running the following in a [[command line]]:
 
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
+
<syntaxhighlight lang="bash">
 +
$ glxinfo | grep direct
 +
</syntaxhighlight>
  
 
Note: To run the above command, you need to have the tool '''mesa-utils''' installed.
 
Note: To run the above command, you need to have the tool '''mesa-utils''' installed.
Line 38: Line 57:
 
  direct rendering: No
 
  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.
+
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 ==
 
== 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'''.
+
 
 +
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 <tt>plib1.8.5</tt> is <tt>plib1.8.5</tt>'''-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.
 
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
+
* <tt>FlightGear</tt>
** [http://openal.org OpenAL and ALUT]
+
** [http://kcat.strangesoft.net/openal.html <tt>OpenAL</tt>]
** SimGear
+
** <tt>SimGear</tt>
*** [http://plib.sourceforge.net/ PLIB]. Since march 2008, you will need version 1.8.5 - your distro probably supplies 1.8.4 still.
+
*** [http://plib.sourceforge.net/ <tt>PLIB</tt>]. 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, [http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg16153.html however since march 2008, FreeGLUT as well as SDL are both considered depreciated, please only use --enable-osgviewer during configuration instead])  
+
**** For versions pre March 2008: (Free)<tt>GLUT</tt> or <tt>SDL</tt> (We recommend the use of <tt>SDL</tt> over <tt>Free/GLUT</tt>, [http://www.mail-archive.com/flightgear-devel@lists.sourceforge.net/msg16153.html however since March 2008, <tt>FreeGLUT</tt> as well as <tt>SDL</tt> are both considered deprecated], please only use <code>--enable-osgviewer</code> during configuration instead)  
*** [[ OpenSceneGraph ]] (svn trunk for FlightGear/CVS and the latest preceding OSG release for a FlightGear release)
+
*** <tt>[[OpenSceneGraph]]</tt>  (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(?)):
 
*** 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
+
**** <tt>libfreetype6-dev</tt>
**** libjpeg62-dev
+
**** <tt>libjpeg62-dev</tt>
**** libungif4-dev
+
**** <tt>libungif4-dev</tt>
**** libtiff4-dev
+
**** <tt>libtiff4-dev</tt>
**** libpng12-dev
+
**** <tt>libpng12-dev</tt>
**** libxmu-dev
+
**** <tt>libxmu-dev</tt>
**** libxi-dev
+
**** <tt>libxi-dev</tt>
**** zlib1g-dev
+
**** <tt>zlib1g-dev</tt>
**** libglut3-dev
+
**** <tt>libglut3-dev</tt>
  
 
If you attack the above dependencies in the order listed below, you should be good:
 
If you attack the above dependencies in the order listed below, you should be good:
  
1. 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.
+
# <tt>glut</tt> Most distributions include glut packages, although you may have to hunt for them. Make sure you install both the <tt>glut</tt> and <tt>glut-devel</tt> packages, otherwise FlightGear may be able to compile but won't run correctly.
 
+
# <tt>zlib</tt> Most distributions install the basic <tt>zlib</tt> libraries by default, but not the development portions. If you don't have <tt>zlib.h</tt>, you probably need to install the <tt>zlib-devel</tt> package for your distribution.  
2. 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.  
+
# <tt>plib</tt> Portability libraries and scene graph.  
 
+
# <tt>[[OpenSceneGraph]]</tt>
3. Plib - portability libraries and scene graph.  
+
# <tt>simgear</tt> 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.
 
+
4. [[ OpenSceneGraph ]]
+
 
+
5. SimGear - Simulation support libraries. If you are building FlightGear from CVS, you need the CVS 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.
+
 
+
==== APT-GET List ====
+
This is a list of all the apt-get commands I had to do while compiling FG, SG, and OSG on a mostly clean Ubuntu 64 system. It is a list of all the libraries you and your computer needs to compile FG, SG, OSG, and PLib. All you have to do is copy the full command, paste it in Terminal, enter your password, and it will download all the packages for you, and install them too. The full command is at the bottom, and I hope someone finds it useful :) sub-dependencies (dependencies of the dependencies) are not included as they are installed automatically by apt-get. If anyone sees something missing, please add it.
+
+
cvs - to get SG and FG <br>
+
subversion - to get OSG <br>
+
build-essential - to build (includes GCC, and other build tools) <br>
+
cmake - OSG Uses this <br>
+
libpng-dev - to enable FG to use PNG textures<br>
+
libfreetype6-dev - fonts<br>
+
libjpeg-dev<br>
+
libungif4-dev<br>
+
libtiff-dev<br>
+
libxmu-dev<br>
+
libxi-dev<br>
+
libalut-dev - sound<br>
+
libboost-dev - makes coding for some developers easier<br>
+
automake - needed by ./autogen.sh files<br>
+
autoconf - needed by ./autogen.sh files<br>
+
libfltk1.1-dev - You will need this if you will be using FGRun<br>
+
-----------
+
<pre>
+
sudo apt-get install cvs subversion build-essential cmake libpng-dev libfreetype6-dev libjpeg-dev libungif4-dev libtiff-dev libxmu-dev libxi-dev
+
libalut-dev libboost-dev automake autoconf libfltk1.1-dev
+
</pre>
+
-----------
+
Total size is about 230 MB, depending on what you already have from other applications.
+
 
+
This list might seem a bit short, but the sub-dependencies all add up :) The dependencies will be listed by apt-get when you use the command.
+
  
 
== Compiling ==
 
== Compiling ==
 
Assuming you are root, do:
 
Assuming you are root, do:
cd /usr/local/src
 
  
<b>Note:</b> When tracking a fast changing software like FlightGear/CVS 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.
+
<syntaxhighlight lang="bash">
 +
# cd /usr/local/src
 +
</syntaxhighlight>
 +
 
 +
'''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 <tt>--prefix</tt> argument to configure. E.g. <tt>./configure --prefix=$HOME/FlightGear</tt>. I would recommend installing all of OSG, plib, SimGear and FlightGear with the same prefix.
 
To install in a directory of your choice add the <tt>--prefix</tt> argument to configure. E.g. <tt>./configure --prefix=$HOME/FlightGear</tt>. I would recommend installing all of OSG, plib, SimGear and FlightGear with the same prefix.
  
Line 114: Line 104:
 
'''Step 1:'''
 
'''Step 1:'''
  
Login to the cvs server and checkout the latest version of SimGear's source code with:
+
Clone the SimGear git repository and set it up to track the 'next' branch.
cvs -d :pserver:cvsguest@cvs.simgear.org:/var/cvs/SimGear-0.3 login
+
CVS passwd: guest
+
+
cvs -d :pserver:cvsguest@cvs.simgear.org:/var/cvs/SimGear-0.3 co source
+
  
'''Step 2:'''
+
<syntaxhighlight lang="bash">
 +
$ git clone git://git.code.sf.net/p/flightgear/simgear simgear
 +
</syntaxhighlight>
  
Since all the source code will be downloaded into a directory called '''source''', you will need to rename the directory into something more meaningful.
+
or if the git port is firewalled on you network, use the http transport
  
Rename the above directory by doing:
+
<syntaxhighlight lang="bash">
mv source simgear
+
$ git clone http://git.code.sf.net/p/flightgear/simgear simgear
 +
</syntaxhighlight>
 +
 
 +
By default after cloning you should have a local next branch that tracks the master next branch. It can be updated it with <code>git pull</code>.
 +
 
 +
'''Step 2:'''
 +
 
 +
The source code will be downloaded into a directory called '''simgear'''.
  
 
Next, go into the directory and make preparations for the compilation:
 
Next, go into the directory and make preparations for the compilation:
cd simgear
 
./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
+
<syntaxhighlight lang="bash">
 +
$ cd simgear
 +
$ cmake .
 +
</syntaxhighlight>
 +
 +
'''Note''' that if you don't want to install <tt>simgear</tt> globally on the system but in a specific directory, you can do so by adding <code>-DCMAKE_INSTALL_PREFIX=/path/to/your/fgInstallation</code> to the <code>cmake</code> command
  
 
'''Step 3:'''
 
'''Step 3:'''
  
 
Compile and install SimGear by doing:
 
Compile and install SimGear by doing:
make; make install.
 
  
 +
<syntaxhighlight lang="bash">
 +
$ make; make install
 +
</syntaxhighlight>
  
''Note:'' with gcc 4.2 or later,on some platforms, you can get compiling errors about alc.h like:  
+
''Note:'' with <tt>gcc</tt> 4.2 or later,on some platforms, you can get compiling errors about <tt>alc.h</tt> like:  
  
 
  '<anonymous>' has incomplete type  
 
  '<anonymous>' has incomplete type  
Line 149: Line 148:
 
'''Step 1:'''
 
'''Step 1:'''
  
To login to the cvs version and checkout the latest version of Flightgear's source code, use:
+
Clone the FlightGear git repository and set it up to track the 'next' branch.
cvs -d :pserver:cvsguest@cvs.flightgear.org:/var/cvs/FlightGear-0.9 login
+
CVS passwd: guest
+
+
cvs -d :pserver:cvsguest@cvs.flightgear.org:/var/cvs/FlightGear-0.9 co source
+
  
A directory with the name '''source''' will then be created with all of Flightgear's source code downloaded into it.
+
<syntaxhighlight lang="bash">
 +
$ git clone git://git.code.sf.net/p/flightgear/flightgear
 +
</syntaxhighlight>
 +
 
 +
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:'''
 
'''Step 2:'''
 
To rename the above directory, use the following command:
 
mv source flightgear
 
  
 
Next, go into the folder and make preparations for the compilation:
 
Next, go into the folder and make preparations for the compilation:
cd flightgear
+
 
./autogen.sh
+
<syntaxhighlight lang="bash">
./configure
+
$ cd flightgear
 +
$ ./autogen.sh
 +
$ ./configure
 +
</syntaxhighlight>
  
 
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.
 
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 are building the OSG-version of FlightGear and didn't install OSG globally, you have to pass the OSG directory to the configure-command like this:
+
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
+
 
 +
<syntaxhighlight lang="bash">
 +
$ ./configure --prefix=/path/to/fgInstallation --with-osg=/path/to/osg/installation --enable-osgviewer
 +
</syntaxhighlight>
 +
 
 
In this case you have to tell your system where to find the OSG libraries before you can run flightgear:
 
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
+
 
 +
<syntaxhighlight lang="bash">
 +
$ export LD_LIBRARY_PATH=/path/to/osgInstallation/lib:$LD_LIBRARY_PATH
 +
</syntaxhighlight>
  
 
'''Step 3:'''
 
'''Step 3:'''
  
 
Now you can compile and install Flightgear by:
 
Now you can compile and install Flightgear by:
make; make install
+
 
 +
<syntaxhighlight lang="bash">
 +
$ make; make install
 +
</syntaxhighlight>
  
 
'''Step 4:'''
 
'''Step 4:'''
  
Get the data directory:
+
Clone the data directory:
cvs -d :pserver:cvsguest@cvs.flightgear.org:/var/cvs/FlightGear-0.9 co data
+
  
And install it in (or as) /usr/local/share/FlightGear
+
<syntaxhighlight lang="bash">
mv data /usr/local/share/FlightGear
+
$ git clone git://git.code.sf.net/p/flightgear/fgdata
 +
</syntaxhighlight>
  
== Ubuntu and Debian users ==
+
The data directory is large (almost 2.5GB) so it will take considerable time to download.
If you wish you can use the [[Scripted_Compilation_on_Linux_Debian/Ubuntu]] script to have Flightgear compiled in one shot under both Ubuntu and Debian systems.
+
There mirror of fgdata that might be faster to download from:
  
Debian users who prefer to build it without script may look at  [[Building_Flightgear_-_Debian]].
+
<syntaxhighlight lang="bash">
 +
$ git clone git://mapserver.flightgear.org/fgdata
 +
</syntaxhighlight>
 +
 
 +
The mirror is synchronized with the master so either will do.
 +
 
 +
And install it in (or as) /usr/local/share/FlightGear
 +
 
 +
<syntaxhighlight lang="bash">
 +
$ mv fgdata /usr/local/share/flightgear
 +
</syntaxhighlight>
  
 
== External links ==
 
== External links ==
 
=== Instructions ===
 
=== Instructions ===
* [[ MSYS ]]
+
* [[MSYS]]  
* [[ MinGW/cross-compiler ]]
+
* [[MinGW/cross-compiler]]  
* [[ CodeBlocks IDE ]]
+
* [[CodeBlocks IDE]]  
* [[ OpenSUSE 10.1 10.2 ]]
+
* [[OpenSUSE 10.1 10.2]]  
 
* [http://www.geoffmclane.com/fg/fgmsvc7.htm MSVC7 *.Net]
 
* [http://www.geoffmclane.com/fg/fgmsvc7.htm MSVC7 *.Net]
 
* [http://www.oflebbe.de/oflebbe/FlightGear/index.html MSVC8 aka Visual 2005]
 
* [http://www.oflebbe.de/oflebbe/FlightGear/index.html MSVC8 aka Visual 2005]
* [http://macflightgear.sourceforge.net/home/documents/ Mac OS X (0.9.10 and CVS)]
+
* [http://macflightgear.sourceforge.net/home/documents/ Mac OS X]
 +
== Important note for GIT users ==
 +
As of latest development in GIT, only cmake is now required for building both SimGear and FlightGear. So if you build GIT (for what any reason) please don't try to use autogen.sh as it is removed from repository.
 +
 
 +
For detailed instructions, see page [[Building_using_CMake|Building using cmake]].
  
 
{{Building}}
 
{{Building}}
 +
 +
[[fr:Compiler FlightGear sous GNU/Linux]]

Latest revision as of 07:14, 31 December 2017

1rightarrow.png See Building Flightgear for the main article about this subject.

WIP.png Work in progress
This article or section will be worked on in the upcoming hours or days.
See history for the latest developments.

This section describes how to build FlightGear on Linux system.

Compiling FlightGear is not a task for novice users. Thus, if you're a beginner (we all were once) on a platform which binaries are available for, we recommend postponing this task and just starting with the binary distribution to get you flying.

openSUSE also provides binary packages of the latest development version, which are continuously updated. Follow this link to select your openSUSE version and install, or manually add games:FlightGear:Unstable to your YaST Software Repositories.

For Ubuntu, there is a PPA that provides the latest development version of FlightGear and SimGear and a recent version of FlightGear data. See this page for more info. To add the PPA, run sudo apt-add-repository ppa:saiarcot895/flightgear-edge.

Or if you develop on Ubuntu or Debian, consider trying the script described in Scripted Compilation on Linux Debian/Ubuntu.

Distro-specific instructions

Debian/Ubuntu

Gentoo

Requirements

Note  as of 12/2017, people may have to build using at least OSG 3.4 due to some compilation issues -for details, refer to Howto:Building FlightGear without HiDPI support

Edit 12/9/15 - These instructions are out of date! Do not use for compiling.

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.
      • 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:

  1. 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.
  2. 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.
  3. plib Portability libraries and scene graph.
  4. OpenSceneGraph
  5. 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://git.code.sf.net/p/flightgear/simgear simgear

or if the git port is firewalled on you network, use the http transport

$ git clone http://git.code.sf.net/p/flightgear/simgear simgear

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:

'<anonymous>' 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://git.code.sf.net/p/flightgear/flightgear

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://git.code.sf.net/p/flightgear/fgdata

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

External links

Instructions

Important note for GIT users

As of latest development in GIT, only cmake is now required for building both SimGear and FlightGear. So if you build GIT (for what any reason) please don't try to use autogen.sh as it is removed from repository.

For detailed instructions, see page Building using cmake.