417
edits
(→Advanced options: Markup and hopefully useful keywords for people searching the page) |
(JamesT's OSG fork now at GitLab is needed for a good UX starting from FG 2024.1. Also and directly related: OSG has been added to the default component list of download_and_compile.sh on 2024-09-25 (FGMeta commit 9faf2cfb5a3).) |
||
Line 53: | Line 53: | ||
<nowiki>git clone https://git.code.sf.net/p/flightgear/fgmeta</nowiki> | <nowiki>git clone https://git.code.sf.net/p/flightgear/fgmeta</nowiki> | ||
cd ~/flightgear/dnc-managed | cd ~/flightgear/dnc-managed | ||
~/flightgear/fgmeta/download_and_compile.sh -s -j$(nproc) | ~/flightgear/fgmeta/download_and_compile.sh -s -j$(nproc) | ||
./run_fgfs.sh --launcher | ./run_fgfs.sh --launcher | ||
Line 77: | Line 77: | ||
* <tt>~/flightgear/dnc-managed</tt> will be the directory from which we run <tt>download_and_compile.sh</tt>. In other words, with this setup, a typical sequence of commands could be: | * <tt>~/flightgear/dnc-managed</tt> will be the directory from which we run <tt>download_and_compile.sh</tt>. In other words, with this setup, a typical sequence of commands could be: | ||
$ cd ~/flightgear/dnc-managed | $ cd ~/flightgear/dnc-managed | ||
$ ~/flightgear/fgmeta/download_and_compile.sh SIMGEAR FGFS DATA | $ ~/flightgear/fgmeta/download_and_compile.sh | ||
or | |||
$ cd ~/flightgear/dnc-managed | |||
$ ~/flightgear/fgmeta/download_and_compile.sh SIMGEAR FGFS DATA OSG | |||
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. | 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. | ||
Line 150: | Line 153: | ||
{{Note|Because of the <code>-s</code> option, the above <tt>download_and_compile.sh</tt> command would build the latest stable release of FlightGear. If you want to build the latest Long Term Stable release, use <code>--lts</code> instead. For the previous LTS release, use <code>--old-lts</code>. If you want to build the development version of FlightGear, use none of <code>-s</code>, <code>--lts</code> and <code>--old-lts</code>, but be warned: it may very well be unstable and unsuitable for flying. For more details on these options, see [[#Release selection|Release selection]].}} | {{Note|Because of the <code>-s</code> option, the above <tt>download_and_compile.sh</tt> command would build the latest stable release of FlightGear. If you want to build the latest Long Term Stable release, use <code>--lts</code> instead. For the previous LTS release, use <code>--old-lts</code>. If you want to build the development version of FlightGear, use none of <code>-s</code>, <code>--lts</code> and <code>--old-lts</code>, but be warned: it may very well be unstable and unsuitable for flying. For more details on these options, see [[#Release selection|Release selection]].}} | ||
When you don't pass any non-option argument to <tt>download_and_compile.sh</tt> as done here, it takes care of the | When you don't pass any non-option argument to <tt>download_and_compile.sh</tt> as done here, it takes care of the base components needed to run FlightGear in good conditions: <tt>SIMGEAR</tt>, <tt>FGFS</tt>, <tt>DATA</tt> and <tt>OSG</tt> (these are the component names used by <tt>download_and_compile.sh</tt>, i.e., the final arguments one can optionally give in a <tt>download_and_compile.sh</tt> command; in normal speech, they correspond to the {{simgear source | ||
| text = SimGear | | text = SimGear | ||
}}, {{flightgear source | }}, {{flightgear source | ||
Line 156: | Line 159: | ||
}} and {{fgdata source | }} and {{fgdata source | ||
| text = FGData | | text = FGData | ||
}} repositories). Therefore, the above command is presently exactly equivalent to: | }} repositories as well as a suitable repository for [[OpenSceneGraph]]). Therefore, the above command is presently exactly equivalent to: | ||
$ download_and_compile.sh -s -j$(nproc) SIMGEAR FGFS DATA | $ download_and_compile.sh -s -j$(nproc) SIMGEAR FGFS DATA OSG | ||
In case you want to build another component such as [[ | In case you want to build another component such as, say, [[PLIB]], you can add it to the command, like this: | ||
$ download_and_compile.sh -s -j$(nproc) SIMGEAR FGFS DATA OSG | $ download_and_compile.sh -s -j$(nproc) SIMGEAR FGFS DATA OSG PLIB | ||
When the command terminates, you should have a script called <tt>run_fgfs.sh</tt> in the directory from which you ran <tt>download_and_compile.sh</tt> (i.e., <tt>~/flightgear/dnc-managed</tt> 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:<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/run_fgfs.sh --launcher</code>.</ref> | When the command terminates, you should have a script called <tt>run_fgfs.sh</tt> in the directory from which you ran <tt>download_and_compile.sh</tt> (i.e., <tt>~/flightgear/dnc-managed</tt> 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:<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/run_fgfs.sh --launcher</code>.</ref> | ||
Line 179: | Line 181: | ||
}}, {{flightgear source | }}, {{flightgear source | ||
| text = FlightGear | | text = FlightGear | ||
}} | }}, {{fgdata source | ||
| text = FGData | | text = FGData | ||
}}, simply execute this: | }} and [[OpenSceneGraph|OSG]], simply execute this: | ||
$ download_and_compile.sh -pn -j$(nproc) SIMGEAR FGFS DATA | $ download_and_compile.sh -pn -j$(nproc) SIMGEAR FGFS DATA OSG | ||
The <code>-j$(nproc)</code> 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]]. | The <code>-j$(nproc)</code> 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]]. | ||
We'll explain the <code>-pn</code> in a minute. <tt>SIMGEAR</tt>, <tt>FGFS</tt> and <tt> | We'll explain the <code>-pn</code> in a minute. <tt>SIMGEAR</tt>, <tt>FGFS</tt>, <tt>DATA</tt> and <tt>OSG</tt> are called ''components'' in <tt>download_and_compile.sh</tt> terminology. A component generally corresponds to a software repository, or something close. In fact, since <tt>SIMGEAR</tt>, <tt>FGFS</tt>, <tt>DATA</tt> and <tt>OSG</tt> are often precisely the components people wish to update, they form the default component set, so that the previous command is equivalent (as of Sept. 2024) to: | ||
$ download_and_compile.sh -pn -j$(nproc) | $ download_and_compile.sh -pn -j$(nproc) | ||
Now 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: | Now 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: | ||
$ download_and_compile.sh --help | $ download_and_compile.sh --help | ||
What does it imply to pass <code>-pn</code>? This tells <tt>download_and_compile.sh</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: | What does it imply to pass <code>-pn</code>? This tells <tt>download_and_compile.sh</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> | * update each repository corresponding to one of the selected components (<tt>SIMGEAR</tt>, <tt>FGFS</tt>, <tt>DATA</tt> and <tt>OSG</tt> in our example); | ||
* compile each selected component that requires compilation; | * compile each selected component that requires compilation; | ||
* install each selected component in the appropriate place (under <tt>~/flightgear/dnc-managed</tt> according to our [[#getting-started-with-download-and-compile-sh-notations|Notations]]). | * install each selected component in the appropriate place (under <tt>~/flightgear/dnc-managed</tt> according to our [[#getting-started-with-download-and-compile-sh-notations|Notations]]). | ||
Line 202: | Line 204: | ||
$ download_and_compile.sh --cleanup | $ download_and_compile.sh --cleanup | ||
$ download_and_compile.sh -j$(nproc) ''COMPONENT...'' | $ download_and_compile.sh -j$(nproc) ''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. | where ''COMPONENT...'' stands for the space-separated list of selected components, and defaults to <tt>SIMGEAR FGFS DATA OSG</tt> if you don't specify any. | ||
=== <span id="examining-download-and-compile-sh-history"></span> Examining the history of <tt>download_and_compile.sh</tt> === | === <span id="examining-download-and-compile-sh-history"></span> Examining the history of <tt>download_and_compile.sh</tt> === | ||
Line 393: | Line 395: | ||
* DATA (for [[FGData]], the main set of data files used by FlightGear) | * DATA (for [[FGData]], the main set of data files used by FlightGear) | ||
* FGFS (for FlightGear itself) | * FGFS (for FlightGear itself) | ||
* | * FFGO (for the [[FFGo]] FlightGear launcher) | ||
* FGRUN (for the [[Fgrun|FGRun]] 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>download_and_compile.sh</tt> would probably benefit from a code review.</ref>) | * 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>download_and_compile.sh</tt> would probably benefit from a code review.</ref>) | ||
Line 411: | Line 413: | ||
{{Note|The preceding list might not be up-to-date. The up-to-date list of components supported by <tt>download_and_compile.sh</tt> can always be obtained by running <code>download_and_compile.sh --help</code>.}} | {{Note|The preceding list might not be up-to-date. The up-to-date list of components supported by <tt>download_and_compile.sh</tt> can always be obtained by running <code>download_and_compile.sh --help</code>.}} | ||
What is the point of knowing this? Because you may pass component names to <tt>download_and_compile.sh</tt> in order to tell it what you want to download, build and install. By default, only the | What is the point of knowing this? Because you may pass component names to <tt>download_and_compile.sh</tt> 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: | ||
$ download_and_compile.sh | $ download_and_compile.sh | ||
is equivalent to: | is equivalent to: | ||
$ download_and_compile.sh SIMGEAR FGFS DATA | $ download_and_compile.sh SIMGEAR FGFS DATA OSG | ||
In case you | In case you'd like to do the same build with just [[PLIB]] added, you could use: | ||
$ download_and_compile.sh SIMGEAR FGFS DATA OSG | $ download_and_compile.sh SIMGEAR FGFS DATA OSG PLIB | ||
You get the idea. When several components are passed on the same command line, <tt>download_and_compile.sh</tt> chooses a reasonable order for processing, so don't worry about that. | You get the idea. When several components are passed on the same command line, <tt>download_and_compile.sh</tt> chooses a reasonable order for processing, so don't worry about that. | ||
Line 435: | Line 437: | ||
=== <span id="selecting-the-components-to-work-on"></span> Selecting the components to build === | === <span id="selecting-the-components-to-work-on"></span> Selecting the components to build === | ||
By default, <tt>download_and_compile.sh</tt> downloads or updates, then compiles, [[SimGear]] | By default, <tt>download_and_compile.sh</tt> 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: | ||
$ download_and_compile.sh | $ download_and_compile.sh | ||
The preceding command is therefore equivalent to: | The preceding command is therefore equivalent to: | ||
$ download_and_compile.sh SIMGEAR FGFS DATA | $ download_and_compile.sh SIMGEAR FGFS DATA OSG | ||
To make <tt>download_and_compile.sh</tt> take care of other programs or libraries, use non-option arguments naming the ''components'' you want, for instance: | To make <tt>download_and_compile.sh</tt> take care of other programs or libraries, use non-option arguments naming the ''components'' you want, for instance: | ||
$ download_and_compile.sh SIMGEAR FGFS DATA OSG | $ download_and_compile.sh SIMGEAR FGFS DATA OSG CMAKE | ||
SIMGEAR, FGFS, DATA and | SIMGEAR, FGFS, DATA, OSG and CMAKE are the component names respectively corresponding to [[SimGear]], FlightGear, [[FGData]], [[OpenSceneGraph]] and [https://cmake.org/ CMake] in <tt>download_and_compile.sh</tt>'s terminology. | ||
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 <code>download_and_compile.sh --help</code>. | 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 <code>download_and_compile.sh --help</code>. | ||
Line 522: | Line 524: | ||
==== A short example ==== | ==== A short example ==== | ||
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 <tt>fgfs- | 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 <tt>fgfs-osg-36-2</tt> 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 <tt>download_and_compile.sh</tt> clones a repository is [https://en.wikipedia.org/wiki/HTTPS HTTPS], this can be done with | ||
download_and_compile.sh --cleanup -s \ | download_and_compile.sh --cleanup -s \ | ||
--override-repo OSG= | --override-repo OSG=GitLab:gitlab.com/flightgear/openscenegraph.git \ | ||
--component-branch OSG=fgfs- | --component-branch OSG=fgfs-osg-36-2 SIMGEAR FGFS DATA OSG | ||
==== The site name ==== | ==== The site name ==== |
edits