Install

EDIpack2 is available in the form of a static Fortran library (libedipack2.a) and the related Fortran module EDIPACK2. The release version includes additional modules to extend the software functionalities: an inequivalent impurities extension EDIpack2ineq and a shared dynamical library implementing the Fortran-C interface.

A standard installation method is available through CMake.

An alternative approach is provided via Anaconda.

From source

Building

We assume that SciFortran and MPI have been correctly installed and are available in the system. See related documentation. Note that the installation of EDIpack2 closely follows the SciFortran template.

Clone the repo:

git clone https://github.com/edipack/EDIpack2.0 EDIpack2

Optionally define the fortran compiler:

export FC=mpif90/gfortran/ifort

From the repository directory (cd EDIpack2) make a standard out-of-source CMake compilation:

GNU Make

Using GNU make is the default CMake workflow, with widest version support (CMake > 3.0). Note that parallel make execution is tested and working.

mkdir build
cd build
cmake ..
make -j

Ninja

Using ninja if a fortran-capable version of ninja is available in your system (and CMake can take advantage of it), you can use it to build the library at lightning, multi-threaded, speed.

mkdir build
cd build
cmake -GNinja ..
ninja

The CMake compilation can be customized using the following additional variables:

CMake Options

Option

Scope

Value

-DPREFIX

prefix directory

~/opt/EDIpack2/VERSION/PLATFORM/[GIT_BRANCH]

-DUSE_MPI

MPI support pre-compilation flag

yes/True OR no/False (default: True)

-DWITH_INEQ

Include inequivalent impurities extension (in EDIPACK2INEQ)

yes/True OR no/False (default: True)

-DVERBOSE

Verbose CMake output

yes/True OR no/False (default: True, superseded by make VERBOSE=yes/no

-DBUILD_TYPE

Compilation flags

RELEASE/TESTING/DEBUG/AGGRESSIVE (Default RELEASE)

Warning

BUILD_TYPE=AGGRESSIVE includes many deep level debug options which might not compile on some systems or breakdown compilation at linking step.

The default target builds either the main library and the C-binding. A specific building for each library is also available specifying the required target. For user convenience at the end CMake configuration step the following recap is printed:

*Build edipack2 [Default]:
$ make -j [all/edipack2, default=all]

*Build C-bindings:
$ make edipack2_cbinding

*Install:
$ make [all/edipack2/edipack2_cbinding, default=all] install

*Uninstall:
$ make uninstall

*Build documenation:
$ make doc

*Build and Runtest:
$ make test

Installing

System-wide installation is completed after the build step using either:

make install

or

ninja install

Please follow the instructions on the screen to complete installation on your environment. The library can be loaded using one of the following, automatically generated, files :

  • A generated environment module , installed to ~/.modules.d/edipack2/<PLAT>

  • A generated bash script at <PREFIX>/bin/configvars.sh, to be sourced for permanent loading.

  • A generated pkg-config file to, installed to ~/.pkg-config.d/edipack2.pc

For ease of use a specific and automatically generated recap message is printed after installation.

Uninstalling

Although CMake does not officially provide uninstall procedures in the generated Make/Ninja files. Hence SciFortran supplies a homebrew method to remove the generated files by calling (from the relevant build folder):

make uninstall

or

ninja uninstall

From Anaconda

We provide Linux and MacOS packages for the Anaconda distribution. To install the module, the virtual environment of choice should include python 3.10 or later.

Once a command-line tool such as conda or mamba is installed, an environment using one of the available python version can be created, and then the EDIpack2.0 package can be installed:

conda create -n edipack
conda activate edipack
conda install -c conda-forge -c edipack edipack2

this installs a bundle of the scifor and edipack2 libraries. In order to compile a fortran program linking the libraries, we provide .pc files which are readable via pkg-config. If not present, the compilers and pkg-config conda packages need to be installed

conda install compilers
conda install pkg-config

The inclusion and linking flag can then be obtained via

pkg-config --cflags edipack2 scifor
pkg-config --libs   edipack2 scifor