These instructions are written for Unix-like operating systems. This includes e.g. Linux and Mac systems, and the instructions might also work on Windows if you have e.g. Cygwin installed. For other platforms or compilers, you may have to compile the project manually.
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:
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:
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