Skip to content

Installation

Markus Wallerberger edited this page Oct 24, 2022 · 16 revisions

General Instructions

Here's how to install w2dynamics. These instruction should work on any standard desktop machine that feature a Fortran compiler and a lapack implementation in a common location.

Prerequisites

Required:

  • cmake > 2.8.5
  • Fortran-90 compatible Fortran compiler
  • C++ compiler that at least exposes the C++11 RNG.
  • working MPI implementation
  • BLAS and LAPACK libraries
  • Python interpreter 2.7 or >= 3.0
  • FFTW3

Optional (the installer will attempt to install these dependencies if they cannot be found):

  • NFFT
  • numpy >= 1.2 with f2py
  • libhdf5 >= 1.6 with Fortran bindings
  • mpi4py
  • h5py
  • scipy >= 0.8
  • configobj

For the installer to be able to install optional dependencies, it either uses python-pip or installs it if it's not available. For that magic to work further packages might be required, e.g. a python that can execute pip, ca-certificates, python development libraries(that's python-dev on Debian)and curl or wget.

Manual installation of pre-requisites

When installing on a local machine, we recommend installing available prerequisites manually, since this is the cleaner and usually more straight-forward option:

  • On Debian, Ubuntu, Linux Mint, and related:

    $ sudo apt-get install cmake g++ gfortran python-scipy python-h5py python-mpi4py \
                           python-configobj libblas-dev liblapack-dev libfftw3-dev
    
  • On Arch:

    $ sudo pacman -S cmake gcc-fortran python2-scipy python2-h5py python2-mpi4py \
                     python2-configobj lapack fftw 
    

Installation

Having said that the actual configuration and installation step is as follows: In the w2dynamics source directory you do:

$ mkdir build
$ cd build
$ cmake ..
$ make CTQMC

to create CTQMC. Or

$ mkdir build
$ cd build
$ cmake ..
$ make MAXENT

to create the maxent binary. NFFT is fetched if missing, if other libraries are missing you just get an error indicating that they are missing. We now get the pip installer in case some relevant python libraries are missing. After compilation of the "all" target you can run make test to run the testsuite with make test.

Instructions for building on MacOS

Here we collect the installation instructions for various alternative package managers on MacOS. in any case you need the prerequisites mentioned in the section above. There is no need to install an additional Lapack and Blas Library since MacOS already brings its own via the Accelerate framework.

Installation using brew.

We can report successful builds using the brew package manager with the following packages:

  • cmake version 3.7.2
  • GNU Fortran (Homebrew GCC 7.1.0) 7.1.0
  • python: stable 2.7.13 (bottled), HEAD
  • numpy: stable 1.13.0 (bottled), HEAD
  • scipy: stable 0.19.0 (bottled), HEAD
  • open-mpi: stable 2.1.1 (bottled), HEAD
  • homebrew/science/hdf5: stable 1.10.1 (bottled)
  • python-configobj probably installed via pip.

Installation using macports

We have observed succesful builds using the following:

$ sudo port install cmake gcc fftw3 py27-scipy py27-h5py py27-mpi4py py27-configobj

Installation on specific clusters

Installation on HCLM

gfortran and OpenBLAS

Use above instructions, but instead of cmake .., use the following:

$ cmake -DPYTHON_LIBRARY=/opt/python/lib/libpython2.7.so \
        -DPYTHON_INCLUDE_DIR=/opt/python/include/python2.7/ \
        -DPYTHON_EXECUTABLE=/opt/python/bin/python \
        -DCMAKE_Fortran_COMPILER=/usr/local/bin/gfortran \
        -DBLAS_LIBRARIES=/opt/OpenBLAS/lib/libopenblas.so \
        -DLAPACK_LIBRARIES=/opt/OpenBLAS/lib/libopenblas.so ..

Note that the cmake line above may also be used by people using Anaconda to point cmake to their $ANACONDA_HOME by replacing /opt/python with $ANACONDA_HOME .

ifort and OpenBLAS(ifort currently not working(Aug. 2017))

Use above instructions, but instead of cmake .., use the following:

$ cmake -DPYTHON_LIBRARY=/opt/python/lib/libpython2.7.so \
        -DPYTHON_INCLUDE_DIR=/opt/python/include/python2.7/ \
        -DPYTHON_EXECUTABLE=/opt/python/bin/python \
        -DCMAKE_Fortran_COMPILER=ifort \
        -DBLAS_LIBRARIES=/opt/OpenBLAS/lib/libopenblas.so \
        -DLAPACK_LIBRARIES=/opt/OpenBLAS/lib/libopenblas.so ..

ifort + MKL(ifort currently not working(Aug. 2017))

First you need to source the relevant mkl environment variables:

$ source /opt/intel/mkl/bin/mklvars.sh intel64

Use above instructions, but instead of cmake .., use the following:

$ cmake -DPYTHON_LIBRARY=/opt/python/lib/libpython2.7.so \
        -DPYTHON_INCLUDE_DIR=/opt/python/include/python2.7/ \
        -DPYTHON_EXECUTABLE=/opt/python/bin/python \
        -DCMAKE_Fortran_COMPILER=ifort \
        -DBLAS_LIBRARIES=-lmkl_rt -DLAPACK_LIBRARIES=-lmkl_rt ..

Installation on the Würzburg cluster

Executing the default installation instructions yields a binary compiled with ifort 10 and linked against the system lapack implementation(ATLAS). Specific installation instructions follow

gfortran + default BLAS implementation

The instructions to compile with gfortran and ATLAS are as follows.

Use above instructions, but instead of cmake .., use the following:

$ cmake -DCMAKE_Fortran_COMPILER=gfortran ..

Intel 2018 + MKL

We have tested this with the Intel Cluster Edition 2018u3 installed to a plain Debian-9 system. We assume that the Intel Compiler is installed under /opt/intel. First you need to source the relevant environment variables of the Intel Compiler:

$ source /opt/intel/bin/compilervars.sh intel64

Then use general build instructions, but instead of cmake .., use the following:

$ cmake -DCMAKE_CXX_COMPILER=icpc -DCMAKE_Fortran_COMPILER=ifort \
        -DLAPACK_LIBRARIES="-lmkl_intel_ilp64 -lmkl_sequential -lmkl_core" ..

ifort-10 + MKL (untested)

First you need to source the relevant mkl environment variables:

$ source /opt/intel/mkl/10.1.0.015/tools/environment/mklvarsem64t.sh 

Then use general build instructions, but instead of cmake .., use the following:

$ cmake -DCMAKE_Fortran_COMPILER=ifort \
        -DBLAS_LIBRARIES="-lmkl_em64t -liomp5 -lpthread -lm" \
        -DLAPACK_LIBRARIES=-lmkl_em64t ..

Installation on the VSC3

The VSC3 has a module system. So please check that the right modules are loaded. The following was reported to work with the Intel Compiler:

Load modules:

$ module purge
$ module load gcc/7.2 intel-mpi/2018 intel-mkl/2018 python/3.6 \
    numpy/1.15.4 scipy/1.3.1 fftw/3.3.7-DP nfft/3.5.1 cmake/3.9.6 \
    mpi4py/3.0.0 hdf5/1.8.18-SERIAL h5py/2.10.0

Then use general build instructions.

Installation on the VSC4

As of May 6, 2020 the following procedure works for recent versions:

(1) Load the following modules

$ module purge
$ module load intel/19.1.3
$ module load intel-mpi/2019
$ module load intel-mkl/2019
$ module load fftw/3.3.10-intel-19.1.3.304-kcawvtk
$ module load nfft/3.4.1-intel-19.1.3.304-zgvk5zw
$ module load cmake

(2) Install anaconda3. Here, make sure to say "yes" when the installer asks whether to initialize anaconda in the .bashrc.

(3) Install mpi4py (importantly, the MPI module has to be loaded before)

$ conda install mpi4py
$ conda install scipy h5py configobj

(4) Use generic build instructions, no additional flags required.

Installation on the SuperMUC(LRZ München)

You have to download and compile NFFT for yourself, the installer can't do this for you on the supermuc.

Modules to be loaded:

1) admin/1.0   2) tempdir/1.0   3) lrztools/1.0   4) intel/17.0   5) mkl/2017   6) poe/1.4
7) lrz/default   8) cmake/3.4   9) szip/2.1  10) hdf5/serial/1.8.15  11) python/2.7_anaconda_mpi
12) git/latest  13) fftw/serial/3.3

Compilation of NFFT:

$ ./configure --prefix=$HOME  --with-fftw3-libdir="$FFTW_LIBDIR" \
              --with-fftw3-includedir="/lrz/sys/libraries/fftw/3.3.3/include/"

fix the LD_LIBRARY_PATH:

$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/lib/

Installing on Anaconda

Installing under Anaconda, one has to be careful to set the correct paths for compilers.

$ my_cc=$(which gcc)        # or icc for intel etc.
$ my_cxx=$(which g++)
$ my_fc=$(which gfortran)

Then make a new environment:

$ conda create -n w2dyn
$ conda activate w2dyn
$ conda install scipy h5py mpi4py configobj

Now, perform the build, where you

$ mkdir build
$ cd build
$ CC=$my_cc CXX=$my_cxx FC=$my_fc cmake ..
$ NPY_DISTUTILS_APPEND_FLAGS=1 make

Thanks to Andreas Weh for the instructions!

Clone this wiki locally