Installation for Linux / Mac from scratch

1) Install CFITSIO. Use brew, macport of fink if you can. Otherwise, to build from source you can download the code from here and install it with

>> ./configure
>> make
>> make install.

2) Install FFTW. Again, use brew, macport of fink if you can. Otherwise, download the code from here and install it with

>> ./configure --prefix=absolute-fftw-directory --enable-shared --with-pic
>> ./make
>> ./make install

3) Download HEALPIX_3.xx from here and run

>> ./configure 
Configure the C code only (i.e. main option 2) with correct location for CFITSIO. No change to any other option, no even compiler flags.

4) IMPORTANT NOTE : a common problem is that the MEX compiler is only compatible with a few versions of gcc. For example I personally had gcc-4.7.2 installed and MEX was complaining a lot about it. So I had to download a version of GCC compatible with MEX. For me it was gcc-4.4. Also, MEX is annoying and needs the right gcc and g++ symbolic links. So I renamed gcc into gcc-4.7.2 and made gcc-4.4 the default compiler (at least for the installation). The easiest approach was to run something like:

>> sudo apt-get install gcc-4.4
>> sudo apt-get install g++-4.4
>> sudo mv /usr/bin/gcc /usr/bin/gcc-backup-of-higher-version
>> sudo cp /usr/bin/gcc-4.4 /usr/bin/gcc
>> sudo cp /usr/bin/g++-4.4 /usr/bin/g++
Then MEX should find the right compilers and not complain.

5) Install SSHT: Modify the ssht makefile with the right path for FFTW and MATLAB

>> make
>> ./bin/c/ssht_test 128 0
>> make matlab

6) Install SO3: Modify the so3 makefile with the right path for FFTW and MATLAB

>> make
>> make matlab

7) Install S2LET (explained in further details in other pages): modify the s2let makefile with the right path for FFTW, SO3, CFITSIO, and MATLAB. I also had to change the order in the linking command and add fPIC

>> make
>> ./bin/c/s2let_test
>> make matlab

7) Open Matlab, add the SSHT, SO3, and S2LET matlab source directories to the PATH (respectively in src/matlab and src/main/matlab) In MATLAB, test the two packages and the plotting routines by running ssht_demo1 and s2let_demo1 for example.