Install SHTOOLS

From Micro and Nano Mechanics Group
Jump to navigation Jump to search

SHTOOLS is a package for spherical harmonics transformation and reconstructions. The current version (SHTOOLS3.4) is available in python 3 and Fortran 95. In this article, we are introducing the installation of SHTOOLS python packages on your own computer and mc2 cluster.

How to Install SHTOOLS on Your Own Computer

On Mac or Linux, you will need to have fortran compiler, lapack/blas, and fftw3 available. This can be done simply by running the following commands with homebrew on Mac:

brew install fftw --with-fortran

or Linux:

sudo apt-get install libblas-dev liblapack-dev g++ gfortran libfftw3-dev tcsh

If you have installed python and the package manager pip, you can install the shtools directly by running the command:

pip install pyshtools

Then if you run command:

pip list

You will see pyshtools library is available in your python packages.

How to Install SHTOOLS on mc2

On mc2 cluster, since we can only install packages for user only, we are not allowed to use sudo command to install the required packages. However, libraries for lapack and blas are available on mc2, we can use them directly for our purpose.