Skip to content

FLUSI general install guide

Thomas Engels edited this page Feb 22, 2023 · 27 revisions

There are currently four steps you will have to follow: FFTW, P3DFFT, HDF5 and FLUSI. You do not need to be root, but you need an MPI implementation to be installed.

Please check out the cluster specific tips&tricks as well!

Please note you need the following tools installed:

  • git
  • mpi (e.g. mpich)
  • gfortran or ifort
  • lapack (.e.g on ubuntu: liblapack-dev)
  • zlib (eg on ubuntu: zlib1g-dev)

Install FFTW

FFTW is the basic fast Fourier transform. It is used by P3DFFT, which is actually only a wrapper for FFTW. Note on many machines, FFTW is already installed, but you still have to worry about linking it to flusi. It's not really hard to install FFTW, so we suggest you simply install it in your home folder.

cd $HOME  
mkdir src
cd src
wget http://www.fftw.org/fftw-3.3.3.tar.gz  
tar vxzf fftw-3.3.3.tar.gz
cd fftw-3.3.3  
./configure --prefix=$PWD --enable-sse2 --enable-openmp  --enable-mpi
make clean
make
make install

Tell flusi where to find FFTW:

export FFT_ROOT=$PWD
# you might want to add this to your .bashrc:
echo "export FFT_ROOT=$HOME/src/fftw-3.3.3" >> $HOME/.bashrc

Note: on some newer machines, depending on the configuration, the compiler builds the library in $FFT_ROOT/lib64 and not in $FFT_ROOT/lib. In that case, please make a softlink ln -s lib64/ lib/

Install P3DFFT 2.6.1

Since 2014, FLUSI/MHD rely on the newest version of P3DFFT, which allows "true" 2D simulations by setting nx=1. To install it:

cd ${HOME}/src
wget https://p3dfft.googlecode.com/files/p3dfft-dist.2.6.1.tar
tar xf p3dfft-dist.2.6.1.tar
mv p3dfft-dist.2.6.1 p3dfft-2.6.1

or

cd ${HOME}/src
git clone https://github.com/sdsc/p3dfft.git

enter the directory and configure P3DFFT

cd ${HOME}/src/p3dfft-2.6.1
./configure --prefix=$PWD --enable-gnu --enable-fftw --with-fftw=${FFT_ROOT}  --enable-measure --enable-stride1 LDFLAGS="-lm"

Note: as of 2022, P3DFFT does not compile anymore (compiler complains about type mismatch). A workaround is to modify the configure line;

./configure --prefix=$PWD --enable-gnu --enable-fftw --with-fftw=${FFT_ROOT}  --enable-measure --enable-stride1 LDFLAGS="-lm" FCFLAGS="-fallow-argument-mismatch"

Other flags for configuring P3DFFT can be found here: https://github.com/sdsc/p3dfft/wiki/Install

make clean
make -j1
make install

Note: it may happen that the first make does not succeed: it fails to compile the C examples. We don't need these, and the library is still build, so you can actually hit make install

Note: in some cases, p3dfft will be installed using a lib64/ directory. If that happens, just create a link to it using ln -s lib64/ lib

You need to have the following files:
include/p3dfft.mod
lib/libp3dfft.a

Install HDF5

Flusi saves most of its output in *.h5 files, since the HDF5 library solved previous problems with the domain decomposition. HDF5 handels the ordering of data for us. As for FFTW, on many machines this can be installed from the official software repos. In this case, it is sufficient to tell Flusi where HDF5 lives:

export HDF_ROOT="/LOGINSTO/softs/hdf5/intel/1.8.8/"

If HDF5 is properly installed, your compiler already knows where to find it (this was the case on my Fedora 18 system). Then you can just leave the path empty:

export HDF_ROOT=""

This is, of course, only an example (from the mesocentre). As for FFTW, you might want to install HDF in your home directory:

cd $HOME/src/hdf5
wget http://www.hdfgroup.org/ftp/HDF5/current/src/hdf5-1.8.13.tar.bz2
tar vxjf hdf5-1.8.13.tar.bz2
cd hdf5-1.8.13
./configure --prefix=$PWD --enable-fortran --enable-parallel
make
make install
export HDF_ROOT=$HOME/src/hdf5-1.8.13
echo "export HDF_ROOT=$HOME/src/hdf5-1.8.13" >> $HOME/.bashrc

You may need to add the following string in your .bashrc

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${HDF_ROOT}/lib

Install FLUSI

First you'll need to get the newest version using git:

git clone https://github.com/pseudospectators/FLUSI.git

To sum up, you have to have specified the following environment variables:

export FFT_ROOT="${HOME}/src/fftw/"
export HDF_ROOT="${HOME}/src/hdf5"
export P3DFFT_ROOT="${HOME}/src/p3dfft-2.6.1"

This is valid of course only for this guide. If you use preinstalled HDF5 or FFTW, the variables are different.

Since 'master' branch is beta, it is recommended to use the latest stable branch. As of December 2017, this is 'stable_2017':

git checkout stable_2017

Install LAPACK

Since 17 jul 2014, compiling flusi requires the LAPACK library (it is used in the solid model). On desktop machines, it can easily be installed with your package management system. On the clusters, it is preinstalled.

module load lapack

in the makefile, line 85 reads

LDFLAGS += -llapack

this flag may not be required on all machines.

Compiler options

Before you compile flusi, you have to specify the compiler options. They are specified in the variable FFLAGS

# ifort:
export FFLAGS="-O3 -xW -fpp -r8"
# gfortran:
export FFLAGS="-g"

Note that the -g flag for gfortran adds debugging symbols; good for debugging, bad for code speed.