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


Jump to: navigation, search

Scripted Compilation on Linux Debian/Ubuntu

334 bytes added, 12:57, 8 November 2016
fix that wiki link again
The following script takes care of downloading and compiling FlightGear from the git repositories with just one command execution for both 32-bit and 64-bit Debian based systems (Debian, Ubuntu). Pre-existing installed version (if any) of FlightGear are not touched at all since the script builds and installs everything under the directory in which it is launched. You can choose between building all or only specific tools and applications. For RedHat-based systems (Fedora, CentOS) you may want to check out [[CentOS]].
Necessary packages are installed via the apt-get system while libraries not included in the repositories are downloaded and compiled on the fly (i.e. [[Plib]], [[Simgear]] and [[OSG]]).
== Known Pitfalls ==FlightGear versions <= 3.0 are known to have For Hints on Using 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_SRCRPM based distribution like CentOS, 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.please see [[CentOS]]
To work around this issue, simply switch to your SG/FG build directories and reconfigure each tree by running "cmake ." - for further info, Please also see [http://flightgear.org/forums/viewtopic.php?f=22&t=20304#p186647][http://flightgear.org/forums/viewtopic.php?f=22&p=187413#p186942Superbuild]].
==Description= Update Available ===The following script takes care of downloading and compiling FlightGear from the git repositories with just one command execution for both 32-bit and 64-bit Debian based systems (Debian, Ubuntu). Pre-existing installed version (if any) of FlightGear are not touched at all since the script builds and installs everything under the directory in which it is launched. You can choose between building all or only specific tools and applications. For redhat-based systems (Fedora, CentOS) you may want to check out [[CentOS]].
Necessary packages are installed via The FlightGear development team has published version 2.34 of the apt-get system while libraries not included in the repositories are downloaded and compiled on the fly (i.e. [[Plib]], [[Simgear]] and [[OSG]])script.
For Hints on Using download the newest script with this command:  wget -O download_and_compile.sh http://sourceforge.net/p/flightgear/fgmeta/ci/next/tree/download_and_compile.sh?format=raw === Cut to the Chase: for the impatient ===  cd <your working directory for building FlightGear> wget -O download_and_compile.sh http://sourceforge.net/p/flightgear/fgmeta/ci/next/tree/download_and_compile.sh?format=raw 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 === Conversion of directory structure from earlier versions of download_and_compile.sh === Earlier versions of the script used a RPM based distribution like CentOSdifferent directory structure. If you used the earlier version, please see [[CentOS]]the new script includes a section that will convert the earlier structure to the current set of directories.
=== Disk Space Requirements ===
As of 02/2013Version 3.4.0 in June 2015, this script will by at least require 242-30 3 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)and FGData.
=== List of compiled programs ===
The script is able to download and compile:
* FlightGear (And all the data needed to use it)
* [[Fgrun]]* [[FGCOM]]cmake (for newer cmake capabilities)* [[FGComGuiFGRun]]
* [[FGo!]]
* [[FGX]]
* [[AtlasTerraGear]]* [[TerrasyncTerraGear_GUI]]* [[OpenRadar]]
* [[FlightGear HLA support (High Level Architecture) | OpenRTI]]
Note that openRTI 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.
you can pass the '''-i''' option to compile OpenRTI, as well as SimGear and FlightGear re-configured with -D ENABLE_RTI=ON option (experimental) <syntaxhighlight lang="bash">./download_and_compile.sh -i</syntaxhighlight> == Updated list of programs compilation status == When building Next you may see build errors ====Keeping in mind that this script compiles bleeding edge software versions, using latest debian derivered distrosDebian derived distributions, it can happen that the program that was successfully compiling last week, today does not.<BR/>This Building the stable version should always work unless there is a list of what does and does not compile as much updated as possible.problem with the script<BR/>Date: 19 November 2012* FlightGear ... OK* [[Fgrun]] ... OK* [[FGCOM]] ... OK* [[FGComGui]] ... OK* [[FGo!]] ... OK* [[FGX]] ... OK* [[Atlas]] ... COMPILATION ERROR* [[Terrasync]] ... OK* [[FlightGear HLA support (High Level Architecture) | OpenRTI]] ... OK
== Download ==
You can download the script here:
* Primary site: [ http://wwwsourceforge.gitorious.orgnet/fgp/flightgear/fgmeta/rawci/download_and_compile.sh download_and_compile.sh]* Mirror: [http:next//assistenza.larasrl.net/brisa/fgfstree/download_and_compile.sh download_and_compile.sh] '''Note''' 28/4-13: A change in address to OpenSceneGraph svn must be done before running the script. Se [http://www.flightgear.org/forums/viewtopic.php?pformat=182239#p182239 Flightgear forum] for more information. raw*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
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:<pre>mkdir ~/fgfscd ~/fgfswget http://www.gitorious.org/fg/fgmeta/blobs/raw/ You can replace master/download_and_compile.shchmod 755 download_and_compile.sh</pre>Depending on the level of maintenance activity on the script, the with next to get a later version in master may be out of date.To get the script from the next branchif one is available:
mkdir ~/fgfs
cd ~/fgfs
wget http://wwwsourceforge.gitorious.orgnet/fgp/flightgear/fgmeta/blobs/rawci/next/tree/download_and_compile.sh?format=raw
chmod 755 download_and_compile.sh
For the daring, you can try out the absolute latest development version of the script. This version usually has been tested to build or rebuild at least one variant of flightgear, probably several. However, it has not been tested by more than one user.
See: [[Talk:Scripted_Compilation on Linux Debian/Ubuntu]] for more information
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 multiple downloads of fgdataFGData on Linux]].
=== Build the latest stable FlightGear release ===
When executing the script, use the "-s" option to build the latest stable release:
=== Build the current FlightGear development version ===
When executing the script without any optionoptions, the latest development version is built.
'''Warning''': The development version of Flightgear 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.
Once the script is finished, you will successfully get Flightgear FlightGear and Fgrun FGRun installed in the ~/fgfs directory.
=== Launching FlightGear ===
When using brisaBrisa's script, the various 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:
=== Launching Fgrun FGRun ===
For many users it's more comfortable having FlightGear launched by the graphical utility Fgrun FGRun which is installed as well in the same folder. You have to launch the ''run_fgrun.sh'' command, for example:
cd ~/fgfs
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 FgoFGo! ===
This is a graphical utility written in [[python]], You have to launch the ''run_fgo.sh'' command, for example:
sh run_fgo.sh
Remember that the first time you run it, you have to go to preferences and set the binary and fgdata FGData path (Do no set the working directory, you don't need it).
== Additional programs ==
cd ~/fgfs
sh run_fgcom.sh -cs
=== Launching FGComGui ===
FgComGui is a GUI wrapper to launch fgcom.
cd ~/fgfs
sh run_fgcomgui.sh
=== Launching Atlas ===
Atlas provides a map for FlightGear, use it launching: ''run_atlas.sh''
cd ~/fgfs
sh run_atlas.sh
=== Launching Terrasync TerraSync ===Your FlightGear compilation comes with the Terrasync [[TerraSync]] program too, so if you want to use it:
cd ~/fgfs
Where: ''/folder/with/sceneries'' is the folder containing the sceneries data.
Then launch fgfs FGFS with the '''--fg-scenery=/folder/with/sceneries --atlas=socket,out,5,localhost,5500,udp''' option
== Troubleshooting ==
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 fgrunFGRun, fgcom 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. === OpenRTI undefined reference errors ===Sometimes due to the way d&c build cleans up projects, linking errors might occur, this is the case with this error "libRTI-NG.so: undefined reference to xxx", sadly at this point either you need to patch the d&c script to clean OpenRTI with rm -f CMakeCache.txt && rm -rf CMakeFiles/, or just start from a clean environment, assuming you are in the parent project directory, you will need to issue this command to clean everything(except FGDATA):<pre>rm -rf build/* install/simgear/ install/openrti/ install/flightgear/share/ install/flightgear/bin/</pre> see this thread for more details (http://forum.flightgear.org/viewtopic.php?f=45&t=26244)
== Options ==
The script by default (without any option) will only compile FlightGear and FgrunFGRun. 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:
* CMAKE (to compile and install only cmake)
* PLIB (to compile and install only plib)
* OSG (to compile and install only OpenSceneGraph)
* 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!)
* FGCOM (to compile and install only Fgcom)
* FGCOMGUI (to compile and install only FgComGui)
* ATLAS (to compile and install only Atlas)
=== Fast updating ===
=== 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.<BR/>
Warning: If you run this option inside a folder where you previously compiled fgfsFGFS, it will probably fail to compile, you better run the script with this option inside an empty folder or a folder whith with the same fgfs FGFS version compiled previously.
=== Advanced options ===
* Build a release version using '''-b Release''' option* Build a debug version for more complete bug reporting using '''-b RelWithDebInfo''' option (default)* Build a full debug version for very complete bug reporting using '''-b Debug''' option* Skip download of distro packages using '''-p n''' option
* Skip compilation of programs using '''-c n''' option
* Skip retrieving software updates using '''-d n''' option
== Optimus technology ==
If your computer has a GPU with optimus 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) :
Now you can run FG with ./run_fgfs_optirun.sh
the same is applied with the FGRun launcher :
sed 's|\./fgrun|optirun ./fgrun|' run_fgrun.sh > run_fgrun_optirun.sh && chmod +x run_fgrun_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/simgear"''' line :
sed -i s/SG_ALERT,\ \"Image/SG_WARN,\ \"Image/g simgear/scene/model/ModelRegistry.cxx
[[Category:Building from source]]
[[nl:Compileren met een Script op Linux Debian/Ubuntu]]
[[fr:Script de compilation sous Linux Debian/Ubuntu]]

Navigation menu