EDK
External drift kriging.
|
The section 'Dependencies' lists the general requirements for the compilation. The section 'System-dependent dependency installation' gives some instructions on how to install these dependencies on Windows, some Linux-distributions and MacOS. Conda based dependency installation is described in the section 'Conda dependent installation'.
To clone and compile EDK you need at least the following:
After you installed all dependencies on your system you can proceed with cloning and compiling.
On Windows 10 and later we recommend to use Windows Subsystem for Linux (WSL) to be able to use Linux by e.g. installing Ubuntu there.
Easiest way to do so is:
Then you can follow the install instructions for Ubuntu from above.
If you are on a module system, load the modules gcc or intel depending on your favorite compiler. Then, load the modules netcdf-fortran and cmake.
These modules will have system specific names, environments, etc. You may use module spider
to find the right packages and the right dependencies, potentially use corresponding wiki pages.
A set of load-scripts is provided in hpc-module-loads
(see the repository for more details), to load all needed modules for specific compilers:
foss/2018b
Toolchain): The simplest way to compile this project on your local computer is to use a conda environment (on Linux (including WSL) or MacOS) provided by Miniforge to install NetCDF, a Fortran compiler, make, cmake.
On Windows we recommend to use Windows Subsystem for Linux (WSL) to be able to use Linux (see above) and set up conda there.
You can get the latest version of Miniforge with (for Linux/MacOS/WSL):
To create a (local) conda environment with all dependencies type the following:
Then you can proceed with cloning and compiling.
First you need to clone the repository (if you already have git
, otherwise see below):
This will give you a new folder edk_nc/
containing the whole repository. You can go into it by:
If you then want to compile a specific version (different from the latest development version), you can check that out with e.g.:
Afterwards you can continue with the compilation.
It could be necessary to set your desired fortran compiler with an environment variable, e.g.:
We prepared a set of scripts to automatize the build and compilation process to generate an executable in the root directory with the following naming scheme:
edk
: edk_debug
: edk_openmp
: edk_openmp_debug
: Then you can find an executable edk
(or edk[_openmp][_debug]
) in the current folder. You can execute it with:
To install edk after compilation, i.e. make it available as a command edk
, you can do the following (assuming you used the release compile script, otherwise replace release
with the respective build folder):
If you need to provide a prefix, where to install it, you can just pass one. For example, if you used a conda environment for compilation, you can also install edk there with:
Starting with version 3.0, EDK is depending on FORCES, our Fortran library for Computational Environmental Systems. This library is downloaded on the fly by CPM, the cmake package manager.
If you don't want to download it indirectly, know you wont have internet during your development or you want to work on routines provided by FORCES, you can place a copy of the FORCES repository in the root of your cloned EDK repository by e.g.:
The new folder forces/
will be automatically recognized during compilation as described above and nothing will be downloaded.
If you just want a specific version (see src/CMakeLists.txt
for the currently used one), do this:
If you have already cloned FORCES somewhere else, you can also provide a path to this repository. You can do this with all mentioned compile scripts, e.g.:
For example, if you have cloned FORCES next to edk_nc
, this could look like this:
The presented compile scripts all just execute two cmake commands with a specific set of configuration flags. The basic cmake workflow, to configure and compile in a build/
folder, is:
You can control all cmake
options by passing them as directives staring with -D
to the cmake configuration. For example for debug configuration, you can do the following:
To configure the build interactively, you can also use ccmake (command line tool) or the CMake GUI (graphical user interface). Check their respective documentation for further information. To use ccmake
you can do the following:
Then set your desired options and re-configure your build (by pressing c
). Afterwards build you project as always by executing: