<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.flightgear.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Gckrol</id>
	<title>FlightGear wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.flightgear.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Gckrol"/>
	<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/Special:Contributions/Gckrol"/>
	<updated>2026-06-13T09:51:16Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.6</generator>
	<entry>
		<id>https://wiki.flightgear.org/w/index.php?title=Scripted_Compilation_on_Linux_Debian/Ubuntu&amp;diff=144880</id>
		<title>Scripted Compilation on Linux Debian/Ubuntu</title>
		<link rel="alternate" type="text/html" href="https://wiki.flightgear.org/w/index.php?title=Scripted_Compilation_on_Linux_Debian/Ubuntu&amp;diff=144880"/>
		<updated>2026-06-03T07:59:29Z</updated>

		<summary type="html">&lt;p&gt;Gckrol: Remove outdated (&amp;gt;5 year old) information + some minor updates&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; is a Bash script that takes care of downloading and compiling FlightGear and related software from their source code repositories with just one command execution for both 32-bit and 64-bit [https://www.debian.org/ Debian]-based systems. Pre-existing versions (if any) of the software installed by &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; are not touched at all since the script downloads, builds and installs everything under the directory in which it is launched. You can choose the particular components to download, build and install.&lt;br /&gt;
&lt;br /&gt;
Unless told not to do so, &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; installs packages with &amp;lt;tt&amp;gt;apt-get&amp;lt;/tt&amp;gt;. For this reason, it is primarily useful on Debian-based distributions. However, if one disables package installation (using &amp;lt;code&amp;gt;-pn&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;--sudo=echo&amp;lt;/code&amp;gt;) and installs the corresponding dependencies oneself, it can be used on other Unix-like systems such as [https://fedoraproject.org/ Fedora Linux], [https://archlinux.org/ Arch Linux] or [https://www.openbsd.org/ OpenBSD].&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; is a [https://www.gnu.org/software/bash/ Bash] script written for [https://www.debian.org/ Debian]-derived distributions ([https://www.ubuntu.com/ Ubuntu], [https://devuan.org/ Devuan], [https://www.linuxmint.com/ Linux Mint], etc.). Its purpose is to automatically install dependencies using the package manager, then build and install FlightGear-related programs.&lt;br /&gt;
&lt;br /&gt;
By default, &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; installs most dependencies with &amp;lt;tt&amp;gt;apt-get&amp;lt;/tt&amp;gt; run under &amp;lt;tt&amp;gt;sudo&amp;lt;/tt&amp;gt;.&amp;lt;ref name=&amp;quot;disabling-installation-of-dependencies-via-package-manager&amp;quot;&amp;gt;If you think you already have the dependencies, this installation can be disabled either by using option &amp;lt;code&amp;gt;-pn&amp;lt;/code&amp;gt; or by passing option &amp;lt;code&amp;gt;--sudo=echo&amp;lt;/code&amp;gt; (the latter results in printing the &amp;lt;tt&amp;gt;apt-get&amp;lt;/tt&amp;gt; command line without running it).&amp;lt;/ref&amp;gt; Other dependencies, either because they aren't available in the standard APT repositories, or because of non-option arguments passed to &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt;, are downloaded and compiled on the fly (this can be the case for [[PLIB]], [[Simgear]] and [[OpenSceneGraph]], for instance—it all depends on the arguments passed to the script).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; works in the directory it is run from: apart from dependencies installed via the package manager, all programs built by &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; are installed under the &amp;lt;tt&amp;gt;install&amp;lt;/tt&amp;gt; subdirectory of the directory from which the script was run. In other words, installation of programs by &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; is clean, very easy to undo and doesn't interfere with other programs on the system.&lt;br /&gt;
&lt;br /&gt;
It is possible to manage several directory trees with &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt;; as far as it is concerned, such directory trees are completely independent from each other. For instance, if you run &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; in &amp;lt;tt&amp;gt;dir1&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;dir2&amp;lt;/tt&amp;gt;, the programs installed under &amp;lt;tt&amp;gt;dir1&amp;lt;/tt&amp;gt; won't “see” those installed under &amp;lt;tt&amp;gt;dir2&amp;lt;/tt&amp;gt;, and vice versa.&lt;br /&gt;
&lt;br /&gt;
Apart from its main purpose, &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; can be used to find hopefully up-to-date build-dependency information for FlightGear and related software. You would do so by inspecting {{fgmeta source&lt;br /&gt;
| path = download_and_compile.sh&lt;br /&gt;
| text = the script &lt;br /&gt;
}} at the point where it installs packages.&amp;lt;ref name=&amp;quot;note-inspecting-download-and-compile-sh-to-gather-build-dependency-information&amp;quot;&amp;gt;Look for strings such as &amp;lt;tt&amp;gt;zlib1g-dev&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;libglew-dev&amp;lt;/tt&amp;gt; or &amp;lt;tt&amp;gt;qt5-default&amp;lt;/tt&amp;gt;.&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
&lt;br /&gt;
Before embarking on building your own FlightGear binaries, you need to install a few tools that &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; uses to retrieve and compile source code. These tools are found in the following packages on [https://www.debian.org/ Debian] systems (and presumably on most Debian derivatives too):&lt;br /&gt;
&lt;br /&gt;
* build-essential&lt;br /&gt;
* git&lt;br /&gt;
* cmake&lt;br /&gt;
&lt;br /&gt;
These packages can be installed by running a command such as:&lt;br /&gt;
 $ sudo apt-get install build-essential git cmake&lt;br /&gt;
Once this is done, the &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; script can be run. Unless told otherwise, it will install additional tools and libraries as it runs, depending on the chosen components (this will be explained in further sections).&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;span id=&amp;quot;disk-space-requirements-and-build-time&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; Disk space requirements and build time ==&lt;br /&gt;
&lt;br /&gt;
As of June 2026, building FlightGear requires about 20 [https://en.wikipedia.org/wiki/Gibibyte GiB] of disk space. Note that this includes downloaded source code for [[SimGear]] and FlightGear, generated build files and the large [[FGData]] repository (about 9 GiB for that one).&lt;br /&gt;
&lt;br /&gt;
With an Intel Core i7 860 CPU (2.80 GHz) purchased in 2009, compiling [[SimGear]] and FlightGear 2019.2 with option &amp;lt;code&amp;gt;-j8&amp;lt;/code&amp;gt; takes about 14 minutes. If you don't have a fast machine and build using only one core, it may require several hours.&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
&lt;br /&gt;
You can get &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; {{fgmeta source&lt;br /&gt;
| path = download_and_compile.sh&lt;br /&gt;
| text = from FGMeta &lt;br /&gt;
}}. It is contained in the [[FGMeta]] repository, which is maintained by the FlightGear developers. The script can be downloaded from the link given above, however, for easier updates and in order to have the command &amp;lt;code&amp;gt;download_and_compile.sh --version&amp;lt;/code&amp;gt; work as intended, it is recommended to get it as explained [[#getting-download-and-compile-sh-using-an-fgmeta-clone|below]].&lt;br /&gt;
&lt;br /&gt;
In case you build stable versions of FlightGear using either of the &amp;lt;code&amp;gt;-s&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;--lts&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;--old-lts&amp;lt;/code&amp;gt; options of &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt;, remember to update the script before trying to build a new version of FlightGear (see [[#updating-download-and-compile-sh-using-an-fgmeta-clone|Updating &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt;]] below). Of course, you can update it more often in order to benefit from new features or bug fixes; this is especially useful if you are building ''next''—that is, the development branch of FlightGear.&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;span id=&amp;quot;getting-started-with-download-and-compile-sh&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; Getting started with &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; ==&lt;br /&gt;
&lt;br /&gt;
=== For the impatient ===&lt;br /&gt;
&lt;br /&gt;
So, you're in a hurry, want to build FlightGear but don't want to read any explanation? You can try what follows, but be aware that you may need to come back and read part of the the following sections if you encounter a problem. All commands should be run under a normal user account; however, unless you pass option &amp;lt;code&amp;gt;-pn&amp;lt;/code&amp;gt; or something similar to disable installation of packages from your distribution, you'll be asked for your &amp;lt;tt&amp;gt;sudo&amp;lt;/tt&amp;gt; password during execution of the &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; command (&amp;lt;tt&amp;gt;sudo&amp;lt;/tt&amp;gt; is used by &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; to run commands like &amp;lt;tt&amp;gt;apt-get&amp;lt;/tt&amp;gt;). So, here is your quick recipe for getting &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; and using it to build FlightGear:&lt;br /&gt;
 mkdir -p ~/flightgear/dnc-managed&lt;br /&gt;
 cd ~/flightgear&lt;br /&gt;
 {{fgmeta clone | protocol = https}}&lt;br /&gt;
 cd ~/flightgear/dnc-managed&lt;br /&gt;
 ~/flightgear/fgmeta/download_and_compile.sh -s -j$(nproc)&lt;br /&gt;
 ./run_fgfs.sh --launcher&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;-s&amp;lt;/code&amp;gt; option passed to &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; instructs it to build the latest stable release of FlightGear. Use option &amp;lt;code&amp;gt;--lts&amp;lt;/code&amp;gt; instead if you want the latest Long Term Stable release (it may be older but possibly more stable), or &amp;lt;code&amp;gt;--old-lts&amp;lt;/code&amp;gt; for the previous LTS release. If you pass none of &amp;lt;code&amp;gt;-s&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;--lts&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;--old-lts&amp;lt;/code&amp;gt;, &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; will build the ''next'' suite, which contains the development version of FlightGear. For more details on these options, see [[#Release selection|Release selection]].&lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;tt&amp;gt;run_fgfs.sh --launcher&amp;lt;/tt&amp;gt; starts the [[FlightGear Qt launcher|FlightGear built-in launcher]]. This is often convenient but not compulsory. Another way to start FlightGear could be &amp;lt;code&amp;gt;./run_fgfs.sh --airport=PHTO --aircraft=c172p&amp;lt;/code&amp;gt;. There are plenty of other options, which are listed by &amp;lt;code&amp;gt;./run_fgfs.sh --help --verbose&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
In some cases, &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; stops and waits for your answer before continuing. This is done when there is something important that you should know. When you are used to these prompts and would rather not see them anymore, pass the &amp;lt;code&amp;gt;--non-interactive&amp;lt;/code&amp;gt; option to suppress them.&lt;br /&gt;
&lt;br /&gt;
More detailed instructions are given below. The following sections also explain how to update &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; and FlightGear.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;span id=&amp;quot;getting-started-with-download-and-compile-sh-notations&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; Notations ===&lt;br /&gt;
&lt;br /&gt;
When a command should be run as an unpriviledged user, it will be preceded by a dollar sign:&lt;br /&gt;
 $ whoami&lt;br /&gt;
 toto&lt;br /&gt;
In contrast, a hash sign (#) means that the command must be run with superuser privileges to achieve the desired effect:&lt;br /&gt;
 # whoami&lt;br /&gt;
 root&lt;br /&gt;
&lt;br /&gt;
In order to make instructions easy to understand, two directories (= folders) will be consistently used for the same purpose below:&lt;br /&gt;
* &amp;lt;tt&amp;gt;~/flightgear/fgmeta&amp;lt;/tt&amp;gt; will contain a clone of the [[FGMeta]] repository; therefore, &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; will reside in that directory;&lt;br /&gt;
* &amp;lt;tt&amp;gt;~/flightgear/dnc-managed&amp;lt;/tt&amp;gt; will be the directory from which we run &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt;. In other words, with this setup, a typical sequence of commands could be:&lt;br /&gt;
 $ cd ~/flightgear/dnc-managed&lt;br /&gt;
 $ ~/flightgear/fgmeta/download_and_compile.sh&lt;br /&gt;
or&lt;br /&gt;
 $ cd ~/flightgear/dnc-managed&lt;br /&gt;
 $ ~/flightgear/fgmeta/download_and_compile.sh CARES PLIB SIMGEAR FGFS DATA OSG&lt;br /&gt;
These are of course just examples. The aforementioned paths are not hardwired anywhere in the script; you are free to choose the directories you want for these purposes.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;span id=&amp;quot;getting-download-and-compile-sh-using-an-fgmeta-clone&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; Getting &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; the “right way” ===&lt;br /&gt;
&lt;br /&gt;
There are several ways to obtain {{fgmeta source&lt;br /&gt;
| path = download_and_compile.sh&lt;br /&gt;
| text = download_and_compile.sh&lt;br /&gt;
}}. The method described here makes it very easy to update the script and causes the command &amp;lt;code&amp;gt;download_and_compile.sh --version&amp;lt;/code&amp;gt; to work as intended.&lt;br /&gt;
&lt;br /&gt;
As explained in [[#getting-started-with-download-and-compile-sh-notations|Notations]], we want to clone the [[FGMeta]] repository in &amp;lt;tt&amp;gt;~/flightgear/fgmeta&amp;lt;/tt&amp;gt; and work with its ''next'' branch. Let's go:&lt;br /&gt;
 $ mkdir -p ~/flightgear&lt;br /&gt;
 $ cd ~/flightgear&lt;br /&gt;
 $ {{fgmeta clone | protocol = https}}&lt;br /&gt;
You now have a fresh FGMeta clone in &amp;lt;tt&amp;gt;~/flightgear/fgmeta&amp;lt;/tt&amp;gt; and your brand new &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; script is located in that directory. You can already try it to see the available options:&lt;br /&gt;
&amp;lt;pre&amp;gt;$ ~/flightgear/fgmeta/download_and_compile.sh --help&lt;br /&gt;
download_and_compile.sh [OPTION...] [--] [COMPONENT...]&lt;br /&gt;
Download and compile components belonging to the FlightGear ecosystem.&lt;br /&gt;
&lt;br /&gt;
Without any COMPONENT listed, or if ALL is specified, recompile all&lt;br /&gt;
components listed in the WHATTOBUILDALL variable. Each COMPONENT may&lt;br /&gt;
be one of the following words:&lt;br /&gt;
&lt;br /&gt;
  ALL, ATCPIE, CARES, CMAKE, DATA, FFGO, FGFS, FGRUN, FGX, OPENRADAR, OSG, PLIB, SIMGEAR, TERRAGEAR, TERRAGEARGUI, ZLIB.&lt;br /&gt;
&lt;br /&gt;
Available options:&lt;br /&gt;
  -h, --help    show this help message and exit&lt;br /&gt;
      --version print version and license information, then exit&lt;br /&gt;
&lt;br /&gt;
(...)&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;span id=&amp;quot;updating-download-and-compile-sh-using-an-fgmeta-clone&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; Updating &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
Now that you have &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; from the [[FGMeta]] repository, it is very easy to update (this assumes you didn't modify anything yourself inside &amp;lt;tt&amp;gt;~/flightgear/fgmeta&amp;lt;/tt&amp;gt;!):&lt;br /&gt;
 $ cd ~/flightgear/fgmeta &amp;amp;&amp;amp; git pull&lt;br /&gt;
&lt;br /&gt;
If you want to keep updates as easy as we just showed, it is best not to modify &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; yourself. &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; has plenty of options that usually make it unnecessary to modify the script. Just run &amp;lt;code&amp;gt;download_and_compile.sh --help&amp;lt;/code&amp;gt; and learn about the available options when you feel the need to change something. Unless you have special needs that can only be accomodated by modifying &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt;, you are invited to skip to the next section.&lt;br /&gt;
&lt;br /&gt;
If you really, ''really'' want to modify &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; while keeping updates easy, a good technique is to add your changes to your FGMeta clone in the form of one or more Git ''commits'' (no need to push them anywhere, commits can remain in your clone). How to do that is beyond the scope of this document, though; read Git tutorials if you want to learn it (there are plenty on the Internet). Once you have committed your changes to your FGMeta clone, make sure the repository is clean (use &amp;lt;code&amp;gt;git status&amp;lt;/code&amp;gt;), then update it with:&lt;br /&gt;
 $ cd ~/flightgear/fgmeta &amp;amp;&amp;amp; git pull --rebase&lt;br /&gt;
This will apply your commits on top of the latest commit of the branch that is currently checked out, which so far contained the official version of &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt;. In case your changes conflict with the update, Git will tell you and you'll have to resolve the conflict manually (look for “Git resolve conflict” on your favorite search engine)... or start again from a pristine [[FGMeta]] clone.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;span id=&amp;quot;using-download-and-compile-sh-to-build-flightgear&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; Building FlightGear ===&lt;br /&gt;
&lt;br /&gt;
In what follows, we won't give the full path to &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; when showing commands to be run, but you should prepend it to &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; whenever you see a &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; command. For instance, if you used the same path as in [[#getting-started-with-download-and-compile-sh-notations|Notations]] and see the command:&lt;br /&gt;
 $ download_and_compile.sh --help&lt;br /&gt;
what you should actually run is:&lt;br /&gt;
 $ ~/flightgear/fgmeta/download_and_compile.sh --help&lt;br /&gt;
&lt;br /&gt;
Apart from this harmless command, ''do not'' run other &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; commands from an arbitrary directory, in particular ''don't'' run them from &amp;lt;tt&amp;gt;~/flightgear/fgmeta&amp;lt;/tt&amp;gt;. This is because '''most other &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; commands write to the current directory''' (&amp;lt;code&amp;gt;download_and_compile.sh --help&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;download_and_compile.sh --version&amp;lt;/code&amp;gt; are safe to run from any directory, though).&lt;br /&gt;
&lt;br /&gt;
Of course, it is always possible to make commands shorter by setting up aliases (see tips at the end of [https://sourceforge.net/p/flightgear/mailman/message/36634426/ this message]), by adding the directory containing &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; to your &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt; or by creating a symbolink link pointing to &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; in a directory that is part of your &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt;. This is not necessary, though; do it only if you feel the need (when enabled, persistent shell history is often enough to obviate the need to extend the &amp;lt;tt&amp;gt;PATH&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
{{Note|The following commands should be run from an empty directory&amp;lt;ref name=&amp;quot;dedicated-directory-won-t-stay-empty-forever&amp;quot;&amp;gt;Well, empty before the first time; later, &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; is going to populate it with plenty of FlightGear files and subdirectories, of course.&amp;lt;/ref&amp;gt; in a partition that has enough free space (see [[#disk-space-requirements-and-build-time | Disk space requirements and build time]]). As explained in [[#getting-started-with-download-and-compile-sh-notations|Notations]], we are going to choose the directory &amp;lt;tt&amp;gt;~/flightgear/dnc-managed&amp;lt;/tt&amp;gt; for this purpose, in order to express that the whole directory tree is managed by &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt;. This is just an example; feel free to choose another directory if you want.&lt;br /&gt;
&lt;br /&gt;
'''Don't run the commands from a non-dedicated directory,''' because it will be filled with files and directories created by &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; and the FlightGear, SimGear, etc. build systems. That would be a complete mess! In particular, ''don't'' run the commands from the directory containing your [[FGMeta]] clone.}}&lt;br /&gt;
&lt;br /&gt;
{{Tip|For some commands, &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; may use &amp;lt;tt&amp;gt;sudo&amp;lt;/tt&amp;gt;. In case you want to run some other program instead of &amp;lt;tt&amp;gt;sudo&amp;lt;/tt&amp;gt;, this can be done with the &amp;lt;code&amp;gt;--sudo&amp;lt;/code&amp;gt; option of &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt;. For instance, in order to see the commands that would be run with sudo without actually running them, you can pass &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;--sudo=echo&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; to &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt;. Like all other options, &amp;lt;code&amp;gt;--sudo&amp;lt;/code&amp;gt; must be given ''before'' all arguments that are component names (such as &amp;lt;tt&amp;gt;SIMGEAR&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;FGFS&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;DATA&amp;lt;/tt&amp;gt;, etc.).}}&lt;br /&gt;
&lt;br /&gt;
The package manager used by &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; by default is &amp;lt;tt&amp;gt;apt-get&amp;lt;/tt&amp;gt; (it won't be used if you pass &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; the &amp;lt;code&amp;gt;-pn&amp;lt;/code&amp;gt; option). You can use another one if you wish, as long as it supports the following calls:&lt;br /&gt;
 ''pkg-mgr'' update&lt;br /&gt;
 ''pkg-mgr'' install ''pkg1 pkg2'' ...&lt;br /&gt;
This is the case for &amp;lt;tt&amp;gt;aptitude&amp;lt;/tt&amp;gt; as well as &amp;lt;tt&amp;gt;apt&amp;lt;/tt&amp;gt;. If you want &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; to use &amp;lt;tt&amp;gt;aptitude&amp;lt;/tt&amp;gt;, give it the option &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;--package-manager=aptitude&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt; before any of the ''COMPONENT'' arguments.&lt;br /&gt;
&lt;br /&gt;
All options of &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; can be seen by running the following command:&lt;br /&gt;
 $ download_and_compile.sh --help&lt;br /&gt;
&lt;br /&gt;
Now the instructions. '''You have chosen a dedicated directory''' where all the stuff that is downloaded and built by &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; will be stored. This is &amp;lt;tt&amp;gt;~/flightgear/dnc-managed&amp;lt;/tt&amp;gt; if you followed the suggestions given in [[#getting-started-with-download-and-compile-sh-notations|Notations]], and should be empty before you run &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; for the first time. However, it is quite correct to start &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; from the same directory for subsequent runs, even when non-empty (otherwise, &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; would automatically reclone the repositories every time you run it; that would be a sheer waste of time and bandwidth). All that remains to do is to run:&lt;br /&gt;
 $ mkdir -p ~/flightgear/dnc-managed&lt;br /&gt;
 $ cd ~/flightgear/dnc-managed&lt;br /&gt;
 $ download_and_compile.sh -s -j$(nproc)&lt;br /&gt;
The &amp;lt;code&amp;gt;-j$(nproc)&amp;lt;/code&amp;gt; option is not necessary, but is likely to save you a lot of time; with it, all available CPU cores will be used when compiling—see [[#Multicore acceleration| Multicore acceleration]].&lt;br /&gt;
&lt;br /&gt;
{{Note|Because of the &amp;lt;code&amp;gt;-s&amp;lt;/code&amp;gt; option, the above &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; command would build the latest stable release of FlightGear. If you want to build the latest Long Term Stable release, use &amp;lt;code&amp;gt;--lts&amp;lt;/code&amp;gt; instead. For the previous LTS release, use &amp;lt;code&amp;gt;--old-lts&amp;lt;/code&amp;gt;. If you want to build the development version of FlightGear, use none of &amp;lt;code&amp;gt;-s&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;--lts&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;--old-lts&amp;lt;/code&amp;gt;, but be warned: it may very well be unstable and unsuitable for flying. For more details on these options, see [[#Release selection|Release selection]].}}&lt;br /&gt;
&lt;br /&gt;
When you don't pass any non-option argument to &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; as done here, it takes care of the base components needed to run FlightGear in good conditions: &amp;lt;tt&amp;gt;CARES&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;PLIB&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;SIMGEAR&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;FGFS&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;DATA&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;OSG&amp;lt;/tt&amp;gt; (these are the component names used by &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt;, i.e., the final arguments one can optionally give in a &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; command; in normal speech, they correspond to the {{github source&lt;br /&gt;
| proj = c-ares&lt;br /&gt;
| repo = c-ares&lt;br /&gt;
| text = c-ares&lt;br /&gt;
}}, {{sourceforge source&lt;br /&gt;
| proj = libplib&lt;br /&gt;
| repo = code&lt;br /&gt;
| text = PLIB&lt;br /&gt;
}}, {{simgear source&lt;br /&gt;
| text = SimGear&lt;br /&gt;
}}, {{flightgear source&lt;br /&gt;
| text = FlightGear&lt;br /&gt;
}} and {{fgdata source&lt;br /&gt;
| text = FGData&lt;br /&gt;
}} repositories, as well as a suitable repository for [[OpenSceneGraph]]). Therefore, the above command is presently exactly equivalent to:&lt;br /&gt;
 $ download_and_compile.sh -s -j$(nproc) CARES PLIB SIMGEAR FGFS DATA OSG&lt;br /&gt;
&lt;br /&gt;
In case you want to build another component such as, say, CMAKE, you can add it to the command, like this:&lt;br /&gt;
 $ download_and_compile.sh -s -j$(nproc) CARES PLIB SIMGEAR FGFS DATA OSG CMAKE&lt;br /&gt;
&lt;br /&gt;
When the command terminates, you should have a script called &amp;lt;tt&amp;gt;run_fgfs.sh&amp;lt;/tt&amp;gt; in the directory from which you ran &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; (i.e., &amp;lt;tt&amp;gt;~/flightgear/dnc-managed&amp;lt;/tt&amp;gt; in the suggested setup). This will be your script to run FlightGear. For instance, in order to start the [[FlightGear Qt launcher|built-in launcher]], you can run the following commands:&amp;lt;ref name=&amp;quot;no-need-to-change-to-dnc-managed-dir-before-starting-generated-scripts&amp;quot;&amp;gt;We give these commands because they are easy to read, but the &amp;lt;code&amp;gt;cd&amp;lt;/code&amp;gt; command is not needed if you use the correct path, as in &amp;lt;code&amp;gt;~/flightgear/dnc-managed/run_fgfs.sh --launcher&amp;lt;/code&amp;gt;.&amp;lt;/ref&amp;gt;&lt;br /&gt;
 $ cd ~/flightgear/dnc-managed&lt;br /&gt;
 $ ./run_fgfs.sh --launcher&lt;br /&gt;
(You may omit the &amp;lt;code&amp;gt;--launcher&amp;lt;/code&amp;gt; option; this would simply start FlightGear without any launcher, at the default airport and with the default aircraft.)&amp;lt;br /&amp;gt;&lt;br /&gt;
In case you find this tedious to type or have more arguments to pass on a regular basis, you can follow the advice given at the end of [https://sourceforge.net/p/flightgear/mailman/message/36634426/ this message] or use another launcher such as [[FFGo]]—but the [[FlightGear Qt launcher|FlightGear built-in launcher]] started with &amp;lt;code&amp;gt;run_fgfs.sh --launcher&amp;lt;/code&amp;gt; is quite fine, be sure to try it first!&lt;br /&gt;
&lt;br /&gt;
{{Note|If you ran &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; from &amp;lt;tt&amp;gt;~/flightgear/dnc-managed&amp;lt;/tt&amp;gt; as proposed above, the full path of the &amp;lt;tt&amp;gt;~/flightgear/dnc-managed/install/flightgear/fgdata&amp;lt;/tt&amp;gt; directory is your [[$FG_ROOT]]. This is a very important path for FlightGear; knowing this may be useful for troubleshooting or doing “advanced things.”}}&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;span id=&amp;quot;using-download-and-compile-sh-to-update-flightgear&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; Updating FlightGear ===&lt;br /&gt;
&lt;br /&gt;
{{Note|If you built FlightGear with either of &amp;lt;code&amp;gt;-s&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;--lts&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;--old-lts&amp;lt;/code&amp;gt;, you need to pass the ''same option'' to the &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; command given below that will update your FlightGear installation. Otherwise, &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; will automatically build the ''next'' suite (bleeding-edge development version), which is probably not what you wish. Moreover, if you do want to switch from one suite to another (for instance from ''stable'' to ''next'', or from ''Long Term Stable'' to ''stable''), using the &amp;lt;code&amp;gt;--cleanup&amp;lt;/code&amp;gt; option of &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; is heartily recommended.}}&lt;br /&gt;
&lt;br /&gt;
Keeping the above note in mind, go to the directory from which you previously ran &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; (&amp;lt;tt&amp;gt;~/flightgear/dnc-managed&amp;lt;/tt&amp;gt; in the [[#Notations|suggested setup]]). This is the folder which, if you did a complete run of &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; as shown in the previous section, contains the &amp;lt;tt&amp;gt;run_fgfs.sh&amp;lt;/tt&amp;gt; script and a log file named &amp;lt;tt&amp;gt;compilation_log.txt&amp;lt;/tt&amp;gt; that records what &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; did in its last run. If you wish to update, say, {{simgear source&lt;br /&gt;
| text = SimGear&lt;br /&gt;
}}, {{flightgear source&lt;br /&gt;
| text = FlightGear&lt;br /&gt;
}}, {{fgdata source&lt;br /&gt;
| text = FGData&lt;br /&gt;
}} and [[OpenSceneGraph|OSG]], simply execute this:&lt;br /&gt;
 $ download_and_compile.sh -I -pn -j$(nproc) SIMGEAR FGFS DATA OSG&lt;br /&gt;
The &amp;lt;code&amp;gt;-I&amp;lt;/code&amp;gt; option tells &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; to ignore inter-component dependencies. If you don't use it, other components may be processed too due to these dependencies. The purpose of the behaviour without &amp;lt;code&amp;gt;-I&amp;lt;/code&amp;gt; is to help people who aren't necessarily aware of new requirements as time goes (e.g., SIMGEAR and FGFS started to require CARES by the end of 2024; a FlightGear fork of OSG is also required for FGFS ''next'' in 2025). However, it may be frustrating to specify a list of components and see additional ones being automatically added, hence the option.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;-j$(nproc)&amp;lt;/code&amp;gt; option is not necessary, but is likely to save you a lot of time; with it, all available CPU cores will be used when compiling—see [[#Multicore acceleration| Multicore acceleration]].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;SIMGEAR&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;FGFS&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;DATA&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;OSG&amp;lt;/tt&amp;gt; are called ''components'' in &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; terminology. A component generally corresponds to a software repository, or something close.&lt;br /&gt;
&lt;br /&gt;
Now about the &amp;lt;code&amp;gt;-pn&amp;lt;/code&amp;gt;. It is equivalent to &amp;lt;code&amp;gt;-p n&amp;lt;/code&amp;gt; and means “don't try to install or update packages from my (Linux) distribution” (&amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt; means ''yes, please install or update'', &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; means ''no, please don't''). In case you forgot that, simply run:&lt;br /&gt;
 $ download_and_compile.sh --help&lt;br /&gt;
What does it imply to pass &amp;lt;code&amp;gt;-pn&amp;lt;/code&amp;gt;? This tells &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; to completely skip the step where it checks for needed packages from your distribution and installs/updates them, by default using &amp;lt;tt&amp;gt;apt-get&amp;lt;/tt&amp;gt;. It thus goes straight to the following steps:&lt;br /&gt;
* update each repository corresponding to one of the selected components (&amp;lt;tt&amp;gt;SIMGEAR&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;FGFS&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;DATA&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;OSG&amp;lt;/tt&amp;gt; in our example);&lt;br /&gt;
* compile each selected component that requires compilation;&lt;br /&gt;
* install each selected component in the appropriate place (under &amp;lt;tt&amp;gt;~/flightgear/dnc-managed&amp;lt;/tt&amp;gt; according to our [[#getting-started-with-download-and-compile-sh-notations|Notations]]).&lt;br /&gt;
In case you don't have all required dependencies for the selected components, one of them is likely to fail, of course, since by passing &amp;lt;code&amp;gt;-pn&amp;lt;/code&amp;gt; to &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt;, you forbid it to install these dependencies for you. So, you can also very well update without passing the &amp;lt;code&amp;gt;-pn&amp;lt;/code&amp;gt; option, it will simply take a little longer (the time to check if all dependencies of the selected components are available with &amp;lt;tt&amp;gt;APT&amp;lt;/tt&amp;gt;). In fact, this is '''what you should do if the previous &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; run failed:''' first update &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; (see [[#getting-download-and-compile-sh-using-an-fgmeta-clone|above]]) then run it ''without'' &amp;lt;code&amp;gt;-pn&amp;lt;/code&amp;gt;&amp;lt;ref name=&amp;quot;passing-no-pn-option-equals-passing-py&amp;quot;&amp;gt;Which is the same as passing &amp;lt;code&amp;gt;-py&amp;lt;/code&amp;gt;.&amp;lt;/ref&amp;gt; in case new dependencies have been recently added and you don't have them on your system yet—this would be a very likely cause for the failure. In this case, running &amp;lt;code&amp;gt;download_and_compile.sh --cleanup&amp;lt;/code&amp;gt; to restart the build from a clean state is probably a good idea (see [[#Cleaning built and installed files|Cleaning built and installed files]] for details on this option).&lt;br /&gt;
&lt;br /&gt;
'''Summary'''&lt;br /&gt;
&lt;br /&gt;
Routine update:&lt;br /&gt;
 $ download_and_compile.sh -pn -j$(nproc) ''COMPONENT...''&lt;br /&gt;
(add &amp;lt;code&amp;gt;-I&amp;lt;/code&amp;gt; if you don't want inter-component dependencies to pull additional components). In case this fails, first update &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; (see [[#getting-download-and-compile-sh-using-an-fgmeta-clone|above]]), then run&lt;br /&gt;
 $ download_and_compile.sh --cleanup&lt;br /&gt;
 $ download_and_compile.sh -j$(nproc) ''COMPONENT...''&lt;br /&gt;
where ''COMPONENT...'' stands for the space-separated list of components you want &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; to process.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;span id=&amp;quot;examining-download-and-compile-sh-history&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; Examining the history of &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
Looking at the latest commits that affected &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; is quite easy with your FGMeta clone:&lt;br /&gt;
 $ cd ~/flightgear/fgmeta&lt;br /&gt;
 $ git log -- download_and_compile.sh&lt;br /&gt;
(then quit by typing &amp;lt;tt&amp;gt;q&amp;lt;/tt&amp;gt;, assuming your &amp;lt;tt&amp;gt;$GIT_PAGER&amp;lt;/tt&amp;gt; is &amp;lt;tt&amp;gt;less&amp;lt;/tt&amp;gt;)&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In order to do the same, but also see the patch for each commit:&lt;br /&gt;
 $ cd ~/flightgear/fgmeta&lt;br /&gt;
 $ git log -p -- download_and_compile.sh&lt;br /&gt;
&lt;br /&gt;
== &amp;lt;span id=&amp;quot;list-of-available-components&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; List of available components ==&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; script is able to download, compile (when applicable) and install the following components:&lt;br /&gt;
&lt;br /&gt;
* ATCPIE (for the [[ATC-pie]] air traffic control simulation program)&lt;br /&gt;
* CMAKE (for the [https://cmake.org/ CMake] build tool—this can be useful in case CMake is too old in your distribution)&lt;br /&gt;
* DATA (for [[FGData]], the main set of data files used by FlightGear)&lt;br /&gt;
* FGFS (for FlightGear itself)&lt;br /&gt;
* FFGO (for the [[FFGo]] FlightGear launcher)&lt;br /&gt;
* FGRUN (for the [[Fgrun|FGRun]] FlightGear launcher)&lt;br /&gt;
* FGX (for the [[FGX|FGx]] FlightGear launcher&amp;lt;ref name=&amp;quot;note-on-the-status-of-FGx-support-in-download-and-compile-sh&amp;quot;&amp;gt;Support for FGx in &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; would probably benefit from a code review.&amp;lt;/ref&amp;gt;)&lt;br /&gt;
* OPENRADAR (for the [[OpenRadar]] air traffic control simulation program)&lt;br /&gt;
* OSG (for the [[OpenSceneGraph]] library)&lt;br /&gt;
* PLIB (for the [[PLIB]] library)&lt;br /&gt;
* SIMGEAR (for the [[SimGear]] library—foundation for FlightGear and TerraGear)&lt;br /&gt;
* TERRAGEAR (for the [[TerraGear]] terrain building toolchain)&lt;br /&gt;
* TERRAGEARGUI (for [[TerraGear GUI]], a graphical interface for TerraGear)&lt;br /&gt;
* ZLIB (for the [http://www.zlib.net/ zlib] compression library)&lt;br /&gt;
&lt;br /&gt;
Each of the items listed above is a ''component'' in &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; terminology. Components are written in uppercase by convention.&lt;br /&gt;
&lt;br /&gt;
{{Note|The preceding list might not be up-to-date. The up-to-date list of components supported by &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; can always be obtained by running &amp;lt;code&amp;gt;download_and_compile.sh --help&amp;lt;/code&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
What is the point of knowing this? Because you may pass component names to &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; in order to tell it what you want to download, build and install. By default, only the components [[SimGear|SIMGEAR]], [[FlightGear|FGFS]], [[FGData|DATA]] and [[OpenSceneGraph|OSG]] are taken care of, which means that the command:&lt;br /&gt;
 $ download_and_compile.sh&lt;br /&gt;
is equivalent to:&lt;br /&gt;
 $ download_and_compile.sh SIMGEAR FGFS DATA OSG&lt;br /&gt;
&lt;br /&gt;
In case you'd like to do the same build with just [[PLIB]] added, you could use:&lt;br /&gt;
 $ download_and_compile.sh SIMGEAR FGFS DATA OSG PLIB&lt;br /&gt;
&lt;br /&gt;
You get the idea. When several components are passed on the same command line, &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; chooses a reasonable order for processing, so don't worry about that.&lt;br /&gt;
&lt;br /&gt;
== When building ''next'', you may encounter problems ==&lt;br /&gt;
&lt;br /&gt;
Keeping in mind that this script compiles sometimes bleeding edge software, it can happen that what was successfully compiling last week, does not compile anymore today. Building the latest stable version (option &amp;lt;code&amp;gt;-s&amp;lt;/code&amp;gt;) or the latest Long Term Stable release (option &amp;lt;code&amp;gt;--lts&amp;lt;/code&amp;gt;) should always work, unless there is a problem with the script (well, in some cases, there may be packages of your distribution that are too recent for &amp;lt;code&amp;gt;--lts&amp;lt;/code&amp;gt;; for instance, in July 2020, &amp;lt;code&amp;gt;--lts&amp;lt;/code&amp;gt; didn't build with OpenSceneGraph 3.6, but simply passing the OSG component on the &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; command solved the problem, because at that time, option &amp;lt;code&amp;gt;--lts&amp;lt;/code&amp;gt; selected OpenSceneGraph 3.4).&lt;br /&gt;
&lt;br /&gt;
That said, you may want to build the development version (called ''next''): this is the one developers use all the time, so kindly asking on the flightgear-devel [[Mailing_lists|mailing list]] in case a problem popped up&amp;lt;ref name=&amp;quot;what-to-provide-when-asking-for-help&amp;quot;&amp;gt;Don't forget in this case to precisely tell what you did and include the &amp;lt;tt&amp;gt;compilation_log.txt&amp;lt;/tt&amp;gt; file written by &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt;.&amp;lt;/ref&amp;gt; should allow you to find good advice and get the problem quickly fixed, if it's a new one.&lt;br /&gt;
&lt;br /&gt;
{{Warning|As of July 2020, heavy development will be done on ''next'', the development branch of FlightGear. It is expected to be rather unstable for several months. Unless you are really interested in FlightGear development or in providing feedback to the developers, you're probably better off building either the latest stable version (option &amp;lt;code&amp;gt;-s&amp;lt;/code&amp;gt;) or the latest Long Term Stable release (option &amp;lt;code&amp;gt;--lts&amp;lt;/code&amp;gt;). In case you want something even older, the previous LTS release can be selected with option &amp;lt;code&amp;gt;--old-lts&amp;lt;/code&amp;gt;.}}&lt;br /&gt;
&lt;br /&gt;
== Task-specific instructions ==&lt;br /&gt;
&lt;br /&gt;
{{Note|In this section, we assume you've read and followed the advice given in [[#getting-started-with-download-and-compile-sh|Getting started with &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt;]].}}&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;span id=&amp;quot;selecting-the-components-to-work-on&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; Selecting the components to build ===&lt;br /&gt;
&lt;br /&gt;
By default, &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; downloads or updates, then compiles, [[SimGear]], FlightGear, [[FGData]] and [[OpenSceneGraph|OSG]] (more precisely, FGData is downloaded but not compiled—that wouldn't make sense). This is what happens when running:&lt;br /&gt;
 $ download_and_compile.sh&lt;br /&gt;
The preceding command is therefore equivalent to:&lt;br /&gt;
 $ download_and_compile.sh SIMGEAR FGFS DATA OSG&lt;br /&gt;
&lt;br /&gt;
To make &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; take care of other programs or libraries, use non-option arguments naming the ''components'' you want, for instance:&lt;br /&gt;
 $ download_and_compile.sh SIMGEAR FGFS DATA OSG CMAKE&lt;br /&gt;
SIMGEAR, FGFS, DATA, OSG and CMAKE are the component names respectively corresponding to [[SimGear]], FlightGear, [[FGData]], [[OpenSceneGraph]] and [https://cmake.org/ CMake] in &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt;'s terminology.&lt;br /&gt;
&lt;br /&gt;
A [[#list-of-available-components|list of available components]] is provided on this page, but the fully up-to-date list can always be obtained by running &amp;lt;code&amp;gt;download_and_compile.sh --help&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Choosing between stable and development versions ===&lt;br /&gt;
&lt;br /&gt;
By default, &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; fetches code and data from development branches of the source repositories (which sometimes causes compilation or runtime errors). However, it is possible to tell the script to download the latest “stable” version of each component, for some suitable definition of “stable”. This is by means of the &amp;lt;code&amp;gt;-s&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;--lts&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;--old-lts&amp;lt;/code&amp;gt; options:&lt;br /&gt;
 $ download_and_compile.sh -s ''COMPONENT1 COMPONENT2...''&lt;br /&gt;
or&lt;br /&gt;
 $ download_and_compile.sh --lts ''COMPONENT1 COMPONENT2...''&lt;br /&gt;
or&lt;br /&gt;
 $ download_and_compile.sh --old-lts ''COMPONENT1 COMPONENT2...''&lt;br /&gt;
&lt;br /&gt;
How does it work?&lt;br /&gt;
* For [[SimGear]], FlightGear and [[FGData]], &amp;lt;code&amp;gt;-s&amp;lt;/code&amp;gt; uses the most recent stable release branch of the corresponding Git repository, &amp;lt;code&amp;gt;--lts&amp;lt;/code&amp;gt; uses the most recent Long Term Stable release (LTS) and &amp;lt;code&amp;gt;--old-lts&amp;lt;/code&amp;gt; uses the previous LTS release.&lt;br /&gt;
* For other components, a known-stable version is selected by &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt;, which may be influenced by the use of &amp;lt;code&amp;gt;-s&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;--lts&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;--old-lts&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
So, as far as the SIMGEAR, FGFS and DATA components are concerned, you can:&lt;br /&gt;
* build the latest stable release (&amp;lt;code&amp;gt;-s&amp;lt;/code&amp;gt;);&lt;br /&gt;
* build the latest Long Term Stable release (&amp;lt;code&amp;gt;--lts&amp;lt;/code&amp;gt;);&lt;br /&gt;
* build the previous Long Term Stable release (&amp;lt;code&amp;gt;--old-lts&amp;lt;/code&amp;gt;);&lt;br /&gt;
* build the current development version (bleeding edge), which lives in the {{flightgear source&lt;br /&gt;
| branch = next&lt;br /&gt;
| text = next&lt;br /&gt;
}} branch of the FlightGear repository.&lt;br /&gt;
The use of &amp;lt;code&amp;gt;-s&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;--lts&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;--old-lts&amp;lt;/code&amp;gt; also influences the version of other components you may have selected (this can be overridden using &amp;lt;code&amp;gt;--component-branch&amp;lt;/code&amp;gt; for advanced users—see [[#Component-specific settings|Component-specific settings]]).&lt;br /&gt;
&lt;br /&gt;
{{Note|In a given folder where &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; is run, you should normally either always use the &amp;lt;code&amp;gt;-s&amp;lt;/code&amp;gt; option, or always use &amp;lt;code&amp;gt;--lts&amp;lt;/code&amp;gt;, or always use &amp;lt;code&amp;gt;--old-lts&amp;lt;/code&amp;gt;, or always none of these (in other words, stick to the same suite: latest stable, latest LTS, previous LTS or ''next'', consistently accross all components).}}&lt;br /&gt;
&lt;br /&gt;
Actually, it ''is'' possible to switch between suites but you have to use the &amp;lt;code&amp;gt;--cleanup&amp;lt;/code&amp;gt; option when doing the switch (see [[#Cleaning built and installed files|Cleaning built and installed files]] for information on this option). For instance:&lt;br /&gt;
* Build with &amp;lt;code&amp;gt;-s&amp;lt;/code&amp;gt; as many times as you want.&lt;br /&gt;
* Want to try ''next''? Okay, then build once with &amp;lt;code&amp;gt;--cleanup&amp;lt;/code&amp;gt; (no &amp;lt;code&amp;gt;-s&amp;lt;/code&amp;gt; option anymore).&lt;br /&gt;
* You can then perform as many builds of ''next'' as you want; no need to use &amp;lt;code&amp;gt;--cleanup&amp;lt;/code&amp;gt; unless something special went wrong.&lt;br /&gt;
* If you later decide to switch back to the stable release, build once with &amp;lt;code&amp;gt;-s&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;--cleanup&amp;lt;/code&amp;gt;, then only with &amp;lt;code&amp;gt;-s&amp;lt;/code&amp;gt; for further builds.&lt;br /&gt;
* etc.&lt;br /&gt;
&lt;br /&gt;
This way, ''you don't need to download the repositories again'' when trying the various suites. In particular, you can switch between ''next'', stable, LTS and old LTS without downloading nor having several copies of [[FGData]] on your hard drive. (This works because a Git repository may internally contain data for several branches, even if only one is “normally visible” in the filesystem at a given time.)&lt;br /&gt;
&lt;br /&gt;
==== Building the latest Long Term Stable release of FlightGear ====&lt;br /&gt;
&lt;br /&gt;
When executing &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt;, use the &amp;lt;code&amp;gt;--lts&amp;lt;/code&amp;gt; option to build the latest Long Term Stable release: &lt;br /&gt;
 $ cd ~/flightgear/dnc-managed&lt;br /&gt;
 $ download_and_compile.sh --lts&lt;br /&gt;
(In this example, the implicitly-selected components are SIMGEAR, FGFS and DATA, as explained [[#selecting-the-components-to-work-on | above]].)&lt;br /&gt;
&lt;br /&gt;
{{Note|If you decide to use the &amp;lt;code&amp;gt;--lts&amp;lt;/code&amp;gt; option in a given directory tree, you should use it for all components in that directory tree (SIMGEAR, FGFS, DATA, etc.). Running &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; in a given directory with the &amp;lt;code&amp;gt;--lts&amp;lt;/code&amp;gt; option for some components and not for others is not supported.}}&lt;br /&gt;
&lt;br /&gt;
==== Building the latest stable release of FlightGear ====&lt;br /&gt;
&lt;br /&gt;
When executing &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt;, use the &amp;lt;code&amp;gt;-s&amp;lt;/code&amp;gt; option to build the latest stable release: &lt;br /&gt;
 $ cd ~/flightgear/dnc-managed&lt;br /&gt;
 $ download_and_compile.sh -s&lt;br /&gt;
&lt;br /&gt;
{{Note|If you decide to use the &amp;lt;code&amp;gt;-s&amp;lt;/code&amp;gt; option in a given directory tree, you should use it for all components in that directory tree (SIMGEAR, FGFS, DATA, etc.). Running &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; in a given directory with the &amp;lt;code&amp;gt;-s&amp;lt;/code&amp;gt; option for some components and not for others is not supported.}}&lt;br /&gt;
&lt;br /&gt;
==== Building the current FlightGear development version ====&lt;br /&gt;
&lt;br /&gt;
When executing &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; without any option, the development version of every selected component is built:&lt;br /&gt;
 $ cd ~/flightgear/dnc-managed&lt;br /&gt;
 $ download_and_compile.sh&lt;br /&gt;
&lt;br /&gt;
{{Note|The development version of FlightGear changes on an almost daily basis. It provides the latest features, but is not guaranteed to always work reliably. If you don't want to take the risk of finding new bugs when updating, you may prefer to use the latest stable release.}}&lt;br /&gt;
&lt;br /&gt;
==== Building the previous Long Term Stable release of FlightGear ====&lt;br /&gt;
&lt;br /&gt;
When executing &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt;, use the &amp;lt;code&amp;gt;--old-lts&amp;lt;/code&amp;gt; option to build the previous Long Term Stable release (i.e., oldish code): &lt;br /&gt;
 $ cd ~/flightgear/dnc-managed&lt;br /&gt;
 $ download_and_compile.sh --old-lts&lt;br /&gt;
(In this example, the implicitly-selected components are SIMGEAR, FGFS and DATA, as explained [[#selecting-the-components-to-work-on | above]].)&lt;br /&gt;
&lt;br /&gt;
{{Note|If you decide to use the &amp;lt;code&amp;gt;--old-lts&amp;lt;/code&amp;gt; option in a given directory tree, you should use it for all components in that directory tree (SIMGEAR, FGFS, DATA, etc.). Running &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; in a given directory with the &amp;lt;code&amp;gt;--old-lts&amp;lt;/code&amp;gt; option for some components and not for others is not supported.}}&lt;br /&gt;
&lt;br /&gt;
=== Overriding the source repository or branch for a component ===&lt;br /&gt;
&lt;br /&gt;
This section shows how to override the location and/or branch from which a given component will be downloaded.&lt;br /&gt;
&lt;br /&gt;
{{Warning|The rest of this section is for people who know what they are doing. Don't use the following unless you trust the person who publishes the repository and have good reasons to believe that it has been kept up-to-date.}}&lt;br /&gt;
&lt;br /&gt;
==== A short example ====&lt;br /&gt;
&lt;br /&gt;
Let's start with an example to make it easier to understand to following paragraphs. Suppose we want to build the current stable release of FlightGear, linked against an [[OpenSceneGraph]] library whose source code is to be retrieved from branch &amp;lt;tt&amp;gt;fgfs-osg-36-2&amp;lt;/tt&amp;gt; of the Git repository located at [https://gitlab.com/flightgear/openscenegraph.git https://gitlab.com/flightgear/openscenegraph.git] (this is actually the default in September 2024). Since the default protocol used when &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; clones a repository is [https://en.wikipedia.org/wiki/HTTPS HTTPS], this can be done with&lt;br /&gt;
 download_and_compile.sh --cleanup -s \&lt;br /&gt;
 --override-repo OSG=GitLab:gitlab.com/flightgear/openscenegraph.git \&lt;br /&gt;
 --component-branch OSG=fgfs-osg-36-2 SIMGEAR FGFS DATA OSG&lt;br /&gt;
&lt;br /&gt;
==== The site name ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; uses case-insensitive short names such as &amp;lt;tt&amp;gt;GitLab&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;GitHub&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;SourceForge&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;gitlab.kitware.com&amp;lt;/tt&amp;gt; as keys in order to identify the settings describing where and how a given component will be initially fetched (these settings are effective at clone time; later updates simply use the settings recorded in the local repository). These names are referred to as ''site'' in the output of &amp;lt;code&amp;gt;download_and_compile.sh --help&amp;lt;/code&amp;gt;, in particular in the &amp;lt;tt&amp;gt;--git-clone-site-params&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;--override-repo&amp;lt;/tt&amp;gt; options we'll present below. These ''site'' keys are simply identifier strings; they are not used in the DNS queries.&lt;br /&gt;
&lt;br /&gt;
==== The protocol ====&lt;br /&gt;
&lt;br /&gt;
Current &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; (from December 2022) fetches the source code of most components from Git repositories (earlier versions used Subversion for some components); a few non-core components (currently [[FGo!]] and [[OpenRadar]]) are fetched using &amp;lt;tt&amp;gt;wget&amp;lt;/tt&amp;gt; and are out-of-scope for this section.&lt;br /&gt;
&lt;br /&gt;
The default protocol used by &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; when cloning a Git repository is [https://en.wikipedia.org/wiki/HTTPS HTTPS]. This can be overridden using the &amp;lt;tt&amp;gt;--git-clone-default-proto&amp;lt;/tt&amp;gt; option. In other words, the default is &amp;lt;tt&amp;gt;--git-clone-default-proto=https&amp;lt;/tt&amp;gt; (the protocol name is case-insensitive). Other possibilities for the protocol are &amp;lt;tt&amp;gt;git&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;ssh&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{Warning|The &amp;lt;tt&amp;gt;git&amp;lt;/tt&amp;gt; protocol doesn't protect against man-in-the-middle attacks; use at your own risk! Unfortunately, “clever” people often recommend it on the forum without mentioning its downsides.}}&lt;br /&gt;
&lt;br /&gt;
Using the &amp;lt;tt&amp;gt;ssh&amp;lt;/tt&amp;gt; protocol as the argument of &amp;lt;tt&amp;gt;--git-clone-default-proto&amp;lt;/tt&amp;gt; has little use, because in general you'll want to specify a particular username when using SSH and this username is likely not to be the same for all components you intend to clone via SSH (right, &amp;lt;tt&amp;gt;~/.ssh/config&amp;lt;/tt&amp;gt; can be used to automatically provide a site-dependent username). That is why &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; offers the &amp;lt;tt&amp;gt;--git-clone-site-params&amp;lt;/tt&amp;gt; option.&lt;br /&gt;
&lt;br /&gt;
==== Site-specific settings ====&lt;br /&gt;
&lt;br /&gt;
Using&lt;br /&gt;
 --git-clone-site-params ''SITE''=''PROTOCOL''[:''USERNAME'']&lt;br /&gt;
you can tell &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; that every component fetched from ''SITE'' should be cloned with the specified protocol and username (allowed protocols are &amp;lt;tt&amp;gt;https&amp;lt;/tt&amp;gt;, &amp;lt;tt&amp;gt;ssh&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;git&amp;lt;/tt&amp;gt;).&lt;br /&gt;
&lt;br /&gt;
{{Note|In case you have several repositories at a given site (say, GitHub) and need to use different SSH usernames for these repositories, you can use different site names:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
--override-repo COMPONENT_A=GitHubA:ADDRESS_A&lt;br /&gt;
--git-clone-site-params GitHubA=ssh:userA&lt;br /&gt;
--override-repo COMPONENT_B=GitHubB:ADDRESS_B&lt;br /&gt;
--git-clone-site-params GitHubB=ssh:userB&amp;lt;/pre&amp;gt;&lt;br /&gt;
Here, the site names are &amp;lt;tt&amp;gt;GitHubA&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;GitHubB&amp;lt;/tt&amp;gt;; the &amp;lt;tt&amp;gt;--override-repo&amp;lt;/tt&amp;gt; option will be presented below.&lt;br /&gt;
&lt;br /&gt;
By default, &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; case-insensitively uses the &amp;lt;tt&amp;gt;GitLab&amp;lt;/tt&amp;gt; (resp. &amp;lt;tt&amp;gt;SourceForge&amp;lt;/tt&amp;gt;) site name to identify the settings used when cloning a repository from gitlab.com (resp. git.code.sf.net). Therefore, the settings for GitHubA and GitHubB in this example would only apply to components ''c'' for which --override-repo ''c''&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;GitHubA:... or --override-repo ''c''&amp;lt;nowiki&amp;gt;=&amp;lt;/nowiki&amp;gt;GitHubB:... has been specified.}}&lt;br /&gt;
&lt;br /&gt;
==== Component-specific settings ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;tt&amp;gt;--override-repo&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;--component-branch&amp;lt;/tt&amp;gt; options allow one to override the default settings used by &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; for cloning the repository corresponding to the specified component (they only apply to components whose source code is retrieved with Git). The syntax of these options is&lt;br /&gt;
 --override-repo ''COMPONENT''=''SITE'':''ADDRESS''&lt;br /&gt;
and&lt;br /&gt;
 --component-branch ''COMPONENT''=''BRANCH''&lt;br /&gt;
In this syntax:&lt;br /&gt;
* ''COMPONENT'' represents the name of a component for &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; (e.g., &amp;lt;tt&amp;gt;SIMGEAR&amp;lt;/tt&amp;gt;—see [[#List of available components|List of available components]]);&lt;br /&gt;
* ''ADDRESS'' is something like &amp;lt;tt&amp;gt;gitlab.com/flightgear/simgear.git&amp;lt;/tt&amp;gt; (don't include any &amp;lt;tt&amp;gt;protocol://&amp;lt;/tt&amp;gt; part in ''ADDRESS'');&lt;br /&gt;
* ''BRANCH'' should be the name of an existing branch of the Git repository hosted at ''ADDRESS'';&lt;br /&gt;
* ''SITE'' is a string used as a key in a mapping; &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; uses it to find out how to connect to ''ADDRESS'' in order to clone the repository for ''COMPONENT'' (see [[#Site-specific settings|Site-specific settings]]).&lt;br /&gt;
See the [[#A short example|above example]] for a concrete example where these options are used.&lt;br /&gt;
&lt;br /&gt;
{{Note|The argument of any long option of &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; that takes an argument may be introduced immediately after the option name using an equal sign. However, in the above cases, I find this way a bit confusing because the option value ''also'' uses an equal sign as separator. Hence the above use of separate command arguments: one for the option name, one for its argument.}}&lt;br /&gt;
&lt;br /&gt;
=== Passing custom arguments to CMake ===&lt;br /&gt;
&lt;br /&gt;
Sometimes, when building a program, you may want to enable a feature that is not enabled by default, or disable a feature that is enabled by default. With recent versions of &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; (October 2020 or later), this can be done for SimGear and FlightGear using the &amp;lt;code&amp;gt;--sg-cmake-arg&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;--fg-cmake-arg&amp;lt;/code&amp;gt; options (the environment variables &amp;lt;tt&amp;gt;SG_CMAKEARGS&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;FG_CMAKEARGS&amp;lt;/tt&amp;gt; are still supported, but they don't allow one to pass arguments containing spaces). For instance, in order to link SimGear with the system Expat library, you can do:&lt;br /&gt;
 $ download_and_compile.sh --sg-cmake-arg='-DSYSTEM_EXPAT=ON' SIMGEAR&lt;br /&gt;
Similarly, disabling HID-based input when building FlightGear can be achieved this way:&lt;br /&gt;
 $ download_and_compile.sh --fg-cmake-arg='-DENABLE_HID_INPUT=OFF' FGFS&lt;br /&gt;
&lt;br /&gt;
{{Note|Such options are typically defined in &amp;lt;tt&amp;gt;CMakeLists.txt&amp;lt;/tt&amp;gt; files, for example {{simgear source&lt;br /&gt;
| path = CMakeLists.txt&lt;br /&gt;
| text = here&lt;br /&gt;
}} for SimGear and {{flightgear source&lt;br /&gt;
| path = CMakeLists.txt&lt;br /&gt;
| text = here&lt;br /&gt;
}} for FlightGear.}}&lt;br /&gt;
&lt;br /&gt;
This can be useful, for instance, to work around bugs in a part of SimGear or FlightGear that you don't need, but causes a build or runtime failure (see {{forum link|t=35740|text=here}} for example). This is often convenient when using the development version of FlightGear, but doesn't mean such bugs shouldn't be reported!&lt;br /&gt;
&lt;br /&gt;
If you have several such options to pass, just use &amp;lt;code&amp;gt;--sg-cmake-arg&amp;lt;/code&amp;gt; and/or &amp;lt;code&amp;gt;--fg-cmake-arg&amp;lt;/code&amp;gt; several times:&lt;br /&gt;
 $ download_and_compile.sh --fg-cmake-arg='-DENABLE_SWIFT=ON' \&lt;br /&gt;
                           --fg-cmake-arg='-DENABLE_HID_INPUT=OFF' FGFS&lt;br /&gt;
It is even possible to pass arguments containing spaces to CMake, as in:&lt;br /&gt;
 $ download_and_compile.sh \&lt;br /&gt;
     --sg-cmake-arg='-DCMAKE_CXX_FLAGS=-Wno-deprecated-declarations -Wall' \&lt;br /&gt;
     SIMGEAR&lt;br /&gt;
(just a silly example to show a working syntax) or:&lt;br /&gt;
 $ download_and_compile.sh \&lt;br /&gt;
     --fg-cmake-arg=&amp;quot;-DCMAKE_CXX_FLAGS=$(pkg-config --cflags gl)&amp;quot; \&lt;br /&gt;
     FGFS&lt;br /&gt;
Note the use of double-quotes here to enable the &amp;lt;code&amp;gt;$(...)&amp;lt;/code&amp;gt; command substitution.&lt;br /&gt;
&lt;br /&gt;
Using the (half-deprecated) environment variables &amp;lt;tt&amp;gt;SG_CMAKEARGS&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;FG_CMAKEARGS&amp;lt;/tt&amp;gt;, it is also possible to define CMake arguments in a single place that are going to be used for both SimGear and FlightGear. However, this technique doesn't allow one to pass arguments containing spaces to CMake.&lt;br /&gt;
 $ export SG_CMAKEARGS='-DSYSTEM_EXPAT=ON'&lt;br /&gt;
 $ export FG_CMAKEARGS='-DENABLE_SWIFT=ON -DENABLE_HID_INPUT=OFF'&lt;br /&gt;
 $ download_and_compile.sh&lt;br /&gt;
&lt;br /&gt;
=== Seeing the compilation commands run by Make ===&lt;br /&gt;
&lt;br /&gt;
As a simple application of the previous section, the following options are often useful. When passed to &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt;, these options cause the compilation commands run via Make to be printed on the terminal and recorded in the compilation_log.txt file:&lt;br /&gt;
  --sg-cmake-arg='-DCMAKE_VERBOSE_MAKEFILE=1' \&lt;br /&gt;
  --fg-cmake-arg='-DCMAKE_VERBOSE_MAKEFILE=1'&lt;br /&gt;
(the backslash is unneeded if you put both options on the same line). Passing the value 0 instead of 1 would explicitly request the default, non-verbose behavior.&lt;br /&gt;
&lt;br /&gt;
=== Launching FlightGear ===&lt;br /&gt;
&lt;br /&gt;
When using &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt;, apart from those installed with the package manager, the FlightGear dependencies (which are typically libraries) are not installed system-wide but under the directory from which &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; was run. This makes it possible to easily use, for instance, different [[OpenSceneGraph]], [[SimGear]] and FlightGear versions on a single system—e.g., for testing purposes—but also to have separate build trees (optimized/debug). This is also why you either need to set LD_LIBRARY_PATH to run the built programs, or simply use the scripts created by &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; in the directory where it is run, such as &amp;lt;tt&amp;gt;run_fgfs.sh&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;run_fgfs_debug.sh&amp;lt;/tt&amp;gt;: these scripts automatically set up the required environment variables according to your build settings before firing the desired program (e.g., &amp;lt;tt&amp;gt;fgfs&amp;lt;/tt&amp;gt;) with the arguments you provided. &lt;br /&gt;
&lt;br /&gt;
Therefore, the simplest way to run a FlightGear program built by &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; is to launch the &amp;lt;tt&amp;gt;run_fgfs.sh&amp;lt;/tt&amp;gt; script that &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; created in the directory from which it was run, for example:&lt;br /&gt;
 $ cd ~/flightgear/dnc-managed&lt;br /&gt;
 $ ./run_fgfs.sh --launcher&lt;br /&gt;
&lt;br /&gt;
{{Note|&amp;lt;code&amp;gt;./run_fgfs.sh --launcher&amp;lt;/code&amp;gt; starts FlightGear with its built-in launcher. If you just do &amp;lt;code&amp;gt;./run_fgfs.sh&amp;lt;/code&amp;gt;, FlightGear will be started without any launcher, at the default airport and with the default aircraft.}}&lt;br /&gt;
&lt;br /&gt;
In order to start FlightGear without any launcher, at a given airport (say, [https://en.wikipedia.org/wiki/Paro_Airport Paro airport], whose ICAO code is VQPR) and with a chosen aircraft, you can do:&lt;br /&gt;
 $ cd ~/flightgear/dnc-managed&lt;br /&gt;
 $ ./run_fgfs.sh --airport=VQPR --aircraft=dhc6&lt;br /&gt;
Actually, the directory change is not needed, we only gave it here for readability. Therefore, the following single command does the same:&lt;br /&gt;
 $ ~/flightgear/dnc-managed/run_fgfs.sh --airport=VQPR --aircraft=dhc6&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;span id=&amp;quot;avoiding-multiple-downloads-of-fgdata&amp;quot;&amp;gt;&amp;lt;/span&amp;gt; Avoiding multiple downloads of FGData ===&lt;br /&gt;
&lt;br /&gt;
Some people use &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; to maintain several directory trees such as the tree starting at &amp;lt;tt&amp;gt;~/flightgear/dnc-managed&amp;lt;/tt&amp;gt; in [[#getting-started-with-download-and-compile-sh|Getting started with &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt;]] (this can be useful if you want to have one tree with programs compiled in Release mode and another tree where they are built in Debug mode, for instance). This can easily be done by running &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; in each of the directories. But since [[FGData]] is so large, it may be tempting to share a single instance of this repository among several trees. This is not officially supported, but apparently can be made to work with symbolic links.&lt;br /&gt;
&lt;br /&gt;
Let's show how this can be done on an example. Suppose your master copy of FGData is in &amp;lt;tt&amp;gt;~/flightgear/dnc-managed/install/flightgear/fgdata&amp;lt;/tt&amp;gt;. Then the following appears to work:&lt;br /&gt;
 $ mkdir -p ~/flightgear/other-dnc-managed-tree/install/flightgear&lt;br /&gt;
 $ cd ~/flightgear/other-dnc-managed-tree/install/flightgear&lt;br /&gt;
 $ ln -s ../../../dnc-managed/install/flightgear/fgdata&lt;br /&gt;
 $ cd ~/flightgear/other-dnc-managed-tree&lt;br /&gt;
 $ download_and_compile.sh&lt;br /&gt;
&lt;br /&gt;
The last of these commands will use and update the FGData repository present in &amp;lt;tt&amp;gt;~/flightgear/dnc-managed/install/flightgear/fgdata&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{{Warning|This can only work simply if all trees that share a given FGData repository are from the same release (e.g., current stable or development). Running a “stable“ FlightGear with FGData from the ''next'' branch or the other way round, a development version of FlightGear with FGData from a release branch, doesn't work—and FlightGear should tell you when you start it in such a situation.&lt;br /&gt;
&lt;br /&gt;
That said, people comfortable with Git can check out the correct FGData branch before building or starting FlightGear, for instance:&lt;br /&gt;
 $ cd /path/to/fgdata &amp;amp;&amp;amp; git checkout release/2019.1&lt;br /&gt;
or&lt;br /&gt;
 $ cd /path/to/fgdata &amp;amp;&amp;amp; git checkout next&lt;br /&gt;
So, this is possible but somewhat acrobatic. You've been warned.}}&lt;br /&gt;
&lt;br /&gt;
Note: there is a [[Avoiding multiple downloads of FGData on Linux|wiki article about this subject]], but it is severely outdated as of April 2019.&lt;br /&gt;
&lt;br /&gt;
== Additional programs ==&lt;br /&gt;
&lt;br /&gt;
{{Note|In this section, we assume you've read and followed the advice given in [[#getting-started-with-download-and-compile-sh|Getting started with &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt;]].}}&lt;br /&gt;
&lt;br /&gt;
If you wish to get other programs (precisely: download, build and install them), you need to launch &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; with the desired component names as arguments. For instance:&lt;br /&gt;
 $ cd ~/flightgear/dnc-managed&lt;br /&gt;
 $ download_and_compile.sh SIMGEAR FGFS DATA OSG&lt;br /&gt;
&lt;br /&gt;
See [[#list-of-available-components|above]] for the list of available components.&lt;br /&gt;
&lt;br /&gt;
=== TerraGear ===&lt;br /&gt;
&lt;br /&gt;
Run &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; with the TERRAGEAR component in order to build and install the [[TerraGear]] terrain building toolchain:&lt;br /&gt;
 $ cd ~/flightgear/dnc-managed&lt;br /&gt;
 $ download_and_compile.sh TERRAGEAR&lt;br /&gt;
&lt;br /&gt;
This creates the following scripts in &amp;lt;tt&amp;gt;~/flightgear/dnc-managed&amp;lt;/tt&amp;gt;:&lt;br /&gt;
* &amp;lt;tt&amp;gt;run_genapts850.sh&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;run_ogr-decode.sh&amp;lt;/tt&amp;gt;&lt;br /&gt;
* &amp;lt;tt&amp;gt;run_tg-construct.sh&amp;lt;/tt&amp;gt;&lt;br /&gt;
These scripts themselves run the corresponding TerraGear tools, as expected.&lt;br /&gt;
&lt;br /&gt;
=== TerraGear GUI ===&lt;br /&gt;
&lt;br /&gt;
[[TerraGear GUI]] is a graphical interface for [[TerraGear]] written with the Qt toolkit (still Qt 4 in 2019, but it works). In order to install it, run &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; with the TERRAGEARGUI component:&lt;br /&gt;
 $ cd ~/flightgear/dnc-managed&lt;br /&gt;
 $ download_and_compile.sh TERRAGEARGUI&lt;br /&gt;
This will create a &amp;lt;tt&amp;gt;run_terrageargui.sh&amp;lt;/tt&amp;gt; script in &amp;lt;tt&amp;gt;~/flightgear/dnc-managed&amp;lt;/tt&amp;gt;, and also a default configuration file &amp;lt;tt&amp;gt;~/.config/TerraGear/TerraGearGUI.conf&amp;lt;/tt&amp;gt;, unless you already have one. This default configuration file contains paths to the TerraGear and [[$FG_ROOT]] directories, assuming you have installed the TERRAGEAR and DATA components.&lt;br /&gt;
&lt;br /&gt;
To run TerraGear GUI:&lt;br /&gt;
 $ cd ~/flightgear/dnc-managed&lt;br /&gt;
 $ ./run_terrageargui.sh&lt;br /&gt;
&lt;br /&gt;
=== FGCom ===&lt;br /&gt;
&lt;br /&gt;
{{Note|[[FGCom]] has been integrated into FlightGear long ago, therefore the following is not needed in general.}}&lt;br /&gt;
&lt;br /&gt;
[[FGCom]] is the system used by FlightGear to simulate radio communications between users. It is automatically built and installed when you tell &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; to take care of the FGFS component. You can launch the standalone FGCom program by using the &amp;lt;tt&amp;gt;run_fgcom.sh&amp;lt;/tt&amp;gt; script:&lt;br /&gt;
 $ cd ~/flightgear/dnc-managed&lt;br /&gt;
 $ ./run_fgcom.sh&lt;br /&gt;
&lt;br /&gt;
=== FGRun ===&lt;br /&gt;
&lt;br /&gt;
{{Note|As of 2019, FGRun has been superseded by the [[FlightGear Qt launcher|FlightGear built-in launcher]]. The built-in launcher is the most actively maintained launcher for FlightGear. Other launchers are [[FFGo]] and [[FGX|FGx]].}}&lt;br /&gt;
&lt;br /&gt;
[[File:fgrun-page2.jpg|thumb|right]]&lt;br /&gt;
Before FlightGear had its built-in launcher (the one you get with &amp;lt;code&amp;gt;run_fgfs.sh --launcher&amp;lt;/code&amp;gt;), many users found comfortable having FlightGear launched by the graphical utility [[Fgrun|FGRun]]. This program is built and installed when &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; is run with the FGRUN component. You then have to launch the &amp;lt;tt&amp;gt;run_fgrun.sh&amp;lt;/tt&amp;gt; command, for example:&lt;br /&gt;
 $ cd ~/flightgear/dnc-managed&lt;br /&gt;
 $ ./run_fgrun.sh&lt;br /&gt;
&lt;br /&gt;
FGRun will save its settings in &amp;lt;tt&amp;gt;~/.fltk/flightgear.org/fgrun.prefs&amp;lt;/tt&amp;gt;. You may want to save copies of the preferences customized for stable and next.&lt;br /&gt;
&lt;br /&gt;
== Options ==&lt;br /&gt;
&lt;br /&gt;
=== Release selection ===&lt;br /&gt;
&lt;br /&gt;
* Build the latest stable release: &amp;lt;code&amp;gt;-s&amp;lt;/code&amp;gt;&lt;br /&gt;
* Build the latest Long Term Stable release: &amp;lt;code&amp;gt;--lts&amp;lt;/code&amp;gt;&lt;br /&gt;
* Build the previous Long Term Stable release: &amp;lt;code&amp;gt;--old-lts&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Long Term Stable (&amp;lt;code&amp;gt;--lts&amp;lt;/code&amp;gt;) is supposed to yield a more stable setup than what you would obtain with option &amp;lt;code&amp;gt;-s&amp;lt;/code&amp;gt;, however it will generally be older. Both of these options are suitable for users.&lt;br /&gt;
&lt;br /&gt;
If you pass none of &amp;lt;code&amp;gt;-s&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;--lts&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;--old-lts&amp;lt;/code&amp;gt; in a &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; invocation, you'll build the the ''next'' suite, which contains the development version of FlightGear. The corresponding FlightGear code will be very recent but may well be unstable—this is particularly the case starting from July 2020. This is therefore mostly intended for developers.&lt;br /&gt;
&lt;br /&gt;
=== Skipping most prompts ===&lt;br /&gt;
&lt;br /&gt;
For some important things, &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; asks for confirmation in order to be sure that you are well informed about what will be done. When you have a good understanding of these informations, you may want to use the &amp;lt;code&amp;gt;--non-interactive&amp;lt;/code&amp;gt; option in order to suppress these prompts (technically, this causes the default answer to be automatically used).&lt;br /&gt;
&lt;br /&gt;
=== Cleaning built and installed files ===&lt;br /&gt;
&lt;br /&gt;
Option &amp;lt;code&amp;gt;--cleanup&amp;lt;/code&amp;gt; causes &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; to remove everything that was built and installed in the directory it is run from. The Git repositories will not be removed, so this is good if you want to restart a compilation from a clean state.&lt;br /&gt;
&lt;br /&gt;
If you use &amp;lt;code&amp;gt;--cleanup&amp;lt;/code&amp;gt; without specifying any component, only this removal will be done (nothing will be compiled nor installed). Otherwise, the usual rules concerning components apply.&lt;br /&gt;
&lt;br /&gt;
=== Multicore acceleration ===&lt;br /&gt;
&lt;br /&gt;
Passing option &amp;lt;code&amp;gt;-j x&amp;lt;/code&amp;gt; to &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; (where ''x'' is the number of your CPU cores you wish to assign to the job) will considerably speed up the compilation steps. Passing &amp;lt;code&amp;gt;-j$(nproc)&amp;lt;/code&amp;gt; is a convenient way to automatically use all available cores.&lt;br /&gt;
&lt;br /&gt;
=== Advanced options ===&lt;br /&gt;
&lt;br /&gt;
* Build a release version: &amp;lt;code&amp;gt;-b Release&amp;lt;/code&amp;gt;&lt;br /&gt;
* Build a version that should run as fast as a release build, yet has debug information that can be used to post backtraces: &amp;lt;code&amp;gt;-b RelWithDebInfo&amp;lt;/code&amp;gt; (this is the default)&lt;br /&gt;
* Build a full debug version for very complete bug reporting: &amp;lt;code&amp;gt;-b Debug&amp;lt;/code&amp;gt;&lt;br /&gt;
* Skip download of distro packages (i.e., by default: &amp;lt;tt&amp;gt;apt-get install ...&amp;lt;/tt&amp;gt;): &amp;lt;code&amp;gt;-p n&amp;lt;/code&amp;gt;&lt;br /&gt;
* Skip retrieving of component downloads and updates (which typically use Git or wget): &amp;lt;code&amp;gt;-d n&amp;lt;/code&amp;gt;&lt;br /&gt;
* Skip the configure step (like running [https://cmake.org/ CMake] or [https://www.gnu.org/software/autoconf/ autoconf]'s &amp;lt;tt&amp;gt;./configure&amp;lt;/tt&amp;gt;): &amp;lt;code&amp;gt;-r n&amp;lt;/code&amp;gt;&lt;br /&gt;
* Skip compilation of programs: &amp;lt;code&amp;gt;-c n&amp;lt;/code&amp;gt;&lt;br /&gt;
* Build with compositor: &amp;lt;code&amp;gt;--compositor&amp;lt;/code&amp;gt;&lt;br /&gt;
* Force the use of a particular branch for a given component: &amp;lt;code&amp;gt;--component-branch ''COMPONENT=BRANCH''&amp;lt;/code&amp;gt; (e.g., &amp;lt;code&amp;gt;--component-branch OSG=OpenSceneGraph-3.6&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;--component-branch FGFS=next&amp;lt;/code&amp;gt;, etc.—but remember that components FGFS, SIMGEAR and DATA must ''always'' be in sync). See [[#Component-specific settings|Component-specific settings]] for details.&lt;br /&gt;
* Override the repository from which a given component is initially fetched: &amp;lt;code&amp;gt;--override-repo ''COMPONENT''=''SITE'':''ADDRESS''&amp;lt;/code&amp;gt; (see [[#Component-specific settings|Component-specific settings]]).&lt;br /&gt;
* Generate build.ninja files and build using Ninja: &amp;lt;code&amp;gt;-G Ninja&amp;lt;/code&amp;gt;&lt;br /&gt;
* Run CMake in verbose mode: &amp;lt;code&amp;gt;--verbose&amp;lt;/code&amp;gt; (this shows compilation commands)&lt;br /&gt;
&lt;br /&gt;
For example, if you are a developer and wish to quickly recompile and reinstall only your own modifications for FlightGear, you can do this:&lt;br /&gt;
 $ download_and_compile.sh -j$(nproc) -p n -d n -r n FGFS&lt;br /&gt;
&lt;br /&gt;
Note that this is the same as:&lt;br /&gt;
 $ download_and_compile.sh -j$(nproc) -pn -dn -rn FGFS&lt;br /&gt;
&lt;br /&gt;
This command will only rebuild modified files and reinstall FlightGear. Note that depending on the kind of changes you made, reconfiguring and thus dropping the &amp;lt;code&amp;gt;-rn&amp;lt;/code&amp;gt; option may be necessary, though (this is the case in particular if you added or removed C++ files).&lt;br /&gt;
&lt;br /&gt;
=== ccache ===&lt;br /&gt;
[https://ccache.dev/ ccache] is a compiler cache that enormously speeds up subsequent recompilations (compilation times are often divided by a factor 6 or more). SimGear and FlightGear 2024.1 or later perform &amp;lt;tt&amp;gt;ccache&amp;lt;/tt&amp;gt;-enabled builds when &amp;lt;code&amp;gt;-DENABLE_CCACHE=ON&amp;lt;/code&amp;gt; is passed to [https://cmake.org/ CMake]. For &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; users, there are several ways to do this.&lt;br /&gt;
&lt;br /&gt;
The simplest way is to pass &amp;lt;code&amp;gt;--enable-ccache&amp;lt;/code&amp;gt; to &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt;. This has an effect when processing components such as &amp;lt;tt&amp;gt;SIMGEAR&amp;lt;/tt&amp;gt; and &amp;lt;tt&amp;gt;FGFS&amp;lt;/tt&amp;gt;; other components may support the option or ignore it. Using this option is equivalent to passing &amp;lt;code&amp;gt;--cmake-arg ALL=&amp;quot;-DENABLE_CCACHE=ON&amp;quot;&amp;lt;/code&amp;gt; to &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt;. This causes the script to pass &amp;lt;code&amp;gt;-DENABLE_CCACHE=ON&amp;lt;/code&amp;gt; to all CMake-based components that are processed. For those that don't support this option, you'll see a harmless warning that you can safely ignore:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CMake Warning:&lt;br /&gt;
  Manually-specified variables were not used by the project:&lt;br /&gt;
&lt;br /&gt;
    ENABLE_CCACHE&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Finally, if you prefer, you can pass &amp;lt;code&amp;gt;-DENABLE_CCACHE=ON&amp;lt;/code&amp;gt; to specific components using for instance&lt;br /&gt;
 --cmake-arg SIMGEAR=&amp;quot;-DENABLE_CCACHE=ON&amp;quot;&lt;br /&gt;
and/or&lt;br /&gt;
 --cmake-arg FGFS=&amp;quot;-DENABLE_CCACHE=ON&amp;quot;&lt;br /&gt;
This results in longer command lines than the previous methods but allows one to avoid the warning, if it bothers you.&lt;br /&gt;
&lt;br /&gt;
{{Note|&amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt; automatically installs &amp;lt;tt&amp;gt;ccache&amp;lt;/tt&amp;gt; if its seems required and package installation hasn't been disabled. Otherwise, you can install it yourself using &amp;lt;code&amp;gt;apt install ccache&amp;lt;/code&amp;gt; before using &amp;lt;code&amp;gt;--enable-ccache&amp;lt;/code&amp;gt; or similar.}}&lt;br /&gt;
&lt;br /&gt;
== Optimus technology ==&lt;br /&gt;
In some cases, if your computer has a GPU with Optimus technology, you may need a dedicated script in order to make FlightGear run with the powerful GPU. FlightGear will print the selected GPU on startup, if it selects the integrated one you may need to perform these steps.&lt;br /&gt;
&lt;br /&gt;
After having installed required tools (Bumblebee) you just need to run this command line in your FlightGear installation directory (where you executed &amp;lt;tt&amp;gt;download_and_compile.sh&amp;lt;/tt&amp;gt;):&lt;br /&gt;
 $ sed  's|\./fgfs|optirun ./fgfs|' run_fgfs.sh &amp;gt; run_fgfs_optirun.sh &amp;amp;&amp;amp; chmod +x run_fgfs_optirun.sh&lt;br /&gt;
Now you can run FlightGear with &amp;lt;code&amp;gt;./run_fgfs_optirun.sh&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The same can be done for the [[FlightGear_Launch_Control|FGRun]] launcher:&lt;br /&gt;
 $ sed  's|\./fgrun|optirun ./fgrun|' run_fgrun.sh &amp;gt; run_fgrun_optirun.sh &amp;amp;&amp;amp; chmod +x run_fgrun_optirun.sh&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* {{fgmeta source&lt;br /&gt;
| path = fg-from-scratch&lt;br /&gt;
| text = fg-from-scratch&lt;br /&gt;
}};&lt;br /&gt;
* [[Fedora Packages and Compiling]];&lt;br /&gt;
* [[Superbuild]];&lt;br /&gt;
* [http://geoffmclane.com/fg/fgfs-052.htm Another script] for building FlightGear and all its dependencies in an automated fashion. The page seems a bit oldish, though (as of 2019).&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Building from source]]&lt;br /&gt;
&lt;br /&gt;
[[fr:Script de compilation sous Linux Debian/Ubuntu]]&lt;br /&gt;
[[nl:Compileren met een Script op Linux Debian/Ubuntu]]&lt;/div&gt;</summary>
		<author><name>Gckrol</name></author>
	</entry>
</feed>