Autotools¶
Autotools, the GNU Build System, is a collection of tools to enable
cross-system development of programs and libraries. The system prepares
a shell script configure
which can be used to set various options for
compilers and paths for found libraries.
The base Autotools system is available on Apocrita without loading any
modules. The additional macros provided as part of the
Autoconf Archive
are available after loading the module autoconf-archive
.
Using Autotools¶
Configuring released software¶
If a released software package contains the script configure
in its root
it can be run according to the package's instructions without further
effort. However, it should be noted that often the modules on Apocrita
do not set all environment variables on which the configuration script
relies. For example, when using Intel MPI with the Intel compilers it
may be necessary to set additional variables when configuring:
module load intelmpi intel
./configure MPIFC=mpiifort
Preparing software configuration¶
To use Autotools to generate the configuration script configure
it is
necessary to create the file configure.ac
with the appropriate detail
(see the
manual
and other learning resources
for Autoconf for a description of this file). Once
configure.ac
is as desired autoreconf
may be used. It is at this
point where the autoconf-archive
module should be loaded if required:
module load autoconf-archive
autoreconf -i
If the module is not loaded at this point one may see errors relating to
the missing macros when running configure
. For example the configure.ac
file:
AC_INIT()
AX_CXX_COMPILE_STDCXX(11,,optional)
will produce a configure
script even without loading the module, but this
script may then fail with a message such as:
./configure: line 1659: syntax error near unexpected token `11'
./configure: line 1659: ` AX_CXX_COMPILE_STDCXX(11)'