==Description== 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.
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]]).
= List of compiled programs === The script is able to download and compile: * FlightGear ( And all the data needed to use it) * [[ Fgrun]] * [[ FGCOM]] * [[ FGComGui]] * [[ FGo!]] * [[ Atlas]] * [[ Terrasync]]
== Download ==
You can download the script here: [http://www.gitorious.org/fg/fgmeta/blobs/raw/master/download_and_compile.sh download_and_compile.sh]
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
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: <pre> mkdir ~/fgfs cd ~/fgfs wget http://www. gitorious. org/fg/fgmeta/blobs/raw/master/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).
Build the latest stable FlightGear release === When executing the script, use the "- s" option to build the latest stable release : < pre> sh download_and_compile.sh - s
=== Build the current FlightGear development verison == = When executing the script without any option , the latest development version is built .
'''Warning''': The development version 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> sh download_and_compile.sh
Once the script is finished, you will successfully get Flightgear and Fgrun installed in the ~/ fgfs directory .
=== Launching FlightGear ===
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 === [[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 ~/fgfssh run_fgrun.sh</ pre>
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:
sh download_and_compile.sh ALL
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 -cs</ pre>
=== Launching FGComGui === FgComGui is a GUI wrapper to launch fgcom.< pre>cd ~/ fgfs sh run_fgcomgui.sh </pre>
=== Launching Atlas ===[[ File:Atlas.jpg| thumb]] Atlas provides a map for FlightGear, use it launching: ''run_atlas.sh'' <pre> cd ~/fgfs sh run_atlas. sh </pre>
Launching Terrasync === Your FlightGear compilation comes with the Terrasync program too , so if you want to use it:< pre> cd ~/ fgfssh 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 ==
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.
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> sh 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) * 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 = == There is a second parameter ''UPDATE'' that allows you to just update your installation. i.e.: This will only update FGFS <pre> sh 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> sh 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 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> sh 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 11 GB of space. If you don't have a fast machine, it will require several hours of compilation time.
[[nl:Compileren met een Script op Linux Debian/Ubuntu]]