To compile Dales, you need a Unix-like operating system such as Linux or OSX. Dales has the following software requirements:
- cmake
- make
- gfortran or another supported compiler
- openmpi
- netCDF
We’ve installed and successfully used Dales on Ubuntu, Debian and MacOS Mojave. Most other Linux distributions will work, as will most Unixes running on super computers and clusters.
Installation of the dependencies for several popular operating systems are below
Ubuntu (version 16.04lts, 18.04lts and 19.04 have been tested)
sudo apt install git cmake gfortran libopenmpi-dev libnetcdf-dev libnetcdff-dev doxygen
Debian (version 9)
su -apt install git cmake gfortran libopenmpi-dev libnetcdf-dev libnetcdff-dev doxygen
MacOS Mojave
Install homebrew and the necessary tools:
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"brew install open-mpi netcdf cmake doxygen
Other dependencies, such as the Fortran compiler, are pulled in automatically.
Compiling Dales
To compile Dales, it is recommended to pull the source code from GitHub and compile with the following commands. This works the same on all platforms:
mkdir Development cd Development git clonehttps://github.com/dalesteam/dales.gitcd dales git checkout v4.1 cd .. mkdir dales.build cd dales.build cmake ../dales make -j 4
The ‘-j 4’ option to the make command specifies how many cores are used during the compilation. Adjust accordingly to the number of cores that are available on your machine. The produced executable is called ‘dales4’ and is placed in the ‘src’ directory below ‘dales.build’
Advanced options
It is possible to compile Dales with other Fortran compilers then the GCC Fortran compiler. The options are preset in the file CMakeList.txt and are controlled with an environment variable. For example, to use the Intel Fortran compiler, you’ll need to set the environment variable SYST to ‘local_pc’. Other presets are available. Have a look at the CMakeList.txt file for more details.