Compile and install the Ariane program
Hello and welcome to this video.
Here, we will see how to compile and install the Ariane program
on a Linux system.
In a later video we will cover potential problems
you might have during compilation and installation.
Here we will assume that everything goes well.
The Ariane program is coded in Fortran.
This is a language that can be read by humans,
which needs to be transformed into a binary language,
executable by a computer.
The transformation of the Fortran language into a binary language
is called compilation.
We're going to learn how to compile Ariane's code.
Compiling is a fairly complicated step
which requires a little experience.
You will also need to install a Fortran compiler on your computer,
and a NetCDF library,
which will allow Ariane
to read and write data on your computer.
The compilation is the first step.
Once you have created an executable file,
the second step will be to install this executable
in a specific directory.
There are several ways to organise a computer,
to store compilers, libraries, etc.
For the Ariane package I use
the Autotools
developed by a free software community,
which will simplify this step.
We will go back to where we were in the last module.
I open a command line terminal
and return to the 'Ariane' directory
where the compressed and archived
Ariane program file should be
and a directory that we created with the 'tar' command.
I go directly into this directory
and list its contents.
The place where the Fortran compiler and NetCDF library are stored
will depend on the architecture and system of your computer.
Using the 'configure' command,
which comes from Autotools,
we will search your computer for
the Fortran compiler and the NetCDF library.
We will consider a situation where everything works
and both these things are available.
I type the command './configure',
and an option that allows me to specify the directory
in which I will put the executable Ariane files.
This option is '--prefix' + the directory name
Here I define a directory, but you can
choose the directory you want.
I run the command, now some information appears on the screen.
Let's have a quick look at the essential information.
Here we see the command I typed.
The program looks for a Fortran compiler
and finds the GNU compiler 'gfortran'.
Then the program looks for a NetCDF library,
it finds library 4.4.4
and its directory
and specifies the name of the required libraries.
The 'configure' command archives all this information
(compiler, library, etc.)
in a key file: 'Makefile'.
Makefile contains all the information
needed for the next command, which we will use soon.
When running 'configure', we also get
a summary of all the information
needed to find the Ariane program,
such as its version, the operating system,
installation directory for the executable,
compiler name,
compiler options,
and NetCDF library directories.
At the end, it suggests running the 'make' command
which, together with 'Makefile',
(the file that has just been created)
will allow us to compile
our Ariane program.
This is how we transform our Fortran code
into an executable that can be interpreted by the computer.
Just type the 'make' command
to run the procedure, which can take some time.
The compilation of Ariane went well,
as the compiler and library were present.
We now have an Ariane executable available.
We will install it the directory
we specified using the 'configure' command.
Here is the directory.
I simply type the 'make' command
with the 'install' option.
This will install the Ariane executable in that directory.
This is much faster.
If we go to the newly created directory and list its contents
we see that there are three new directories:
'bin', 'doc' and 'examples'.
'bin' contains the Ariane executable.
If I list the contents of this directory,
we have the Ariane executable,
with other files that we will examine later.
The 'doc' directory contains the Ariane documentation
and the 'examples' directory contains some examples.
So, we have completed the objective of this module:
from the source code written in Fortran,
we obtained an executable,
which we installed in a chosen directory.
In the next module we will see
that the compilation can be more complicated
if a compiler or library is missing,
or if some elements are incompatible.
In the next module,
we will see how to solve the problems
that may occur during compilation
and installation of Ariane.
Thank you!