Scripted Compilation on Linux Debian/Ubuntu: Difference between revisions

Fix header levels
(Streamline general introduction and add an Introduction section as recommended by the wiki's Manual of Style)
(Fix header levels)
Line 5: Line 5:
For hints on using <tt>rpm</tt>-based distributions such as Redhat, Fedora and CentOS, please see [[CentOS]]. Please also see [[Superbuild]].
For hints on using <tt>rpm</tt>-based distributions such as Redhat, Fedora and CentOS, please see [[CentOS]]. Please also see [[Superbuild]].


=== Introduction ===
== Introduction ==


<tt>download_and_compile.sh</tt> 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.
<tt>download_and_compile.sh</tt> 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.
Line 17: Line 17:
Apart from its main purpose, <tt>download_and_compile.sh</tt> can be used to find hopefully up-to-date build-dependency information for FlightGear and related software. You would do so by inspecting [https://sourceforge.net/p/flightgear/fgmeta/ci/next/tree/download_and_compile.sh the script] at the point where it installs packages.<ref name="note-inspecting-download-and-compile-sh-to-gather-build-dependency-information">Look for strings such as <tt>zlib1g-dev</tt>, <tt>libglew-dev</tt> or <tt>qt5-default</tt>.</ref>
Apart from its main purpose, <tt>download_and_compile.sh</tt> can be used to find hopefully up-to-date build-dependency information for FlightGear and related software. You would do so by inspecting [https://sourceforge.net/p/flightgear/fgmeta/ci/next/tree/download_and_compile.sh the script] at the point where it installs packages.<ref name="note-inspecting-download-and-compile-sh-to-gather-build-dependency-information">Look for strings such as <tt>zlib1g-dev</tt>, <tt>libglew-dev</tt> or <tt>qt5-default</tt>.</ref>


=== Update Available ===
== Update Available ==


The latest version of <tt>download_and_compile.sh</tt> can be obtained {{fgmeta source
The latest version of <tt>download_and_compile.sh</tt> can be obtained {{fgmeta source
Line 24: Line 24:
}}, however there are advantages getting it from an [[FGMeta]] clone as explained [[User:Rominet#Getting_download_and_compile.sh_the_.E2.80.9Cright_way.E2.80.9D|here]]. Contents should be moved from [[User:Rominet|there]] to this page; this and the following section are not up-to-date at the time of this writing.
}}, however there are advantages getting it from an [[FGMeta]] clone as explained [[User:Rominet#Getting_download_and_compile.sh_the_.E2.80.9Cright_way.E2.80.9D|here]]. Contents should be moved from [[User:Rominet|there]] to this page; this and the following section are not up-to-date at the time of this writing.


=== Cut to the Chase: for the impatient ===
== Cut to the Chase: for the impatient ==


Beware: with the following, you are likely to encounter problems when cloning [[FGData]]: read just above.
Beware: with the following, you are likely to encounter problems when cloning [[FGData]]: read just above.
Line 40: Line 40:
{{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>.}}
{{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>.}}


=== Conversion of directory structure from earlier versions of download_and_compile.sh ===
== Conversion of directory structure from earlier versions of download_and_compile.sh ==


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.
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.


=== Disk Space Requirements ===
== Disk Space Requirements ==


As of April 2019, building FlightGear requires about 12 [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 6 GiB for that one).
As of April 2019, building FlightGear requires about 12 [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 6 GiB for that one).


=== List of compiled programs ===
== List of compiled programs ==
The <tt>download_and_compile.sh</tt> script is able to download and compile:
The <tt>download_and_compile.sh</tt> script is able to download and compile:
* [[SimGear]] (”base libraries” that are part of the FlightGear project, and required)
* [[SimGear]] (”base libraries” that are part of the FlightGear project, and required)
Line 97: Line 97:
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.


==== When building Next you may see build errors ====
== When building 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.
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.
377

edits