Jump to: navigation, search

Scripted Compilation on Linux Debian/Ubuntu

40,091 bytes added, 17:22, 4 October 2019
add prerequisites section since dnc doesn't automatically pull these needed tools if they are not already installed.
<tt></tt> is a [ Bash] script that takes care of downloading and compiling FlightGear and related software from the Git their source code repositories with just one command execution<ref name="just-one-command">Due to technical problems on the [ SourceForge] side, this is currently only true once you have an [[FGData]] clone. See [[User:Rominet|here]] for details.</ref> for both 32-bit and 64-bit [ Debian]-based systems (Debian, [ Ubuntu], [ Devuan], [ Linux Mint], etc.). Pre-existing installed versions (if any) of FlightGear the software installed by <tt></tt> are not touched at all since the script downloads, builds and installs everything under the directory in which it is launched. You can choose between building all or only specific tools the particular components to download, build and applications. For RedHat-based systems such as Fedora and CentOS, you may want to check out [[CentOS]]install.
By defaultUnless told not to do so, <tt></tt> installs most dependencies packages with <tt>apt-get</tt> run under <tt>sudo</tt>.<ref name="note-For this reason, it is primarily useful onDebian-changing-how-packages-are-installed">This can be changed with options <code>--based distributions. However, if one disables package-manager</code> and installation (using <code>--sudopn</code>, or completely turned off with option <code>-pn</code> (see the output of <code> --helpsudo=echo</code> for ) and installs the list of available options).</ref> Other corresponding dependenciesoneself, either because they aren't available in the standard APT repositories, or because it was explicitly requested using the non-option arguments of <tt></tt>, are downloaded and compiled on the fly (this can might be the case for [[PLIB]], [[Simgear]] and [[OpenSceneGraph]], for instance—depending useful on the arguments passed to <tt></tt>)other distributions as well.
For hints on using a RPM<tt>rpm</tt>-based distribution like distributions such as Redhat, Fedora and CentOS, please see [[CentOS]]. Please also see [[Superbuild]].
Please also see [[Superbuild]].== Introduction ==
=== Update Available ===<tt></tt> is a [ Bash] script written for [ Debian]-derived distributions ([ Ubuntu], [ Devuan], [ Linux Mint], etc.). Its purpose is to automatically install dependencies using the package manager, then build and install FlightGear-related programs.
The latest version of By default, <tt></tt> can be obtained [https:installs most dependencies with <tt>apt-get</tt> run under <tt>sudo</sourceforgett>.net<ref name="disabling-installation-of-dependencies-via-package-manager">If you think you already have the dependencies, this installation can be disabled either by using option <code>-pn</pcode> or by passing option <code>--sudo=echo</flightgearcode> (the latter results in printing the <tt>apt-get</fgmeta/ci/next/treett> command line without running it).</ref> Other dependencies, either because they aren't available in the standard APT repositories, or because of non-option arguments passed to <tt> here]</tt>, however there are advantages getting it from an downloaded and compiled on the fly (this can be the case for [ FGMeta[PLIB] clone as explained ], [[User:Rominet#Getting_download_and_compile.sh_the_.E2.80.9Cright_way.E2.80.9D|hereSimgear]]. Contents should be moved from and [[User:Rominet|thereOpenSceneGraph]] , for instance—it all depends on the arguments passed to this page; significant parts of what follows on this page haven't been updated recentlythe script).
=== Cut to <tt></tt> works in the Chasedirectory it is run from: for apart from dependencies installed via the package manager, all programs built by <tt></tt> are installed under the <tt>install</tt> subdirectory of the directory from which the script was run. In other words, installation of programs by <tt></tt> is clean, very easy to undo and doesn't interfere with other programs on the impatient ===system.
Beware: It is possible to manage several directory trees with the following<tt></tt>; as far as it is concerned, you such directory trees are likely to encounter problems when cloning [[FGData]]: read just abovecompletely independent from each other. For instance, if you run <tt></tt> in <tt>dir1</tt> and <tt>dir2</tt>, the programs installed under <tt>dir1</tt> won't “see” those installed under <tt>dir2</tt>, and vice versa.
cd Apart from its main purpose, <your working directory for building FlightGeartt> wget -O </tt> can be used to find hopefully up-to-date build-dependency information for FlightGear and related software. You would do so by inspecting [ chmod +x download_and_compilethe script] at the point where it installs packages.<ref name="note-inspecting-download-and-compile-sh mkdir -p stable mkdir to-p next cd stable ..gather-build-dependency-information">Look for strings such as <tt>zlib1g-dev</ tt>, <tt>libglew-j$(nproc) dev</tt> or <tt>qt5-s cd ..default</next .tt>.</ -j$(nproc) -p nref>
{{Note|With <code>-j$(nproc)</code> as above, the compilation will use all cores available on your processor, which can save several hours. If you want to use, say, 4 cores, replace <code>-j$(nproc)</code> with <code>-j4</code>.}}== Prerequisites ==
=== Conversion of directory structure from earlier versions of download_and_compileBefore embarking on building your own FlightGear binaries, you must have already installed the necessary tools to compile the source code ===These preliminary tools are
Earlier versions of the script used a different directory structure. If you used the earlier version, the new script includes a section that will convert the earlier structure to the current set of directories.* build-essential* git* subversion* cmake* automake
=== Disk Space Requirements ===They can be installed quite simply by running the following command line.
As of April 2019, building FlightGear requires about 11 Gigabytes of disk space. Note that this includes downloaded source code, $ sudo apt-get install build files and the large [[FGData]] repository (about 5 Gigabytes for that one).-essential git subversion cmake automake
=== List of compiled programs ===The <tt>Once these tools are installed, the</tt> script is able to download and compile:* [[SimGear]] (”base libraries” that are part of the FlightGear project, and required)* FlightGear* [[FGData]] (base data files that are part of the FlightGear project, can be run. It will install possibly needed additional tools and required)* [https://cmakelibraries as it CMake] (in case CMake is too old in your distribution)* [[PLIB]]* [[OpenSceneGraph]]* [[FGRun]]* [[FGo!]]* [[FGX]]* [[TerraGear]]* [[TerraGear_GUI]]* [[OpenRadar]]* [[ATC-pie]]* [[FlightGear HLA support (High Level Architecture) | OpenRTI]]
(Note that OpenRTI is just an optional dependency for [[FlightGear high== <span id="disk-space-requirements-and-build-level architecture support|HLA support]]. For the time being, you should be just fine building without it. Eventually, the idea is for HLA to replace the existing MP system "></span> Disk space requirements and even increasingly distribute the FlightGear architecture such that more and more components can be more easily run in separate threads or even separate processes, possibly even on different machines. So this is going to be an important feature for professional users, using several computers and screens to create a comprehensive and immersive simulation time ==
At the momentAs of April 2019, it's probably safe to say that HLA is only building FlightGear requires about 12 [ GiB] of interest to developers and people willing to play with experimental featuresdisk space.Note that this includes downloaded source code for [[SimGear]] and FlightGear, generated build files and the large [[FGData]] repository (about 6 GiB for that one).
Each of With an Intel Core i7 860 CPU (2.80 GHz) purchased in 2009, compiling [[SimGear]] and FlightGear 2019.2 with option <code>-j8</code> takes about 14 minutes. If you don't have a fast machine and build using only one core, it may require several hours. == Download == You can get <tt></tt> {{fgmeta source| path =| text = from FGMeta }}. It is contained in the items listed [[FGMeta]] repository, which is maintained by the FlightGear developers. The script can be downloaded from the link given above corresponds , however, for easier updates and in order to have the command <code> --version</code> work as intended, it is recommended to get it as explained [[#getting-download-and-compile-sh-using-an-fgmeta-clone|below]]. In case you build stable versions of FlightGear using the <code>-s</code> option of <tt></tt>, 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 <tt></tt>]] 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 ''componentnext'' , that is, the development branch of FlightGear. == <span id="getting-started-with-download-and-compile-sh"></span> Getting started with <tt></tt> == Because of technical problems at SourceForge (cloning [[FGData]] using the https protocol usually fails), the initial setup is unfortunately more complex than it used to be. You'll be guided step by step though, so don't be afraid. Besides, once you have a complete clone of the FGData repository, all future operations will be really easy. We'll first explain how to get <tt></tt> in a way that makes it convenient to update and causes the command <code> --version</code> to work as intended (the reported “version” is a Git blob id such as <tt>6a5e4f05e2ccf27115eec58313be027b11266097</tt><ref name="note-on-download-and-compile-sh-version-being-a-Git-blob-id">This looks like, but is ''not'' a Git commit identifier. This kind of “version number” is admittedly not very pretty, but it doesn't pollute Git commits (the diffs) and is automatically updated by Git every time you update <tt></tt> terminologythe way we present here; thus, the advantages compensate for the ugliness. Components </ref>). Then we'll show how to clone the large FGData repository, and finally give instructions to get FlightGear up and running. === <span id="getting-started-with-download-and-compile-sh-notations"></span> Notations === When a command should be run as an unpriviledged user, it will be preceded by a dollar sign: $ whoami totoIn contrast, a hash sign (#) means that the command must be run with superuser privileges to achieve the desired effect: # whoami root In order to make instructions easy to understand, two directories (= folders) will be consistently used for the same purpose below:* <tt>~/flightgear/fgmeta</tt> will contain a clone of the [[FGMeta]] repository; therefore, <tt></tt> will reside in that directory;* <tt>~/flightgear/dnc-managed</tt> will be the directory from which we run <tt></tt>. In other words, with this setup, a typical sequence of commands could be: $ cd ~/flightgear/dnc-managed $ ~/flightgear/fgmeta/ SIMGEAR FGFS DATAThese are written of course just examples. The aforementioned paths are not hardwired anywhere in uppercasethe script; you are free to choose the directories you want for these purposes. === <span id="getting-download-and-compile-sh-using-an-fgmeta-clone"></span> Getting <tt></tt> the “right way” === There are several ways to obtain []. The list method described here makes it very easy to update the script and causes the command <code> --version</code> to work as intended. As explained in [[#getting-started-with-download-and-compile-sh-notations|Notations]], we want to clone the [[FGMeta]] repository in <tt>~/flightgear/fgmeta</tt>. Let's go: $ mkdir -p ~/flightgear $ cd ~/flightgear <nowiki>$ git clone</nowiki>You now have a fresh FGMeta clone in <tt>~/flightgear/fgmeta</tt> and your brand new <tt></tt> script is located in that directory. You can already try it to see the available options:<pre>$ ~/flightgear/fgmeta/ [OPTION...] [--] [COMPONENT...]Download and compile components belonging to the FlightGear ecosystem. Without any COMPONENT listed, or if ALL is specified, recompile allcomponents listed in the WHATTOBUILDALL variable. Each COMPONENT maybe one of supported ones the following words:  ALL, CMAKE, OSG, PLIB, OPENRTI, SIMGEAR, FGFS, DATA, FGRUN, FGO, FGX, OPENRADAR, ATCPIE, TERRAGEAR, TERRAGEARGUI Available options: -h, --help show this help message and exit --version print version and license information, then exit (...)</pre> === <span id="updating-download-and-compile-sh-using-an-fgmeta-clone"></span> Updating <tt></tt> === Now that you have <tt></tt> from the [[FGMeta]] repository, it is very easy to update (this assumes you didn't modify anything yourself inside <tt>~/flightgear/fgmeta</tt>!): $ cd ~/flightgear/fgmeta && git pull If you want to keep updates as easy as we just shown, it is best not to modify <tt></tt> yourself. <tt></tt> has plenty of options that usually make it unnecessary to modify the script. Just run <code> --help</code> 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 <tt></tt>, you are invited to skip to the next section. If you really, ''really'' want to modify <tt></tt> 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 <code>git status</code>), then update it with: $ cd ~/flightgear/fgmeta && git pull --rebaseThis will apply your commits on top of the latest commit of the branch that is currentlychecked out, which so far contained the official version of <tt></tt>. 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. === <span id="using-download-and-compile-sh-to-build-flightgear"></span> Building FlightGear === For the method described below, you'll need an account at [ SourceForge] (this is unfortunate, but methods that don't require such an account are either unreliable or insecure, as long as [[FGData]] can't be cloned using the <tt>https</tt> protocol). If you don't already have one, go to the [ registration page] and create an account. In all this section, we'll assume that your account name at SourceForge is ''SFusername''.* In what follows, we won't give the full path to <tt></tt> when showing commands to be run, but you should prepend it to <tt></tt> whenever you see a <tt></tt> command. For instance, if you used the same path as in [[#getting-started-with-download-and-compile-sh-notations|Notations]] and see the command: $ --helpwhat you should actually run is: $ ~/flightgear/fgmeta/ --help Apart from this harmless command, ''do not'' run other <tt></tt> commands from an arbitrary directory, in particular ''don't'' run them from <tt>~/flightgear/fgmeta</tt>. This is because '''most other <tt></tt> commands write to the current directory''' (<code> --help</code> and <code> --version</code> are safe to run from any directory, though). Of course, it is always possible to make commands shorter by setting up aliases (see tips at the end of [ this message]), by adding the directory containing <tt></tt> to your <tt>PATH</tt> or by creating a symbolink link pointing to <tt></tt> in a directory that is part of your <tt>PATH</tt>. This is not necessary, though; do it only if you feel the need (when enabled, persistent shell history is often enough for such things). {{Note|The following commands should be run from an empty directory<ref name="dedicated-directory-won-t-stay-empty-forever">Well, empty before the first time; later, <tt></tt> is going to populate it with plenty of FlightGear files and subdirectories, of course.</ref> 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 <tt>~/flightgear/dnc-managed</tt> for this purpose, in order to express that the whole directory tree is managed by <tt></tt>. This is just an example; feel free to choose another directory if you want. '''Don't run the commands from a non-dedicated directory,''' because it will be filled with files and directories created by <tt></tt> 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.}} {{Note|As explained in [[#getting-started-with-download-and-compile-sh-notations|Notations]], we assume that your Unix user name (login) is <tt>toto</tt>. Don't confuse the <tt>sudo</tt> password prompt (where you need to enter <tt>toto</tt>'s password) with the password prompt for your SourceForge account! The former appears as [sudo] password for toto:whereas the latter is just: Password:}} {{Tip|In case you want to run some other program instead of <tt>sudo</tt>, this can be done with the <code>--sudo</code> option of <tt></tt>. For instance, in order to see the commands that would be run with sudo without actually running them, you can pass <code><nowiki>--sudo=echo</nowiki></code> to <tt></tt>. Like all other options, <code><nowiki>--sudo</nowiki></code> must be given ''before'' all arguments that are component names (such as <tt>SIMGEAR</tt>, <tt>FGFS</tt>, <tt>DATA</tt>, etc.).}} The package manager used by <tt></tt> by default is <tt>apt-get</tt>. You can use another one if you want, as long as it supports the following calls: ''pkg-mgr'' update ''pkg-mgr'' install ''pkg1 pkg2'' ...This is the case for <tt>aptitude</tt> as well as <tt>apt</tt>. If you want <tt></tt> to use <tt>aptitude</tt>, give it the option <code><nowiki>--package-manager=aptitude</nowiki></code> before any of the ''COMPONENT'' arguments. All options of <tt></tt> can be seen by running the following command: $ --helpNow the instructions we promised you. You have chosen a dedicated directory where all the stuff that is downloaded and built by <tt></tt> will be stored. This is <tt>~/flightgear/dnc-managed</tt> in our example, and should be empty before you run <tt></tt> for the first time. However, it is quite correct to start <tt></tt> from the same directory for subsequent runs, even when non-empty (otherwise, <tt></tt> would automatically reclone the repositories every time you run it; that would be a sheer waste of time and bandwidth). Ready? Let's go!<pre>$ mkdir -p ~/flightgear/dnc-managed$ cd ~/flightgear/dnc-managed$ --git-clone-site-params SourceForge=ssh:SFusername DATA* FGFS ********************************************************************** ** Warning: a typical SimGear + FlightGear + FGData build requires ** about 12 GiB of disk space. The compilation part may last from a ** few minutes to hours, depending on your computer. ** ** Hint: use the -j option if your CPU has several cores, as in: ** ** -j$(nproc) ** ***********************************************************************Running 'apt-get update'...[sudo] password for toto: (...) Considering a package alternative: libcurl4-openssl-dev libcurl4-gnutls-devPackage alternative matched for libcurl4-openssl-devRunning 'apt-get install build-essential git libcurl4-openssl-dev cmake'...[sudo] password for toto: (...) ******************************************************** DATA **********************************************************Fetching DATA with 'git clone ssh://'Cloning into '.'...The authenticity of host ' (' can't be established.ECDSA key fingerprint is SHA256:FeVkoYYBjuQzb5QVAgm3BkmeN5TTgL2qfmqz9tCPRL4.Are you sure you want to continue connecting (yes/no)?Warning: Permanently added ',' (ECDSA) to the list of known hosts.Connection closed by port 22fatal: Could not read from remote repository. Please make sure you have the correct access rightsand the repository exists.</pre> The above messages are perfectly normal but deserve a little explanation. Here, <tt>ssh</tt> asked us to confirm that the fingerprint sent by the remote host is that of the real <tt></tt>, as opposed to that of some malicious server ''pretending'' to be <tt></tt>. This confirmation only has to be done once, after which it is remembered thanks to <tt>~/.ssh/known_hosts</tt>. You should visit the [ page that gives the host key fingerprint of every publically-accessible SSH server at SourceForge] and carefully check that the fingerprint appearing on your terminal is listed on that page for <tt></tt>, or some matching pattern such as <tt>*</tt>. If the fingerprint that is printed on your terminal is not listed on that page, answer <tt>no</tt> to the question ''Are you sure you want to continue connecting (yes/no)?'' and copy/paste to flightgear-devel (see [[Mailing lists]]) the above message from <tt>ssh</tt> that contains the fingerprint sent to you by the remote host which pretends to be <tt></tt>. If this corresponds happened, you should stop here and wait for answers from readers of flightgear-devel. From now on, we'll assume that the fingerprint you received was correct, and therefore that you have answered <tt>yes</tt> to the ''Are you sure you want to continue connecting (yes/no)?'' question. In this example, it took us several minutes to verify the fingerprint of the <tt></tt> server and confirm it to <tt>ssh</tt>. Because of this delay, <tt></tt> hung up on us and closed the connection. This is absolutely ''not a problem:'' we can just rerun the <tt></tt> command with the same arguments as the first time. Since we answered <tt>yes</tt> to the ''Are you sure you want to continue connecting (yes/no)?'' prompt, the fingerprint of <tt></tt>'s key has been stored in <tt>~/.ssh/known_hosts</tt>, therefore we won't get this prompt anymore. But if some server claiming to be <tt></tt> presents a host key that has a different fingerprint in the future, <tt>ssh</tt> will print a big fat warning that the server may belong to an attacker trying to impersonate <tt></tt>. Therefore, this SSH host key verification is very useful to protect us from future attacks (which hopefully won't happen at all). As said, we just rerun the <tt></tt> command with the same arguments:<pre>$ --git-clone-site-params SourceForge=ssh:SFusername DATA*********************************************************************** ** Warning: a typical SimGear + FlightGear+ FGData build requires ** about 12 GiB of disk space. The compilation part may last from a ** few minutes to hours, depending on your computer. ** ** Hint: use the -j option if your CPU has several cores, as in: ** ** -j$(nproc) ** ***********************************************************************Running 'apt-get update'...[sudo] password for toto: (...) Considering a package alternative: libcurl4-openssl-dev libcurl4-gnutls-devPackage alternative matched for libcurl4-openssl-devRunning 'apt-get install build-essential git libcurl4-openssl-dev cmake'...[sudo] password for toto: (...) ******************************************************** DATA **********************************************************Fetching DATA with 'git clone ssh://'Cloning into '.'...Password:</pre>As explained above, the preceding prompt is for your SourceForge password (this corresponds which you could guess from the <code><nowiki>git clone ssh://</nowiki></code> command).<pre>remote: Enumerating objects: 67011, done.remote: Counting objects: 100% (67011/67011), done.remote: Compressing objects: 100% (31342/31342), done.remote: Total 67011 (delta 38776), reused 59640 (delta 33570)Receiving objects: 100% (67011/67011), 2.60 GiB | 313.00 KiB/s, done.Resolving deltas: 100% (38776/38776), done.Checking out files: 100% (12959/12959), done.Password:</pre>(It will take a fair amount of time to get there, because this is the complete download of [[FGData]].)<br />This is again a prompt for your SourceForge password, because <tt></tt> wants to run <code>git pull --rebase</code> in the repository (admittedly, it's a bit dumb after a <tt>clone</tt> operation—please forgive us). In case you were not monitoring the <tt>clone</tt> operation, you probably saw the password prompt way after <tt></tt> got bored waiting for you and closed our second connection:<pre>Connection closed by port 22fatal: Could not read from remote repository. Please make sure you have the correct access rightsand the repository exists.</pre>(if not, there should be no error message and you should have a clean FGData clone)<br />No worries. Just as before, simply rerun the command with the same arguments:<pre>$ --git-clone-site-params SourceForge=ssh:SFusername DATA* CMAKE********************************************************************** PLIB ** Warning: a typical SimGear + FlightGear + FGData build requires ** about 12 GiB of disk space. The compilation part may last from a ** few minutes to hours, depending on your computer. ** ** Hint: use the -j option if your CPU has several cores, as in: ** ** -j$(nproc) ** ***********************************************************************Running 'apt-get update'...[sudo] password for toto: (...) Considering a package alternative: libcurl4-openssl-dev libcurl4-gnutls-devPackage alternative matched for libcurl4-openssl-devRunning 'apt-get install build-essential git libcurl4-openssl-dev cmake'...[sudo] password for toto: (...) ******************************************************** DATA **********************************************************DATA: the repository already existsPassword:Already up to date.Current branch next is up to date.Already on 'next'Your branch is up to date with 'origin/next'.All optional package alternatives have found a matching package. has finished to work.</pre>There we are! You now have a clean, up-to-date [[FGData]] clone in <tt>~/flightgear/dnc-managed/install/flightgear/fgdata</tt> (remember: <tt>~/flightgear/dnc-managed</tt> is the directory from which you ran <tt></tt>). Note this place: the full path of the <tt>~/flightgear/dnc-managed/install/flightgear/fgdata</tt> directory is your [[$FG_ROOT]]. Now, change the protocol to use for future updates of your FGData clone:<ref name="changing-the-protocol-for-a-git-remote-manual-method">Another way would be to manually change the relevant line starting with <code><nowiki>url = ssh://SFusername@</nowiki></code> for the <code>origin</code> remote in the <tt>.git/config</tt> file that lives inside your repository clone (i.e., <tt>~/flightgear/dnc-managed/install/flightgear/fgdata/.git/config</tt> in our example).</ref> (cd install/flightgear/fgdata && \ git remote set-url origin <nowiki></nowiki>)(you can check at any time the protocol(s) in use with the command <code>git remote -v</code> run inside a Git repository—in this case, inside the folder <tt>install/flightgear/fgdata</tt>). As a consequence of this change, all future updates of your FGData clone will use the <tt>https</tt> protocol, therefore you won't be prompted anymore for your SourceForge password. All that remains to do is to run, from the same directory as before (<tt>~/flightgear/dnc-managed</tt> in our example): $ download_and_compile.shor $ -j$(nproc)(<code>-j$(nproc)</code> is “only” useful to save time—see the tip below). When you don't pass any non-option argument to <tt></tt> as done here, it takes care of the three base components needed to run FlightGear: <tt>SIMGEAR</tt>, <tt>FGFS</tt> and <tt>DATA</tt> (these are the component names used by <tt></tt>, i.e., the final arguments one can optionally give in a <tt></tt> command; in normal speech, they correspond to the {{simgear source| text = SimGear}}, {{flightgear source| text = FlightGear}} and {{fgdata source| text = FGData}} repositories). Therefore, the above command is presently exactly equivalent to: $ SIMGEAR FGFS DATA In case you wanted to build another component such as [[OpenSceneGraph|OSG ]], you could add it to the command, like this: $ SIMGEAR FGFS DATA OSG (With current Debian stable, this is not necessary because it has OpenSceneGraph 3.4. But if your distribution only has an older version, you'll certainly need to select the <tt>OSG</tt> component like this.) When the command terminates, you should have a script called <tt></tt> in the directory <tt>~/flightgear/dnc-managed</tt> from which you ran <tt></tt>. This will be your script to run FlightGear. For instance, in order to start the built-in launcher, you can run the following commands:<ref name="no-need-to-change-to-dnc-managed-dir-before-starting-generated-scripts">We give these commands because they are easy to read, but the <code>cd</code> command is not needed if you use the correct path, as in <code>~/flightgear/dnc-managed/ --launcher</code>.</ref> $ cd ~/flightgear/dnc-managed $ ./ --launcher(You may omit the <code>--launcher</code> option; this would simply start FlightGear without any launcher, at the default airport and with the default aircraft.)<br />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 [ this message] or use another launcher such as [[FFGo]] (but the [[FlightGear Qt launcher|FlightGear built-in launcher]] started with <code> --launcher</code> is quite fine, be sure to try it first!). {{Tip|You can considerably speed up the build process—literally, save hours—by telling <tt></tt> to use several cores simultaneously when compiling. With option <code>-j$(nproc)</code>, compilations will use all cores available on your processor; thus, a typical <tt></tt> command is <code> -j$(nproc)</code>. If you want to use, say, 4 cores, replace <code>-j$(nproc)</code> with <code>-j4</code>.}} === <span id="using-download-and-compile-sh-to-update-flightgear"></span> Updating FlightGear === Just go to the directory from which you you previously ran <tt></tt> (<tt>~/flightgear/dnc-managed</tt> in our example). This is the folder which, if you did a complete run of <tt></tt> as shown in the previous section, contains the <tt></tt> script and a log file named <tt>compilation_log.txt</tt> that records what <tt></tt> did in its last run. If you wish to update, say, {{simgear source| text = SimGear}}, {{flightgear source| text = FlightGear}} and {{fgdata source| text = FGData}}, simply execute this: $ -pn SIMGEAR FGFS DATAWe'll explain the <code>-pn</code> in a minute. <tt>SIMGEAR</tt>, <tt>FGFS</tt> and <tt>DATA</tt> are called ''components'' in <tt></tt> terminology. A component generally corresponds to a software repository, or something close. In fact, since <tt>SIMGEAR</tt>, <tt>FGFS</tt> and <tt>DATA</tt> are often precisely the components people wish to update, they form the default components set, so that the previous command is equivalent to: $ -pnNow about this <code>-pn</code>. It is equivalent to <code>-p n</code> and means “don't install packages from my (Linux) distribution” (<code>y</code> means ''yes, please install'', <code>n</code> means ''no, don't install''). In case you forgot that, simply run: $ --helpWhat does it imply to pass <code>-pn</code>? This tells <tt></tt> to completely skip the step where it checks for needed packages from your distribution and installs them, by default using <tt>apt-get</tt>. It thus goes straight to the following steps:* update each repository corresponding to one of the selected components (<tt>SIMGEAR</tt>, <tt>FGFS</tt> and <tt>DATA</tt> in our example);* compile each selected component that requires compilation;* install each selected component in the appropriate place (under <tt>~/flightgear/dnc-managed</tt> according to our [[OpenSceneGraph#getting-started-with-download-and-compile-sh-notations|Notations]]).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 <code>-pn</code> to <tt></tt>, you forbid it to install these dependencies for you. So, you can also very well update without passing the <code>-pn</code> option, it will simply take a little longer (the time to check if all dependencies of the selected components are available with <tt>APT</tt>). In fact, this is '''what you should do if the previous <tt></tt> run failed:''' first update <tt></tt> (see [[#getting-download-and-compile-sh-using-an-fgmeta-clone|above]]) then run it ''without'' <code>-pn</code><ref name="passing-no-pn-option-equals-passing-py">Which is the same as passing <code>-py</code>.</ref> 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. '''Summary''' Routine update: $ -pn ''COMPONENT...''In case this fails, first update <tt></tt> (see [[#getting-download-and-compile-sh-using-an-fgmeta-clone|above]]), then run $ ''COMPONENT...''where ''COMPONENT...'' stands for the space-separated list of selected components, and defaults to <tt>SIMGEAR FGFS DATA</tt> if you don't specify any. === <span id="examining-download-and-compile-sh-history"></span> Examining the history of <tt></tt> === Looking at the latest commits that affected <tt></tt> is quite easy with your FGMeta clone: $ cd ~/flightgear/fgmeta $ git log -- quit by typing <tt>q</tt>, assuming your <tt>$GIT_PAGER</tt> is <tt>less</tt>)<br /> In order to do the same, but also see the patch for each commit: $ cd ~/flightgear/fgmeta $ git log -p -- == <span id="list-of-available-components"></span> List of available components == The <tt></tt> script is able to download, compile (when applicable) and install the following components: * FGRUNATCPIE (for the [[ATC-pie]] air traffic control simulation program)* CMAKE (for the [ CMake] build tool—this can be useful in case CMake is too old in your distribution)* DATA (for [[FGData]], the main set of data files used by FlightGear)* FGFS (for FlightGear itself)* FGO(for the [[FGo!]] FlightGear launcher)* FGRUN (for the [[Fgrun|FGRun]] FlightGear launcher)* FGX(for the [[FGX|FGx]] FlightGear launcher<ref name="note-on-the-status-of-FGx-support-in-download-and-compile-sh">Support for FGx in <tt></tt> would probably benefit from a code review.</ref>)* TERRAGEAROPENRADAR (for the [[OpenRadar]] air traffic control simulation program)* TERRAGEARGUIOPENRTI (for [[FlightGear HLA support (High Level Architecture)#OpenRTI | OpenRTI]]<ref name="note-on-the-status-of-OpenRTI-support-in-FG">Note that OpenRTI is just an optional dependency for [[FlightGear high-level architecture support | HLA support]]. For the time being, you should be just fine building without it. Eventually, the idea is for HLA to replace the existing MP system and even increasingly distribute the FlightGear architecture such that more and more components can be more easily run in separate threads or even separate processes, possibly even on different machines. So this is going to be an important feature for professional users, using several computers and screens to create a comprehensive and immersive simulation environment.<p>At the moment, it is probably safe to say that HLA is only of interest to developers and people willing to play with experimental features.</ref>)* OPENRADAROSG (for the [[OpenSceneGraph]] library)* ATCPIEPLIB (for the [[PLIB]] library)* OPENRTISIMGEAR (for the [[SimGear]] library—foundation for FlightGear and TerraGear)* TERRAGEAR (for the [[TerraGear]] terrain building toolchain)* TERRAGEARGUI (for [[TerraGear GUI]], a graphical interface for TerraGear) Each of the items listed above is a ''component'' in <tt></tt> terminology. Components are written in uppercase by convention. {{Note|The preceding list might not be up-to-date. The up-to-date list of components supported by <tt></tt> can always be obtained by running: <code> --help</code>.}}
What is the point of knowing this? Because you may pass component names to <tt></tt> in order to tell it what you want to download, build and install. By default, only the three essential components SIMGEAR, FGFS and DATA are taken care of, which means that the command:
is equivalent to:
In case you want to do the same build with just [[OpenSceneGraph]] added, you can use:
You get the idea. When several components are passed on the same command line, <tt></tt> chooses a reasonable order for processing, so don't worry about that.
==== When building Next 'next', you may see build errors ====
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 stable version should always work, unless there is a problem with the script.
That said, don't be too afraid of building 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<ref name="what-to-provide-when-asking-for-help">Don't forget in this case to precisely tell what you did and include the <tt>compilation_log.txt</tt> file written by <tt></tt>.</ref> should allow you to find good advice and get the problem quickly fixed, if it's a new one. Conversely, probably not many people (in 2019) build themselves the “stable” version of FlightGear. People who want the stable version can usually have it from their distribution, this is generally easier. On the other hand, those running <tt></tt> typically want to build the latest code that FlightGear developers are working on; this is useful when you want to contribute feedback, code, aircraft or scenery based on recent technology, or just want to enjoy the latest features and bugs. ;-)
== Download Task-specific instructions ==You can download the script here: **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 {{Note|In this section, we assume you've read and all its dependencies followed the advice given in an automated fashion, please refer to: http://geoffmclane[[#getting-started-with-download-and-compile-sh|Getting started with <tt>download_and_compile.comsh</fg/fgfs-052tt>]].htm}}
== Instructions =<span id=To run, just save it in a directory called for example: ~"selecting-the-components-to-work-on"></fgfsthen execute it (no need span> Selecting the components to execute it as root).build ===
Here is for example a sequence of commands to get the script from the master branchBy default, <tt>download_and_compile. You sh</tt> downloads or updates, then compiles, [[SimGear]] and FlightGear, and downloads or updates [[FGData]] (by nature, FGData can replace master with next to get a later version of the script if one 't be compiled). This is availablewhat happens when running:<pre>mkdir ~/fgfscd ~/fgfswget $ 755 The preceding command is therefore equivalent to: $</pre>SIMGEAR FGFS DATA
To make <tt></tt> take care of other programs or libraries, use non-option arguments naming the ''components'' you want, for instance:
SIMGEAR, FGFS, DATA and OSG are the component names respectively corresponding to [[SimGear]], FlightGear, [[FGData]] and [[OpenSceneGraph]] in <tt></tt>'s terminology.
You have two options now: build the latest ''stable'' FlightGear release or build the ''current development'' version (bleeding edge).After building stable or the latest, if you need to build a different version, try the instructions for A [[Avoiding multiple downloads #list-of FGData on Linux-available-components|list of available components]]. === Build the latest stable FlightGear release ===When executing the scriptis provided on this page, use but the "fully up-s" option to build the latest stable release:-date list can always be obtained by running <precode>./ -s-help</precode>.
=== Build the current FlightGear Choosing between stable and development version versions ===When executing the script without any options, the latest development version is built.
'''Warning''': The By default, <tt></tt> fetches code and data from development version branches of FlightGear changes on an almost daily basis. It provides the latest featuressource repositories (which sometimes causes compilation or runtime errors). However, but it is not always guaranteed possible to work reliably. If you're unfamiliar with software testing, you may prefer tell the script to use download the latest stable release”stable” version of each component, for some suitable definition of “stable”.This is by means of the <code>-s</code> option: $ -s ''COMPONENT1 COMPONENT2...''
How does it work?* For [[SimGear]], FlightGear and [[FGData]], it uses the most recent stable release branch of the corresponding Git repository.* For some components, a known-stable version is hardcoded in <prett></tt> and used when the <code>-s</code> option is given<ref name="components-with-a-known-stable-version-hardcoded-in-download_and_compile_sh">As of May 2019, apart from SIMGEAR, FGFS and DATA, the only components for which <tt></tt> “knows” a stable version are TERRAGEAR and OPENRTI.</ref> (for instance, the hardcoded information can be the name of a Git branch).* For the other components, the <code>-s</precode>option has no effect.
{{Warning|In a given folder where <tt></tt> is run, you should either always use the <code>-s</code> option, or never. Building some components with <code>-s</code> and others without (all within the same base folder) is not supported.}}
Once Applying what we just said to the script FGFS component (FlightGear) leaves us with two main options:* build the latest stable release;* build the current development version (bleeding edge), which lives in the {{flightgear source| branch = next| text = next}} branch of the FlightGear repository. ==== Building the latest stable FlightGear release ==== When executing <tt></tt>, use the <code>-s</code> option to build the latest stable release: $ cd ~/flightgear/dnc-managed $ -s {{Note|If you decide to use the <code>-s</code> option in a given directory tree, you should use it for all components in that directory tree (SIMGEAR, FGFS, DATA, etc.). Running <tt></tt> in a given directory with the <code>-s</code> option for some components and not for others is finishednot supported.}} ==== Building the current FlightGear development version ==== When executing <tt></tt> without any option, the development version of every selected component is built: $ cd ~/flightgear/dnc-managed $ this example, the implicitly-selected components are SIMGEAR, FGFS and DATA, as explained [[#selecting-the-components-to-work-on | above]].) {{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 will successfully get don't want to take the risk of finding new bugs when updating, you may prefer to use the latest stable release.}} === Passing custom arguments to CMake === 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 <tt></tt> (April 2019 or later), the environment variables <tt>SG_CMAKEARGS</tt> and <tt>FG_CMAKEARGS</tt> allow one to do that for SimGear and FlightGear . For instance, in order to link SimGear with the system Expat library, you can do: $ SG_CMAKEARGS='-DSYSTEM_EXPAT=ON' SIMGEARSimilarly, disabling HID-based input when building FlightGear can be achieved this way: $ FG_CMAKEARGS='-DENABLE_HID_INPUT=OFF' FGFS {{Note|Such options are typically defined in <tt>CMakeLists.txt</tt> files, for example {{simgear source| path = CMakeLists.txt| text = here}} for SimGear and FGRun installed {{flightgear source| path = CMakeLists.txt| text = here}} for FlightGear.}} 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! If you have several such options to pass, just use spaces to separate them inside the quotes: $ FG_CMAKEARGS='-DENABLE_SWIFT=ON -DENABLE_HID_INPUT=OFF' FGFSOf course, the same thing can also be achieved this way in Bourne-style shells: $ export FG_CMAKEARGS='-DENABLE_SWIFT=ON -DENABLE_HID_INPUT=OFF' $ FGFS It is also possible to set both <tt>SG_CMAKEARGS</fgfs directorytt> and <tt>FG_CMAKEARGS</tt> at the same time for a given <tt></tt> run: $ export SG_CMAKEARGS='-DSYSTEM_EXPAT=ON' $ export FG_CMAKEARGS='-DENABLE_SWIFT=ON -DENABLE_HID_INPUT=OFF' $
=== Launching FlightGear ===
When using Brisa's script, the two FG dependencies/libs are usually not installed system-wide, but in a custom location (that makes it possible, to easily use different OSG/SG/FG versions on a single system, i.e. for testing purposes - but also to have separate build trees (optimized/debug) ) - which is why you either need to set LD_LIBRARY_PATH or simply use Brisa's script to run everything (something like, which automatically sets up all environment variables according to your build settings).
To When using <tt></tt>, 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 <tt></tt> was run your new git installation of . This makes it possible to easily use, for instance, different [[OpenSceneGraph]], [[SimGear]] and FlightGear you 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 launch set LD_LIBRARY_PATH to run the ''run_fgfsbuilt programs, or simply use the scripts created by <tt>'' command under </tt> in the same folderdirectory where it is run, for example:such as <prett>cd ~/fgfssh</prett>and <tt></tt>: these scripts automatically set up the required environment variables according to your build settings before firing the desired program (e.g., <tt>fgfs</tt>) with the arguments you provided.
=== Launching FGRun ===[[File:fgrun-page2.jpg|thumb|right]]For many users it's more comfortable having Therefore, the simplest way to run a FlightGear launched program built by the graphical utility FGRun which is installed as well in the same folder<tt>download_and_compile. You have sh</tt> is to launch the ''run_fgrun<tt>'' command</tt> script that <tt></tt> created in the directory from which it was run, for example:<pre> $ cd ~/fgfsflightgear/dnc-managedsh run_fgrun $ .sh</pre> --launcher
FGRun will save its settings in ~/{{Note|<code>.fltk/flightgearrun_fgfs.orgsh --launcher</fgruncode> starts FlightGear with its built-in launcher.prefs If you may want to save copies of just do <code>./</code>, FlightGear will be started without any launcher, at the preferences customized for stable default airport and nextwith the default aircraft.}}
In order to start FlightGear without any launcher, at a given airport (say, [ Paro airport], whose ICAO code is VQPR) and with a chosen aircraft, you can do: $ cd ~/flightgear/dnc-managed $ ./ --airport=VQPR --aircraft=dhc6Actually, the directory change is not needed, we only gave it here for readability. Therefore, the following single command does the same: $ ~/flightgear/dnc-managed/ --airport= Launching FGo! VQPR --aircraft=dhc6 === <span id="avoiding-multiple-downloads-of-fgdata"></span> Avoiding multiple downloads of FGData === Some people use <tt></tt> to maintain several directory trees such as the tree starting at <tt>~/flightgear/dnc-managed</tt> in [[File:Fgo01.jpg#getting-started-with-download-and-compile-sh|thumb|leftGetting started with <tt></tt>]](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 is a graphical utility written can easily be done by running <tt></tt> in each of the directories. But since [[pythonFGData]]is so large, You have it may be tempting to launch the ''run_fgoshare a single instance of this repository among several'' commandThis is not officially supported, for example:but apparently can be made to work with symbolic links. Let's show how this can be done on an example. Suppose your master copy of FGData is in <prett>~/flightgear/dnc-managed/install/flightgear/fgdata</tt>. Then the following appears to work: $ mkdir -p ~/flightgear/other-dnc-managed-tree/install/flightgear $ cd ~/fgfsflightgear/other-dnc-managed-tree/install/flightgearsh run_fgo $ ln -s ../../../dnc-managed/install/flightgear/fgdata $ cd ~/flightgear/other-dnc-managed-tree $ The last of these commands will use and update the FGData repository present in <tt>~/preflightgear/dnc-managed/install/flightgear/fgdata</tt>.Remember {{Warning|This can only work simply if all trees that share a given FGData repository are from the first time 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 run start itin such a situation. That said, you have to go to preferences and set people comfortable with Git can check out the binary and correct FGData branch before building or starting FlightGear, for instance: $ cd /path (Do no set the working directory/to/fgdata && git checkout release/2019.1or $ cd /path/to/fgdata && git checkout nextSo, you donthis is possible but somewhat acrobatic. You't need ve been warned.}} 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.
== 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:
./ ALL
This, will also install FGCOM, FGComGui and Atlas
=== Launching FGCOM ===FGCOM is {{Note|In this section, we assume you've read and followed the system used by FlightGear to simulate radio communications between users. Launch it using the ''run_fgcom.advice given in [[#getting-started-with-download-and-compile-sh'' command:|Getting started with <prett>cd ~/fgfssh</prett>]].}}
If you wish to get other programs (precisely: download, build and install them), you need to launch <tt></tt> with the desired component names as arguments. For instance:
$ cd ~/flightgear/dnc-managed
See [[#list-of-available-components|above]] for the list of available components.
=== Launching TerraSync TerraGear ===Your FlightGear compilation comes with the [[TerraSync]] program too, so if you want to use it:<pre>cd ~/fgfssh -S -p 5500 -d /folder/with/sceneries</pre>Where: ''/folder/with/sceneries'' is the folder containing the sceneries data.
Then launch FGFS Run <tt></tt> with the '''TERRAGEAR component in order to build and install the [[TerraGear]] terrain building toolchain: $ cd ~/flightgear/dnc-managed $ TERRAGEAR This creates the following scripts in <tt>~/flightgear/dnc-fgmanaged</tt>:* <tt></tt>* <tt></foldertt>* <tt></tt>These scripts themselves run the corresponding TerraGear tools, as expected. === TerraGear GUI === [[TerraGear GUI]] is a graphical interface for [[TerraGear]] written withthe Qt toolkit (still Qt 4 in 2019, but it works). In order to install it, run <tt></sceneries tt> with the TERRAGEARGUI component: $ cd ~/flightgear/dnc-managed $ TERRAGEARGUIThis will create a <tt></tt> script in <tt>~/flightgear/dnc-atlasmanaged</tt>, and also a default configuration file <tt>~/.config/TerraGear/TerraGearGUI.conf</tt>, 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. To run TerraGear GUI: $ cd ~/flightgear/dnc-managed $ ./ =socket== FGCom === {{Note|[[FGCom]] has been integrated into FlightGear long ago,outtherefore the following is not needed in general.}} [[FGCom]] is the system used by FlightGear to simulate radio communications between users. It is automatically built and installed when you tell <tt></tt> to take care of the FGFS component. You can launch the standalone FGCom program by using the <tt></tt> script: $ cd ~/flightgear/dnc-managed $ ./ === FGRun === {{Note|As of 2019,5FGRun 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]].}} [[File:fgrun-page2.jpg|thumb|right]]Before FlightGear had its built-in launcher (the one you get with <code> --launcher</code>),localhostmany users found comfortable having FlightGear launched by the graphical utility [[Fgrun|FGRun]]. This program is built and installed when <tt></tt> is run with the FGRUN component. You then have to launch the <tt></tt> command,5500for example: $ cd ~/flightgear/dnc-managed $ ./ FGRun will save its settings in <tt>~/.fltk/</tt>. You may want to save copies of the preferences customized for stable and next. === FGo! === {{Note|As of 2019,udpFGo! is not maintained anymore. You may want to try the built-in launcher (started with <code> --launcher</code>) or [[FFGo]].}} [[File:Fgo01.jpg|thumb|left]]FGo! is a graphical utility written in [[python]]. It is downloaded and installed when <tt></tt> is run with the FGO component. You then have to launch the <tt></tt> command, for example: $ cd ~/flightgear/dnc-managed $ ./ Remember that the first time you run it, you have to go to open the ''Preferences' option' dialog and set the paths to the <tt>fgfs</tt> executable and to FGData.
== 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|FGRun]], FGCOM [[FGCom]] or atlas, if you then see the file it means that FlightGear installation was successful and you can safely run it.
=== OpenRTI undefined reference errors ===
Sometimes due to the way d&c build cleans up projects, linking errors might occur, this is the case with this error " undefined reference to xxx", sadly at this point either you need to patch the d&c script to clean OpenRTI with <code>rm -f CMakeCache.txt && rm -rf CMakeFiles/</code>, or just start from a clean environment, assuming you are in the parent project directory, you will need to issue this command to clean everything(except FGDATAFGData):<pre> $ rm -rf build/* install/simgear/ install/openrti/ install/flightgear/share/ install/flightgear/bin/</pre>
see See {{forum link|t=26244|text=this thread }} for more details (
== 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.:
./ ALL
=== Compiling only one program Multicore acceleration ===If you wish to recompile only one of the programs you can launch the script with one of the following parameters:* CMAKE (to compile and install only cmake)* PLIB (to compile and install only plib)* OSG (to compile and install only OpenSceneGraph)* SIMGEAR (to compile and install only Simgear)* FGFS (to compile and install only FlightGear)* DATA (to download / update only data files for FlightGear)* FGRUN (to compile and install only Fgrun)* TERRAGEAR (to compile and install only terragear!)* TERRAGEARGUI (to compile and install only terrageargui!)* OPENRADAR (to compile and install only OpenRadar!)* FGO (to compile and install only Fgo!)
=== Fast updating ===
There is a second parameter ''UPDATE'' that allows you to just update your installation. i.e.:
This will only update FGFS
=== 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.
./ -s
How does it work? Inside the script there is a small list with latest known versions of successfully compiling revisions, it will download from svnPassing option <code>-j x</git those specific revisions, which have been found able code> to compile together<tt><BR/tt>Warning: If you run this option inside a folder (where ''x'' is the number of your CPU cores you previously compiled FGFS, it will probably fail wish to assign to compile, you better run the script with this option inside an empty folder or a folder with job) will considerably speed up the same FGFS version compiled previouslycompilation steps.
=== Advanced options ===
* Build a release version using '''-b Release''' option
* Build a debug version for more complete bug reporting using '''-b RelWithDebInfo''' option (default)
* Build a full debug version for very complete bug reporting using '''-b Debug''' option
* Skip download of distro packages using '''-p n''' option
* Skip compilation of programs using '''-c n''' option
* Skip retrieving software updates using '''-d n''' option
* Skip reconfigure (make clean) using '''-r n''' option
For example, if you are * Build a developer and wish release version: <code>-b Release</code>* Build a version that should run as fast as a release build, yet has debug information that can be used to quickly recompile and reinstall only your own modifications for FlightGear do thispost backtraces:<code>-b RelWithDebInfo</code> (this is the default)* Build a full debug version for very complete bug reporting: <precode>-b Debug</code>* Skip download of distro packages (i./ , by default: <tt>apt-get install ...</tt>): <code>-p n </code>* Skip retrieving of software updates (i.e., by default: <tt>apt-get update</tt>): <code>-d n </code>* Skip the configure step (like running [ CMake] or [ autoconf]'s <tt>./configure</tt>): <code>-r n FGFS</code>* Skip compilation of programs: <code>-c n</precode>.
this will only For example, if you are a developer and wish to quickly recompile modifications and reinstall themonly your own modifications for FlightGear, you can do this: $ -p n -d n -r n FGFS
=== Multicore Acceleration ===Using the option '''-j x''' (where x Note that this is the number of your CPUsame as: $ -Cores you wish to assign to the job) will speed up the whole compilation process -dn -rn FGFS
== Disk usage ==Having both compiled program, source code, and data from git requires some hard disk space: It This command will take something like 13 GB of spaceonly rebuild modified files and reinstall FlightGear.If Note that depending on the kind of changes you don't have a fast machinemade, it will require several hours of compilation timereconfiguring and thus dropping the <code>-d n</code> option may be necessary, though (this is the case in particular if you added or removed C++ files).
== Optimus technology ==
If your computer has a GPU with Optimus technology, you need a dedicated script in order to make FG running FlightGear run with the powerful GPU.
After having installed required tools (Bumblebee) you just need to run this command line in your FG FlightGear installation directory (where you executed ./<tt></tt>) : <pre> $ sed 's|\./fgfs|optirun ./fgfs|' > && chmod +x</pre>Now you can run FG FlightGear with <code>./</code>.
The same can be done for the [[FlightGear_Launch_Control|FGRun]] launcher:
$ sed 's|\./fgrun|optirun ./fgrun|' > && chmod +x
the same is applied with the FGRun launcher :<pre>sed 's|\./fgrun|optirun ./fgrun|' > && chmod +x</pre>== See also ==
* {{fgmeta source| path =compile-scripts| text = Remove warning message for DDS files ==Other FlightGear build scriptsYou can remove the warning message displayed when DDS files are parsed by SimGear by adding the following line just after '''cd "simgear"''' line :}} present in [[FGMeta]]<pre>* {{fgmeta source sed | path = fg-i sfrom-scratch| simplepath = true}}* [http:/SG_ALERT,\ \"Image/SG_WARN,\ \"Image/g Another script] for building FlightGear and all its dependencies in an automated fashion. The page seems a bit oldish, though (as of 2019). == References ==<references/pre>
[[Category:Building from source]]
[[fr:Script de compilation sous Linux Debian/Ubuntu]]
[[nl:Compileren met een Script op Linux Debian/Ubuntu]]
[[fr:Script de compilation sous Linux Debian/Ubuntu]]
== References ==

Navigation menu