Installation

  • Jabir Ali Ouassou
  • 2018-09-03

Dependencies

To compile the project, any Fortran compiler that supports the official language standards from 1977 through 2008 should suffice. However, the software has been developed and tested using the compilers below. For your own convenience, it is therefore recommended that you have the following available:

  • CMake: an open-source cross-platform build system that automates the compilation details;
  • GFortran: an open-source cross-platform Fortran compiler from the GNU Compiler Collection;
  • IFort: a commercial Fortran compiler developed by Intel, with free licenses for e.g. students.

The code was last tested using GFortran 8.2.0, IFort 18.0.2, and CMake 3.10.2. Newer versions should probably work fine, while older versions may or may not work. The software was originally developed using GFortran 5.0 and CMake 2.6, and later tested rigorously with IFort 16.0. However, newer versions of the software increasingly relies on modern language features, which may be unavailable or unreliable on older compilers.

In my experience, IFort generates much faster binaries than GFortran: with the most aggressive optimalization settings, IFort binaries run ~4x faster on an Intel Core i7. Furthermore, the nonequilibrium functionality in particular has been tested more rigorously using IFort. However, if you do not have access to IFort, the code should work fine with GFortran too, so no proprietary tools are strictly required.

Although slower, the binaries generated by GFortran can sometimes be more stable than the ones generated by IFort. In most cases, this is just caused by IFort choosing to place more variables on the stack than GFortran. In that case, the problem can be resolved by running the command ulimit -s unlimited to increase the stack size before running your simulations, assuming that you use a Bourne-based shell.

There are also some optional but recommended programs:

  • Git: the software and its entire version history can be downloaded via Git. However, the software may also be browsed online or downloaded as a zip file if that is preferred.
  • FORD: this program was used to automatically generate software documentation from the source code and some supplementary Markdown files. This program should be installed if you plan to modify the source code, and wish to automatically update the documentation accordingly.
  • Gnuplot: the output formats are specifically designed to be easy to plot with Gnuplot. For examples of how to generate publication-quality plots with Gnuplot, see e.g. this page. However, it should also be straight-forward to import the generated data to e.g. Matlab, Python, or R, if you prefer that.

Compilation

The first step is to download the source code. After that, open a terminal, and go to the project top directory, i.e. the directory containing the files configure and CMakeLists.txt. To prepare for compilation, you should then run one of the following commands, depending on whether you wish to compile with GFortran or IFort:

./configure --gfortran
./configure --ifort

If you need to search for bugs, it can be quite useful to enable debug mode. This essentially means that all compiler optimizations are disabled, and extra safety checks are performed at both compiletime and runtime. As a consequence, the generated code will run several times slower, but will also provide better feedback if something goes wrong. To enable debug mode, run one of these commands instead of the above:

./configure --gfortran-debug
./configure --ifort-debug

After configuration, change to the subdirectory build, and run make to compile:

cd build
make -j4

If the project compiles successfully, the executables should appear in the subdirectory bin of the top directory. You might want to add that directory to your system PATH variable, or move the executables to a system location like /usr/local/bin/, so that the programs can be run without specifying a full path. After that, you should be ready to continue with the user guide.

This documentation has been automatically generated using FORD. If you modify the source code, and wish to update the documentation accordingly, run the following command from the top directory:

./configure --docs