Difference between revisions of "Ubuntu"

From FlightGear wiki
Jump to: navigation, search
m (set article to {{stub}})
(remove old osg first)
 
(8 intermediate revisions by 5 users not shown)
Line 2: Line 2:
  
  
==== APT-GET List ====
+
Following steps walk through downloading the FlightGear source code, compile and run on Ubuntu 13.04 (x86_64)  
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.
+
  
git - to get SG and FG<br />
+
== Required Packages ==
subversion - to get OSG<br />
+
 
build-essential - to build (includes GCC, and other build tools)<br />
+
Install the following packages and libraries to be able to compile FlightGear:
cmake - OSG Uses this<br />
+
cmake-curses-gui -- 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 />
+
libglut3-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>
 
<pre>
sudo apt-get install git subversion build-essential cmake cmake-curses-gui libpng-dev libfreetype6-dev
+
sudo apt-get remove libopenscenegraph-dev libopenscenegraph100v5 # osg in apt is too old
libjpeg-dev libungif4-dev libtiff-dev libxmu-dev libxi-dev libglut3-dev libalut-dev
+
sudo add-apt-repository ppa:openmw/openmw
libboost-dev automake autoconf libfltk1.1-dev
+
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
 
</pre>
 
</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.
+
== Download source ==
-----------
+
  
 +
Create a fgsrc directory and get the source code with git:
 +
<pre>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
 +
</pre>
  
NOTE: On a '''Linux Mint 9''' (Ubuntu 10.04) system this is the command I used:
+
== Compile ==
<pre>
+
 
sudo apt-get install git-core subversion build-essential cmake cmake-curses-gui libpng-dev libfreetype6-dev libjpeg-dev libungif4-dev
+
Create directory to install FlightGear in and create environment variable:  
libtiff-dev libxmu-dev libxi-dev libglut3-dev libalut-dev libboost-dev ''automake autoconf'' libfltk1.1-dev libplib-dev libopenscenegraph-dev
+
<pre>export prefix=$HOME/FG-install && mkdir $prefix</pre>
 +
 
 +
Create a build directory for each package and run cmake from there:
 +
 
 +
SimGear:  
 +
<pre>cd ~/fgsrc
 +
mkdir build-sg
 +
cd build-sg
 +
cmake -D CMAKE_INSTALL_PREFIX:PATH="$prefix" ~/fgsrc/simgear
 +
make -j2 install
 
</pre>
 
</pre>
You just need to copy that long line into a terminal and you should have all the packages you need to compile Flightgear and Simgear.
 
  
 +
FlightGear:
 +
<pre>cd ~/fgsrc
 +
mkdir build-fg
 +
cd build-fg
 +
cmake -D CMAKE_INSTALL_PREFIX:PATH="$prefix" ~/fgsrc/flightgear
 +
make -j2 install
 +
</pre>
 +
 +
== Run ==
 +
 +
Link fgdata to the data directory in FG-install
 +
<pre>cd $prefix
 +
ln -s ~/fgsrc/fgdata data</pre>
 +
 +
Run executable:
 +
<pre>$prefix/bin/fgfs --fg-root=$prefix/data</pre>
 +
 +
== Troubleshooting ==
 +
 +
; Link error undefined reference to symbol 'dlopen@@GLIBC_2.2.5
 +
: Uninstall fltk 1.3 library <pre>sudo apt-get remove libfltk1.3-dev</pre> See the [http://forum.flightgear.org/viewtopic.php?f=45&t=20164 forum]
  
==== Troubleshooting ====
 
 
; 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>

Latest revision as of 19:00, 15 November 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 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