Installation and advice

Dependencies

  • Python >= 3.6

  • a C++11 compiler (for example GCC>=4.9 or Clang)

  • Numpy

    Make sure to correctly install numpy before anything.

  • Transonic

  • Pythran

    We choose to use the new static Python compiler Pythran for some functions of the operators. Our microbenchmarks show that the performances are as good as what we are able to get with Fortran or C++!

    Warning

    To reach good performance, we advice to try to put in the file ~/.pythranrc the lines (it seems to work well on Linux, see the Pythran documentation):

    [pythran]
    blas = openblas
    complex_hook = True
    
  • Spherical harmonics libraries

Supported SHT libraries and their installation

SHTns

SHTns is a high performance library for Spherical Harmonic Transform written in C, aimed at numerical simulation (fluid flows, mhd, …) in spherical geometries. It scales using OpenMP, SIMD, and with beta-support for CUDA. It is probably the fastest implementation for moderately sized grids.

SHTns uses a simple GNU Autotools based installation procedure:

hg clone https://foss.heptapod.net/nschaeff/shtns
cd shtns
hg update v3.3.1
./configure --enable-openmp --enable-python
make
python setup.py install

Note

SHTns depend on an FFTW installation. To install FFTW see the relevant FluidFFT documentation.

If you have setup spack, follow the instructions in the fluiddyn/spack-packages repo and the above can be done as follows (needs improvement):

spack install shtns+openmp+python
module load shtns

SHTOOLS

Warning

API not implemented yet!

Simply install as:

pip install pyshtools

Libsharp

Warning

API not implemented yet!

Libsharp has an MPI implementation to perform SHT analysis and synthesis. Installation is possible as:

pip install mpi4py numpy cython
git clone https://github.com/Libsharp/libsharp
cd libsharp
autoconf
./configure --enable-pic
make -j

# Run tests - optional
pip install nose
make pytest

# Install
cd python
LIBSHARP=../auto python setup.py install

Note

Due to lack of documentation it is hard (not impossible) to implement an API bridge. The development of libsharp seems to have resumed recently and it looks promising. Now it uses pybind11: https://gitlab.mpcdf.mpg.de/mtr/libsharp/

The new library pysharp can be installed as follows:

git clone https://gitlab.mpcdf.mpg.de/mtr/libsharp
cd libsharp
autoreconf -i
CC=mpicc CFLAGS="-DUSE_MPI -std=c99 -O3 -march=native -ffast-math" ./configure
make- j

# Install
cd python
LDFLAGS="-L../.libs/" python setup.py install
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$(realpath ../.libs)"