Skip to content
Fredrik Jansson edited this page Jun 7, 2024 · 39 revisions

These are notes for installing Dales on different systems. (Work in progress, may not be completely accurate/sufficient/up to date. Please comment or fix if you find mistakes).

Requirements

General requirements for installing Dales:

  • NetCDF
  • MPI
  • a Fortran compiler, e.g. gfortran
  • cmake
  • make
  • doxygen, dot, latex (optional, for building the documentation)
  • HYPRE library (optional, for iterative Poisson solver)
  • FFTW3 library (optional, for higher performance)

Compilation options

The following optional options can be provided on the CMake command line to control optional features, e.g. the FFTW library, the HYPRE library and select between single and double precision.

Produce a debug build. A debug build is much slower than a Release build, but contains more error checking.
-DCMAKE_BUILD_TYPE=Debug (default Release)

Optional alternative Poisson solvers (since v4.3)
-DUSE_FFTW=True          (default False)
-DUSE_HYPRE=True         (default False)

Choose between single and double precision for the main prognostic fields and for the Poisson solver (from v4.4)
-DPOIS_PRECISION=32      (default 64)
-DFIELD_PRECISION=32     (default 64)

Note that to use HYPRE or FFTW, the library needs to be enabled at compile time and selected at runtime with settings in the &SOLVER section of the namoptions input file. See Alternative Poisson solvers.

-DPOIS_PRECISION=32 and -DUSE_HYPRE=True can be used together, but HYPRE is 64-bit only, so only use this if it is really what you want.

Specific instructions per operating system

Fedora

sudo dnf install gcc-gfortran cmake netcdf-fortran-devel openmpi-devel
module load mpi/openmpi

git clone https://github.com/dalesteam/dales.git
cd dales
mkdir build
cd build
cmake ..
make

The command module load mpi/openmpi is needed also before launching Dales - it has to be run once in every new terminal (unless added to the shell initialization files).

MacOS

Use brew to install the dependencies.

# first install homebrew

brew install gcc make cmake open-mpi netcdf-fortran git fftw 

git clone https://github.com/dalesteam/dales.git
cd dales
mkdir build
export SYST=gnu-fast
cd build
cmake .. -DUSE_FFTW=True
make -j 4

The DALES executable is now at dales/build/src/dales4.4 Note that brew by default installs gfortran10 (or newer), which does not work directly with DALES versions older than 4.3 (one needs to add -std=legacy to the compiler options).

Problem with ld and Anaconda

If the cmake step fails with the following message

 "/usr/local/bin/mpif90"
  is not able to compile a simple test program.
...
    ld: library not found for -ld_classic
...

it may be because you have anaconda installed and activated. It changes the PATH so that the wrong ld is found. To see if this is the case, run

$ which ld

If the result is something like

/Applications/anaconda3/bin/ld

then Anaconda is messing with you. Tell it to go away (this lasts only for the terminal where you run this command):

conda deactivate

Installing other useful programs:

# ncview for viewing netCDF files
# cdo for processing netCDF data e.g. merging the 2D and 3D output files
# wget for downloading files from the command line  
brew install cdo ncview wget  

Ubuntu (also Ubuntu running in WSL on Windows)

sudo apt install git cmake gfortran netcdf-bin libnetcdf-dev libnetcdff-dev libopenmpi-dev libhypre-dev libfftw3-dev
# netcdf-bin is included for the ncdump tool, not directly needed

sudo apt install cdo ncview
# extra: tools for working with netCDF data

git clone https://github.com/dalesteam/dales.git
cd dales
mkdir build
export SYST=gnu-fast
cd build
cmake .. -DUSE_FFTW=True
make -j 4

Windows

DALES can be run in Ubuntu using WSL. Install Ubuntu tutorial, then follow the steps for Ubuntu above. Another route is to run DALES in Linux in a virtual machine. A VirtualBox image with DALES pre-installed is available here

Raspberry Pi 3B / Raspbian

Install dependencies with the following command, then compile as usual.

sudo aptitude install libnetcdf-dev mpich gfortran make cmake

Note: -march=native does not work on ARM with gfortran 4.9, which comes with the old Debian Jessie. In the new release it is supposed to work.

Performance: 32 us / (grid point * time step) single core, 46 us / (grid point * time step) with 4 cores on a Raspberry Pi 3B. 60 s Bomex. Compiled with -O3, gfortran 4.9.

With -Ofast: 25 us / (grid point * step)

Raspberry Pi 4B / Raspbian 10 (Buster)

sudo apt install libnetcdf-dev libnetcdff-dev openmpi-bin gfortran make cmake
git clone https://github.com/dalesteam/dales.git
cd dales
mkdir build
export SYST=gnu-fast
cd build
cmake ..
make

Notes:

  • with mpich instead of OpenMPI, DALES crashes in INIT_MPI.
  • gcc and gfortran shipped is version 8.3.0. -march=native and thus SYST=gnu-fast now works.

Specific machines / clusters

Installation on ECMWF Atos

Installation on Snellius

Installation on DelftBlue

Installation notes for old systems

Eagle cluster - Polish national grid

Tested 6.2.2020. On Eagle, compilation must be done in an interactive job, since the module system does not work on the login node. The module netcdf/4.4.1.1_impi-5.0.3_icc-15.0.3 provides a consistent set of netCDF with Fortran bindings. A more recent cmake than the default is also required.

# start interactive job
srun --pty -N1 --ntasks-per-node=1  -p fast  -t 60 /bin/bash

git clone https://github.com/dalesteam/dales
cd dales
# git checkout to4.3_Fredrik  # optionally check out another branch
mkdir build
cd build

export SYST=lisa-intel
export MODULEPATH=/home/plgrid-groups/plggvecma/.qcg-modules:$MODULEPATH
module load vecma/common/cmake
module load netcdf/4.4.1.1_impi-5.0.3_icc-15.0.3
cmake ..

make -j 4

TU Delft VR Lab system

Tested in May 2020.

Compile

git clone https://github.com/dalesteam/dales                                                             
module load hdf5/gcc5/1.10.1                                                                             
module load netcdf/gcc5                                                                                  
module load netcdf-fortran/gcc5/4.4.4                                                                    
module load openmpi/gcc5/3.0.0                                                                           
export SYST=gnu-fast                                                                                     
                                                                                                         
cd dales                                                                                                 
# git checkout to4.3  # optionally check out a branch                                                                                       
mkdir build                                                                                              
cd build                                                                                                 
cmake ..                                                                                                 
make                                                                                                     

Run it:

# load the same modules
# cd to the case directory
~/dales/build/src/dales4 namoptions.001