Skip to content

1_Installation

BenMql edited this page Jun 2, 2022 · 16 revisions

Installation, Compilation and Maintenance


Dependencies

Before we compile (and run) Coral, we need:

  • a Fortran compiler (gfortran, ifort, ...)
  • a MPI implementation (openmpi, mpich, ...) Use openmpi if you can
  • the FFTW3 library. Installation is well documented on FFTW3's website. It may be as simple as: un-tar the archive, run the configure script, make and make install. Sequential or MPI routines are used depending on the version of coral that's being build: slabs or pencils. Be sure to use fftw3, and not Intel MKL's wrappers
  • the MKL library, obtained from Intel's website after a free registration. Installation is reasonably straightforward using the script they provide e.g., there
  • on clusters, all the above is accessible via modules.
  • when building the pencils version of coral, an additional requirement is the patched 2decomp&fft library. This is the only dependency which needs manual installation on clusters. Fortunately, the installation is relatively straighforward and detailled there,
  • the helpers routines---not necessary for compiling, nor running, yet useful for output processing and plotting---are written in python3 (and often compatible with python2). Some require a recent scipy installation (>1.4.0)

First installation

Clone the git repository where suitable and define this folder as ${CORAL_ROOT}:

cd /path/to/my/codes  
git clone https://github.com/BenMql/coral.git $PWD
cd coral
export CORAL_ROOT=${PWD}/

Alternatively you may want to download a tarball of a given version.


Defining compilation options and variables

Use a brief shell scripts for defining environment variables, examples of which are located in ${CORAL_ROOT}/etc/set_env_examples/. In particular, set_env_template.sh provides guidance for writing a script for your own machine.

cd ${CORAL_ROOT}
cp ./etc/set_env_examples/set_env_template.sh ./set_env_myMachine.sh
vi set_env_myMachine.sh
chmod +x set_env_myMachine.sh

Optionally, feel free to mail me clusters environment files, so that to build a database of examples for future users.


Compilation

After creating the environment variables script, source it and compile:

cd ${CORAL_ROOT}
source ./set_env_myMachine.sh
make clean pencils

This will create the executable S{CORAL_ROOT}/build/coral_LP.exe Forgetting to source set_env_myMachine.sh before compilation or execution is a frequent source of errors

Alternatively (or additionally), you may compile the version of the code that relies on a 1D domain decomposition:

cd ${CORAL_ROOT}
source ./set_env_myMachine.sh
make clean slabs

This will create the executable S{CORAL_ROOT}/build/coral_SL.exe