Scripted Compilation on Linux Debian/Ubuntu: Difference between revisions

Jump to navigation Jump to search
→‎Updating FlightGear: Add -j$(nproc) in commands and suggest --cleanup after a build failure
(→‎Getting started with download_and_compile.sh: Move the SSH method to a dedicated section, last. The recommended method should now be simple enough.)
(→‎Updating FlightGear: Add -j$(nproc) in commands and suggest --cleanup after a build failure)
Line 178: Line 178:
{{Note|If you built FlightGear with either <code>-s</code> or <code>--lts</code>, you need to pass the ''same option'' to the <tt>download_and_compile.sh</tt> command given below that will update your FlightGear installation. Otherwise, <tt>download_and_compile.sh</tt> 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 Support'' to ''stable''), using the <code>--cleanup</code> option of <tt>download_and_compile.sh</tt> is heartily recommended.}}
{{Note|If you built FlightGear with either <code>-s</code> or <code>--lts</code>, you need to pass the ''same option'' to the <tt>download_and_compile.sh</tt> command given below that will update your FlightGear installation. Otherwise, <tt>download_and_compile.sh</tt> 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 Support'' to ''stable''), using the <code>--cleanup</code> option of <tt>download_and_compile.sh</tt> is heartily recommended.}}


Keeping the above note in mind, go to the directory from which you previously ran <tt>download_and_compile.sh</tt> (<tt>~/flightgear/dnc-managed</tt> in our example). This is the folder which, if you did a complete run of <tt>download_and_compile.sh</tt> as shown in the previous section, contains the <tt>run_fgfs.sh</tt> script and a log file named <tt>compilation_log.txt</tt> that records what <tt>download_and_compile.sh</tt> did in its last run. If you wish to update, say, {{simgear source
Keeping the above note in mind, go to the directory from which you previously ran <tt>download_and_compile.sh</tt> (<tt>~/flightgear/dnc-managed</tt> in the [[#Notations|suggested setup]]). This is the folder which, if you did a complete run of <tt>download_and_compile.sh</tt> as shown in the previous section, contains the <tt>run_fgfs.sh</tt> script and a log file named <tt>compilation_log.txt</tt> that records what <tt>download_and_compile.sh</tt> did in its last run. If you wish to update, say, {{simgear source
| text = SimGear
| text = SimGear
}}, {{flightgear source
}}, {{flightgear source
Line 185: Line 185:
| text = FGData
| text = FGData
}}, simply execute this:
}}, simply execute this:
  $ download_and_compile.sh -pn SIMGEAR FGFS DATA
  $ download_and_compile.sh -pn -j$(nproc) SIMGEAR FGFS DATA
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>DATA</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> 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:
We'll explain the <code>-pn</code> in a minute. <tt>SIMGEAR</tt>, <tt>FGFS</tt> and <tt>DATA</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> 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:
  $ download_and_compile.sh -pn
  $ 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
Line 194: Line 196:
* 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]]).
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>download_and_compile.sh</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>download_and_compile.sh</tt> run failed:''' first update <tt>download_and_compile.sh</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.
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>download_and_compile.sh</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>download_and_compile.sh</tt> run failed:''' first update <tt>download_and_compile.sh</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. In this case, running <code>download_and_compile.sh --cleanup</code> 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).


'''Summary'''
'''Summary'''


Routine update:
Routine update:
  $ download_and_compile.sh -pn ''COMPONENT...''
  $ download_and_compile.sh -pn -j$(nproc) ''COMPONENT...''
In case this fails, first update <tt>download_and_compile.sh</tt> (see [[#getting-download-and-compile-sh-using-an-fgmeta-clone|above]]), then run
In case this fails, first update <tt>download_and_compile.sh</tt> (see [[#getting-download-and-compile-sh-using-an-fgmeta-clone|above]]), then run
  $ download_and_compile.sh ''COMPONENT...''
  $ download_and_compile.sh --cleanup
$ 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</tt> if you don't specify any.


377

edits

Navigation menu