Home What is? Install Overview CTQMC MnO FeSe SrVO3 LaVO3 Cerium Sr2IrO4

Installation of DFT+ Embedded DMFT Functional

The program consists of many independent programs and executables, which are written in C++, fortran90, and Python. Here you can download its
tarball.
Before you start the installation, you should check your system if the required packages are installed, which include:


The simplest type of compilation (after un-taring the code tar xzvf EDMFTF.tgz) consist of running the python setup script, i.e.,
python setup.py

To clean the previous compilation (all object files and libraries, but not removing the final binary files), you should type
python setup.py --clean

However, before you start compilation, it is advisable to first edit configure.py file, which contains information about existing libraries. There are several examples of the configuration script provided, for example, configure.py.macos, configure.py.intel, configure.py.gnu. If you are trying the code on MacOS, simply copy configure.py.macos to configure.py.
The configuration script, which is being used by the program, is called configure.py, and by default it takes the form:
  
#! /usr/bin/env python
# -*- coding: utf-8 -*-

class Config:
  prefix      = "./bin"        # Installation path

  compiler    = "INTEL"        # Compiler
  
  cflags      = "-O3"          # compiling flags for C++ programs
  fflags      = "-O3"          # compiling flags for Fortran programs
  ldflags     = ""             # linking flags for Fortran programs
  ompflag     = "-fopenmp"     # linker/compiler flag for openmp

  mpi_define  = "-D_MPI"       # should be -D_MPI for mpi compilation and empty for serial compilation.
  pcc         = "mpicc"        # C compiler 
  pcxx        = "mpicxx"       # C++ compiler 
  pfc         = "mpif90"       # Fortran compiler 
  
  blasname    = "MKL"          # BLAS   library
  blaslib     = "-mkl"         # BLAS   library
  lapacklib   = ""             # LAPACK library
  fftwlib     = "-L/opt/fftw/lib64 -lfftw3_omp -lfftw3"     # FFTW   library
  gsl         = "-L/usr/lib64/  -lgslcblas -lgsl"           # GSL    library

  f2pylib     = "--f90flags='-openmp ' --opt='-fast'" # adding extra libraries for f2py
  f2pyflag    = "--opt='-O3' " # adding extra options to f2py

  arflags     = "rc"           # ar flags

  make        = "make"
  def __init__(self, version):
    self.version = version
  def __getattr__(self,key):
    return None
The first variable prefix specifies the directory for the binaries, i.e., where the binaries will be copied during installation. The second variable compiler specifies that we will use intel compilers (ifort and icc). The alternative for this variable is "GNU", which will than use gcc and gfortran. Next we specified the optimization flags for C++ and fortran code (cflags, fflags). The linkking flags (ldflags) for fortran code sometimes need extra flags, but they are empty by default.

If the compilers support OpenMP, we should set
ompflag     = "-fopenmp"
If the parallel mpi version of C, C++ and fortran compilers exist, we should set the following variables mpi_define, pcc, pcxx, pfc, as specified above. Of course, the variables should be set to the names of respective compilers. Alternatively, if no mpi exists, we can set
mpi_define     = ""
Next we specify the blas library. If you can use intel MKL, you should set blasname to "MKL", and blaslib to "-mkl", or similar. The details of this last linking command might depend on the installation. On MacOS, for example, the intel library is contained in Accelerate library. In this case, blasname can be empty, and blaslib can be set to Accelerate library, i.e.,
  blasname    = ""             # BLAS   library
  blaslib     = "-framework Accelerate" # BLAS   library
  lapacklib   = ""             # LAPACK library
Next, we should specify the fftw library. In the simplest case, we should just have
  fftwlib     = "-lfftw3"     # FFTW   library
If the OpenMP version of the fftw library is available, we can add -lfftw3_omp. Finally, if the fftw library is not in one of the standard directories, where the compiler can find it, you should use the -L option, to specify the exact path of the library, as shown in the sample configuration script above. Finally, the gsl library should be specified, if you already have it installed (otherwise the variable should be set to empty string). In the simplest case (on Mac OS), we should just specify
  gsl         = "-lgsl"  # GSL    library
On many linux systems, the cblas library should also be linked with gsl, because some routines in gsl need cblas. To do that, specify
  gsl         = "-lgslcblas -lgsl"     # GSL    library 
Finally, if one of the two libraries is not found by the linker, because it is in non-standard place, please use -L linking options.

In several parts of the code, we use f2py compiler, to convert fortran code into python modules. It is a good idea to optimize these modules, by allowing "openmp" during f2py compilation. This is done by specifying
  f2pylib     = "--f90flags='-openmp ' --opt='-fast'" # adding extra libraries for f2py


This was description of generic configuration script. For Mac OS, the configuration script should take the following form
#! /usr/bin/env python
# -*- coding: utf-8 -*-

class Config:
  prefix      = "./install"    # Installation path

  compiler    = "GNU"          # Compiler
  cxx         = "g++-5"        # C++ compiler
  
  cflags      = "-O3"          # compiling flags for C++ programs
  fflags      = "-O3"          # compiling flags for Fortran programs
  ldflags     = ""             # linking flags for Fortran programs
  ompflag     = "-fopenmp"     # linker/compiler flag for openmp

  mpi_define  = "-D_MPI"       # should be -DMPI for mpi code and empty for serial code.
  pcc         = "mpicc"        # C compiler 
  pcxx        = "mpicxx"       # C++ compiler 
  pfc         = "mpif90"       # Fortran compiler 
  
  blasname    = ""             # BLAS   library
  blaslib     = "-framework Accelerate" # BLAS   library
  lapacklib   = ""             # LAPACK library
  fftwlib     = "-lfftw3_omp -lfftw3"     # FFTW   library
  gsl         = "-lgsl"  # GSL    library

  f2pylib     = "--f90flags='-openmp '" # adding extra libraries for f2py
  f2pyflag    = "--opt='-O3' " # adding extra options to f2py

  arflags     = "rc"           # ar flags

  make        = "make"
  def __init__(self, version):
    self.version = version
  def __getattr__(self,key):
    return None


After the installation is complete, the following variables should be set in your .bashrc (or equivalent):
WIEN_DMFT_ROOT
PYTHONPATH
WIENROOT
SCRATCH
EDITOR
The last three should be specified during Wien2k installation, and in general do not need to be changed now. It is however advisable to set SCRATCH to current directory. For example, typical installation will have the following variables set to
export WIEN_DMFT_ROOT=$HOME/dmftf_w2k/bin  
export PYTHONPATH=$PYTHONPATH:$WIEN_DMFT_ROOT  
export WIENROOT=$HOME/wien2k
export SCRATCH="." 
export EDITOR="emacs -nw"
export PATH=$WIENROOT:$WIEN_DMFT_ROOT:$PATH