A couple of libraries are used extensively by programs used by ITC members. These are compiled and available on Sauron (and the nodes). One complication is of course that the libraries need to be (usually) compiled using the same compiler as the executable linking to the libraries. So on Sauron there is a choice of libraries.
GNU science library (gsl) encapsulates a large number of standard scientific operations. It is used by Gadget v2.
Fastest Fourier Transform in the West (FFTW) is, as the name suggests, a fast fourier transform package. It is also used by Gadget v2.
These are both compiled with all the available compilers on Sauron. But only the one compiled with pgcc is in the standard location. When using mpicc, or pgcc, these libraries can be linked with -lgsl -lgslcblas -lrfftw_mpi -lfftw_mpi -lrfftw -lfftw. Note that FFTW is compiled without type prefix.
When using the GNU compilers, use the following rules to link to the correct libraries.
GSL_INCL = -I/usr/local/gsl.gcc/include GSL_LIBS = -lgsl_gcc -lgslcblas_gcc FFTW_INCL= -I/usr/local/fftw.gcc/include FFTW_LIBS= -lrfftw_mpi_gcc -lfftw_mpi_gcc -lrfftw_gcc -lfftw_gcc
When using Intel's compilers, use the rules:
GSL_INCL = -I/usr/local/gsl.icc/include GSL_LIBS = -L/usr/local/gsl.icc/lib FFTW_INCL= -I/usr/local/fftw.icc/include FFTW_LIBS= -L/usr/local/fftw.icc/lib
Additionally because the libraries are in non-standard location, when using the Intel compilers use the -static flag (both when producing the object file and linking). This allows the code to run on the nodes.