Fr/Script de compilation sous Linux Debian/Ubuntu: Difference between revisions

Jump to navigation Jump to search
no edit summary
(Created page with "{{BeingTranslated}}~~~~ Script de compilation sous Linux Debian/Ubuntu en:Scripted Compilation on Linux Debian/Ubuntu nl:Compileren met een Script op Linux Debian/Ubuntu")
 
No edit summary
Line 1: Line 1:
{{BeingTranslated}}[[User:Favdb|Favdb]] ([[User talk:Favdb|talk]]) 04:17, 8 June 2015 (EDT)
Le script décrit ici prend en charge le téléchargement des sources et la compilation de FlightGear à partir des dépôts git en exécutant une commande unique pour les systèmes de type Debian 32-bit et 64-bit (Debian, Ubuntu). L'installation pré-existante de FlightGear (si elle existe) ne sera pas modifiée, le script construit et installe tout ce qu'il faut dans le répertoire dans lequel il sera téléchargé. Vous pouvez choisir entre la construction de l'ensemble ou seulement l'un des outils spécifiques de l'application.
Script de compilation sous Linux Debian/Ubuntu
 
[[en:Scripted Compilation on Linux Debian/Ubuntu]]
Les paquetages nécessaires seront installés via le système apt-get. Les bibliothèques qui ne sont pas incluses dans les dépôts seront téléchargés et compilées "à la volée" (par exemple [[Plib]], [[Simgear]] and [[OSG]]).
 
Pour les systèmes de type Redhat (Fedora, CentOS) reportez vous à la page dédiée à [[CentOS]].
 
Voir aussi [[Superbuild]].
 
=== Update Available - Conversion step is built in ===
 
[[user:F-JJTH|F-JJTH]] has published version 2.33 of the script.
 
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
 
=== Disk Space Requirements ===
As of Version 3.4.0 in June 2015, this script require 2-3 gb of disk space, note that this includes  downloaded source trees, build files, and fgdata. 
 
=== List of compiled programs ===
The script is able to download and compile:
* FlightGear (And all the data needed to use it)
* [[Fgrun]]
* [[FGo!]]
* [[FGX]]
* [[Terragear]]
* [[TerraGear_GUI]]
* [[OpenRadar]]
* [[FlightGear HLA support (High Level Architecture) | OpenRTI]]
 
Note that 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)
 
==== When building Next you may see build errors ====
Keeping in mind that this script compiles bleeding edge software versions, using latest debian derivered distros, it can happen that the program that was successfully compiling last week, today does not. Building the stable version should always work unless there is a problem with the script<BR/>
 
== Download ==
You can download the script here:
*  [http://sourceforge.net/p/flightgear/fgmeta/ci/next/tree/download_and_compile.sh?format=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
 
== Known Pitfalls ==
FlightGear versions <= 3.0 are known to have 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_SRC, 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.
 
To work around this issue, simply switch to your SG/FG build directories and reconfigure each tree by running "cmake ." - for further info, see [http://forum.flightgear.org/viewtopic.php?f=22&t=20304#p186647][http://forum.flightgear.org/viewtopic.php?f=22&p=187413#p186942].
 
This should probably be removed.  Stable is 3.0.
 
== Instructions ==
To run download_and_compile.sh, just save it in a directory called for example: ~/fgfs
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.  You can replace master with next to get a later version of the script if one is available:
<pre>
mkdir ~/fgfs
cd ~/fgfs
wget http://www.gitorious.org/fg/fgmeta/raw/download_and_compile.sh
chmod 755 download_and_compile.sh
</pre>
 
 
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 of fgdata]]. 
=== Build the latest stable FlightGear release ===
When executing the script, use the "-s" option to build the latest stable release:
<pre>
./download_and_compile.sh -s
</pre>
 
=== Build the current FlightGear development version ===
When executing the script without any options,
the latest development version is built.
 
'''Warning''': The development version of 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.
 
<pre>
./download_and_compile.sh
</pre>
 
 
Once the script is finished, you will successfully get Flightgear and Fgrun installed in the ~/fgfs directory.
 
=== Launching FlightGear ===
When using brisa's script, the 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:
<pre>
cd ~/fgfs
sh run_fgfs.sh
</pre>
 
=== Launching Fgrun ===
[[File:fgrun-page2.jpg|thumb|right]]
For many users it's more comfortable having FlightGear launched by the graphical utility Fgrun which is installed as well in the same folder. You have to launch the ''run_fgrun.sh'' command, for example:
<pre>
cd ~/fgfs
sh run_fgrun.sh
</pre>
 
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 Fgo! ===
[[File:Fgo01.jpg|thumb|left]]
This is a graphical utility written in [[python]], You have to launch the ''run_fgo.sh'' command, for example:
<pre>
cd ~/fgfs
sh run_fgo.sh
</pre>
Remember that the first time you run it, you have to go to preferences and set the binary and fgdata path (Do no set the working directory, you don't need it).
 
== Additional programs ==
If you wish to get all the other programs, you need to launch the script adding the "ALL" option to the command line:
<pre>
./download_and_compile.sh ALL
</pre>
This, will also install FGCOM, FGComGui and Atlas
 
=== Launching FGCOM ===
FGCOM is the system used by FlightGear to simulate radio communications between users. Launch it using the ''run_fgcom.sh'' command:
<pre>
cd ~/fgfs
sh run_fgcom.sh
</pre>
 
 
 
=== Launching Terrasync ===
Your FlightGear compilation comes with the Terrasync program too, so if you want to use it:
<pre>
cd ~/fgfs
sh run_terrasync.sh -S -p 5500 -d /folder/with/sceneries
</pre>
Where: ''/folder/with/sceneries'' is the folder containing the sceneries data.
 
Then launch fgfs with the '''--fg-scenery=/folder/with/sceneries --atlas=socket,out,5,localhost,5500,udp''' option
 
== Troubleshooting ==
 
=== Compilation errors ===
Here we are, no fear, if you wish to use programs from the cvs/svn/git repositories, you might face compilation errors that will prevent you to have a working copy of one or more of the programs provided by this script. What can be the causes that prevent us from successfully compiling? As far as I know those:
# Software developers introduce a new functionality with a new piece of code that prevents the compilation under your architecture, this can happen working with cvs/svn/git sources.
# The program refuses to compile because of a divergence in the libraries on which it depends. For example FlightGear might not compile because OSG has been modified, while OSG itself compiles fine, FG won't.
# One or more repositories are down and you can't get the library you need. (Both from cvs/svn/git or apt-get)
 
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 fgrun, 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 Fgrun. To make it compile all, you need to launch the script with the ''ALL'' parameter. i.e.:
<pre>
./download_and_compile.sh ALL
</pre>
 
=== 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:
* PLIB (to compile and install only plib)
* OSG (to compile and install only OpenSceneGraph)
* SIMGEAR (to compile and install only Simgear)
* FGFS (to compile and install only FlightGear)
* 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!)
 
=== Fast updating ===
There is a second parameter ''UPDATE'' that allows you to just update your installation. i.e.:
This will only update FGFS
<pre>
./download_and_compile.sh FGFS UPDATE
</pre>
 
=== 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. 
<pre>
./download_and_compile.sh -s
</pre>
 
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 fgfs, it will probably fail to compile, you better run the script with this option inside an empty folder or a folder whith the same fgfs version compiled previously.
 
=== Advanced options ===
* 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
* Skip reconfigure (make clean) using '''-r n''' option
 
For example, if you are a developer and wish to quickly recompile and reinstall only your own modifications for FlightGear do this:
<pre>
./download_and_compile.sh -p n -d n -r n  FGFS
</pre>
 
this will only recompile modifications and reinstall them.
 
=== Multicore Acceleration ===
Using the option '''-j x''' (where x is the number of your CPU-Cores you wish to assign to the job) will speed up the whole compilation process considerably.
 
== Disk usage ==
Having both compiled program, source code, and data from git requires some hard disk space: It will take something like 13 GB of space.
If you don't have a fast machine, it will require several hours of compilation time.
 
== Optimus technology ==
If your computer has a GPU with 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) :
<pre>
sed  's|\./fgfs|optirun ./fgfs|' run_fgfs.sh > run_fgfs_optirun.sh && chmod +x run_fgfs_optirun.sh
</pre>
Now you can run FG with ./run_fgfs_optirun.sh
 
 
the same is applied with the FGRUN launcher :
<pre>
sed  's|\./fgrun|optirun ./fgrun|' run_fgrun.sh > run_fgrun_optirun.sh && chmod +x run_fgrun_optirun.sh
</pre>
 
== 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"''' line :
<pre>
sed -i s/SG_ALERT,\ \"Image/SG_WARN,\ \"Image/g simgear/scene/model/ModelRegistry.cxx
</pre>
 
[[Category:Building from source]]
 
[[nl:Compileren met een Script op Linux Debian/Ubuntu]]
[[nl:Compileren met een Script op Linux Debian/Ubuntu]]
[[fr:Script de compilation sous Linux Debian/Ubuntu]]
117

edits

Navigation menu