Ubuntu: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
(Update git download link from gitorious to sf)
(added troubleshooting info for ubuntu 14.04 with latest simgear source (C++11 strict))
Line 62: Line 62:
; Only-a-black-screen problem:
; 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 [https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers/+bug/982485 982485]. Have a look at comment [https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers/+bug/982485/comments/24 #24] for a possible workaround.
: If you are a nvidia user and only get a black screen at startup, you might suffer from Ubuntu bug [https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers/+bug/982485 982485]. Have a look at comment [https://bugs.launchpad.net/ubuntu/+source/nvidia-graphics-drivers/+bug/982485/comments/24 #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 ([https://sourceforge.net/p/flightgear/simgear/ci/2642299d772a3b88264d5fb05086817d0742ced7/ 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:
: <pre>sudo add-apt-repository ppa:ubuntu-toolchain-r/test</pre>
: <pre>sudo apt-get update</pre>
: <pre>sudo apt-get install gcc-5 g++-5</pre>
: <pre>sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5</pre>

Revision as of 16:26, 31 October 2017

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 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

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