GNU Astronomy Utilities



3.1.3 Bootstrapping dependencies

Bootstrapping is only necessary if you have decided to obtain the full version controlled history of Gnuastro, see Version controlled source and Bootstrapping. Using the version controlled source enables you to always be up to date with the most recent development work of Gnuastro (bug fixes, new functionalities, improved algorithms, etc.). If you have downloaded a tarball (see Downloading the source), then you can ignore this subsection.

To successfully run the bootstrapping process, there are some additional dependencies to those discussed in the previous subsections. These are low level tools that are used by a large collection of Unix-like operating systems programs, therefore they are most probably already available in your system. If they are not already installed, you should be able to easily find them in any GNU/Linux distribution package management system (apt-get, yum, pacman, etc.). The short names in parenthesis in typewriter font after the package name can be used to search for them in your package manager. For the GNU Portability Library, GNU Autoconf Archive and TeX Live, it is recommended to use the instructions here, not your operating system’s package manager.

GNU Portability Library (Gnulib)

To ensure portability for a wider range of operating systems (those that do not include GNU C library, namely glibc), Gnuastro depends on the GNU portability library, or Gnulib. Gnulib keeps a copy of all the functions in glibc, implemented (as much as possible) to be portable to other operating systems. The bootstrap script can automatically clone Gnulib (as a gnulib/ directory inside Gnuastro), however, as described in Bootstrapping this is not recommended.

The recommended way to bootstrap Gnuastro is to first clone Gnulib and the Autoconf archives (see below) into a local directory outside of Gnuastro. Let’s call it DEVDIR94 (which you can set to any directory; preferentially where you keep your other development projects). Currently in Gnuastro, both Gnulib and Autoconf archives have to be cloned in the same top directory95 like the case here96:

$ DEVDIR=/home/yourname/Development  ## Select any location.
$ mkdir $DEVDIR                      ## If it doesn't exist!
$ cd $DEVDIR
$ git clone https://git.sv.gnu.org/git/gnulib.git
$ git clone https://git.sv.gnu.org/git/autoconf-archive.git

Gnulib is a source-based dependency of Gnuastro’s bootstrapping process, so simply having it is enough on your computer, there is no need to install, and thus check anything.

You now have the full version controlled source of these two repositories in separate directories. Both these packages are regularly updated, so every once in a while, you can run $ git pull within them to get any possible updates.

GNU Automake (automake)

GNU Automake will build the Makefile.in files in each sub-directory using the (hand-written) Makefile.am files. The Makefile.ins are subsequently used to generate the Makefiles when the user runs ./configure before building.

To check that you have a working GNU Automake in your system, you can try this command:

$ automake --version
GNU Autoconf (autoconf)

GNU Autoconf will build the configure script using the configurations we have defined (hand-written) in configure.ac.

To check that you have a working GNU Autoconf in your system, you can try this command:

$ autoconf --version
GNU Autoconf Archive

These are a large collection of tests that can be called to run at ./configure time. See the explanation under GNU Portability Library (Gnulib) above for instructions on obtaining it and keeping it up to date.

GNU Autoconf Archive is a source-based dependency of Gnuastro’s bootstrapping process, so simply having it is enough on your computer, there is no need to install, and thus check anything. Just do not forget that it has to be in the same directory as Gnulib (described above).

GNU Texinfo (texinfo)

GNU Texinfo is the tool that formats this manual into the various output formats. To bootstrap Gnuastro you need all of Texinfo’s command-line programs. However, some operating systems package them separately, for example, in Fedora, makeinfo is packaged in the texinfo-tex package.

To check that you have a working GNU Texinfo in your system, you can try this command:

$ makeinfo --version
GNU Libtool (libtool)

GNU Libtool is in charge of building all the libraries in Gnuastro. The libraries contain functions that are used by more than one program and are installed for use in other programs. They are thus put in a separate directory (lib/).

To check that you have a working GNU Libtool in your system, you can try this command (and from the output, make sure it is GNU’s libtool)

$ libtool --version
GNU help2man (help2man)

GNU help2man is used to convert the output of the --help option (--help) to the traditional Man page (Man pages).

To check that you have a working GNU Help2man in your system, you can try this command:

$ help2man --version
LaTeX and some TeX packages

Some of the figures in this book are built by LaTeX (using the PGF/TikZ package). The LaTeX source for those figures is version controlled for easy maintenance not the actual figures. So the ./boostrap script will run LaTeX to build the figures. The best way to install LaTeX and all the necessary packages is through TeX live which is a package manager for TeX related tools that is independent of any operating system. It is thus preferred to the TeX Live versions distributed by your operating system.

To install TeX Live, first download its installer, unpack it, enter the unpacked directory (which includes the date it was generated!),

$ baseurl=http://mirrors.rit.edu/CTAN/systems/texlive/tlnet
$ wget $baseurl/install-tl-unx.tar.gz
$ tar -xf install-tl-unx.tar.gz
$ cd install-tl-20*
$ ./install-tl

The output of the last command above is an interactive shell that will allow you to customize the installation. There are two important parts which you need to edit:

Basic scheme

By default the full package repository will be downloaded and installed (around 9 Gigabytes!) which can take very long to download and to update later. However, most packages are not needed by everyone! So it is easier, faster and better to install only the “Basic scheme” (consisting of only the most basic TeX and LaTeX packages, which is almost 300 Megabytes). To do this, from the top interactive installer environment press the following keys:

  1. S’ to select the installation scheme.
  2. d‘ to select the basic scheme.
  3. R‘ to return to the main menu.
Installation path

By default, TeXLive will try to install in a system-wide location which will require root permissions. A better solution is to install TeXLive in your user-accessible directories to avoid the need to become root when installing packages or updating. This also helps in using servers where you do not have root access at all. To install it in another directory take the following steps from the main menu:

  1. D‘ to enter the directory settings.
  2. 1‘ to select the “main tree” (base of all the other directories by default).
  3. You will be prompted to enter a new directory.

    To get the directory name, let’s open a new/different terminal. Run the following commands to make and get the absolute location of the directory (no problem if the first command says that $HOME/.local already exists). If you already have a different place to host custom-built software, you can modify this step accordingly.

    $ mkdir $HOME/.local; mkdir $HOME/.local/texlive
    $ cd $HOME/.local/texlive
    $ pwd
    

    Copy the result of the last command above, come back to the terminal with the TeXLive interactive installation and paste the directory there. Afterwards, you can close the temporary directory.

  4. R’ to return to the main menu.

After the customizations above are implemented simply press the ‘I’ key to start the installation of TeXLive. After the installation finishes, be sure to set the environment variables as suggested in the end of the outputs. For more on how to insert the given directories for the given environment PATHs, see Installation directory.

After the installation and setup of the PATHs are complete, you need install all the necessary TeX packages for a successful Gnuastro bootstrap. To do that, run the command below (in case it complains about not finding tlmgr, there is a problem in the PATHs above).

$ tlmgr install epsf jknapltx caption biblatex biber \
                logreq xstring xkeyval pgf xcolor \
                pgfplots times rsfs ps2eps epspdf

Generally (outside of Gnuastro’s development), any time you confront (need) a package you do not have97, simply install it with the tlmgr command above. It is very similar to how you install software from your operating system’s package manager).

ImageMagick (imagemagick)

ImageMagick is a wonderful and robust program for image manipulation on the command-line. bootstrap uses it to convert the book images into the formats necessary for the various book formats.

Since ImageMagick version 7, it is necessary to edit the policy file (/etc/ImageMagick-7/policy.xml) to have the following line (it maybe present, but commented, in this case un-comment it):

<policy domain="coder" rights="read|write" pattern="{PS,PDF,XPS}"/>

If the following line is present, it is also necessary to comment/remove it.

<policy domain="delegate" rights="none" pattern="gs" />

To learn more about the ImageMagick security policy please see: https://imagemagick.org/script/security-policy.php.

To check that you have a working ImageMagick in your system, you can try this command:

$ convert --version

Footnotes

(94)

If you are not a developer in Gnulib or Autoconf archives, DEVDIR can be a directory that you do not backup. In this way the large number of files in these projects will not slow down your backup process or take bandwidth (if you backup to a remote server).

(95)

If you already have the Autoconf archives in a separate directory, or cannot clone it in the same directory as Gnulib, or you have it with another directory name (not autoconf-archive/), you can follow this short step. Set AUTOCONFARCHIVES to your desired address. Then define a symbolic link in DEVDIR with the following command so Gnuastro’s bootstrap script can find it:
$ ln -s $AUTOCONFARCHIVES $DEVDIR/autoconf-archive.

(96)

If your internet connection is active, but Git complains about the network, it might be due to your network setup not recognizing the git protocol. In that case use the following URL for the HTTP protocol instead (for Autoconf archives, replace the name): http://git.sv.gnu.org/r/gnulib.git

(97)

After running TeX, or LaTeX, you might get a warning complaining about a missingfile. Run ‘tlmgr info missingfile’ to see the package(s) containing that file which you can install.