SHTns  2.6.5
Using SHTns in a C program

To make SHTns known by your C program, add

#include <fftw3.h>
#include <shtns.h>

in the preamble of your source file.

First of all you need to initialize SHTns. There are two ways to do this :

Multi-threaded transforms can be enabled (if available, see Compiling and installing SHTns) by a call to shtns_use_threads before shtns_init or shtns_create.

Then you must allocate some memory (with fftw_malloc so that the memory is properly aligned for vectorized code), and finally you can perform some spherical harmonic transforms.

See Also
Look at shtns.h for the function definitions and documentation.
See the C example for a simple usage of SHTns in a C program.

When your program is ready, compile it adding these options to the compiler (gcc) :

-L/path/to/lib/ -I/path/to/include/ -lshtns -lfftw3 -lm