Ubuntu

From FlightGear wiki
Jump to navigation Jump to search
This article is a stub. You can help the wiki by expanding it.


Following steps walk through downloading the FlightGear source code, compile and run on Ubuntu 13.04 (x86_64)

Required Packages

Install the following packages and libraries to be able to compile FlightGear:

sudo apt-get remove libopenscenegraph-dev libopenscenegraph100v5 # osg in apt is too old
sudo add-apt-repository ppa:openmw/openmw
sudo apt update
sudo apt install openscenegraph-3.4 libopenscenegraph-3.4-dev

sudo apt-get install git subversion build-essential cmake cmake-curses-gui libpng12-dev libfreetype6-dev libjpeg-dev libgif-dev libtiff5-dev libxmu-dev libxi-dev freeglut3-dev libalut-dev libxft-dev libxinerama-dev libboost-dev libplib-dev libopenscenegraph-dev libsvn-dev libudev-dev libfontconfig1-dev glew-utils libglew-dev qtbase5-private-dev qtdeclarative5-private-dev libcurl3-dev

Download source

Create a fgsrc directory and get the source code with git:

mkdir ~/fgsrc 
cd ~/fgsrc
git clone git://git.code.sf.net/p/flightgear/simgear simgear
git clone git://git.code.sf.net/p/flightgear/flightgear
git clone git://git.code.sf.net/p/flightgear/fgdata

Compile

Create directory to install FlightGear in and create environment variable:

export prefix=$HOME/FG-install && mkdir $prefix

Create a build directory for each package and run cmake from there:

SimGear:

cd ~/fgsrc
mkdir build-sg
cd build-sg 
cmake -D CMAKE_INSTALL_PREFIX:PATH="$prefix" ~/fgsrc/simgear 
make -j2 install

FlightGear:

cd ~/fgsrc
mkdir build-fg
cd build-fg 
cmake -D CMAKE_INSTALL_PREFIX:PATH="$prefix" ~/fgsrc/flightgear 
make -j2 install

Run

Link fgdata to the data directory in FG-install

cd $prefix
ln -s ~/fgsrc/fgdata data

Run executable:

$prefix/bin/fgfs --fg-root=$prefix/data

Troubleshooting

Link error undefined reference to symbol 'dlopen@@GLIBC_2.2.5
Uninstall fltk 1.3 library
sudo apt-get remove libfltk1.3-dev
See the forum
Only-a-black-screen problem
If you are a nvidia user and only get a black screen at startup, you might suffer from Ubuntu bug 982485. Have a look at comment #24 for a possible workaround.
Ubuntu 14.04 LTS could not compile simgear (error with codecvt include)
As of 2017-10-29 C++11 is enforced in simgear (commit log). Ubuntu 14.04 shipped with GCC 4.8 could not handle full C++11 compatibility. In order to change GCC to newer version use ubuntu-toolchain PPA repository like:
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-5 g++-5
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5