Installing SPHARM on a fresh Ubuntu 10.10 Installation

As a long-standing SPHARM user I thought I'd just post a quick doc about how I installed this on Ubuntu 10.10. I've generally run the SPHARM toolbox on Ubuntu as a virtual machine on various flavours of Mac, as having it in a VM (with access to the host machine's file system) has allowed me to keep it portable. 

My procedure has been:

1. Install Ubuntu (most recently I installed 10.10, 64-bit)
2. Download SPHARM - the toolkit that matches your Ubuntu distribution (for this, the 64-bit version)
3. Unzip the file (unzip filename.zip)
4. Move it to somewhere you want to keep it. For me, I put my neuroimaging tools in /usr/local/bin/ so I rename the spharm directory to the name "spharm", and then: sudo mv spharm /usr/local/bin
5. Add it to your path: on Ubuntu, this means editing the bash profile so: sudo gedit /etc/bash.bashrc
    And then add in this text to the file in the text editor:
    PATH=$PATH:/usr/local/bin/spharm
    export $PATH
6. Install a few key libraries: sudo apt-get install liblapack3gf libblas3gf libgfortran3 libreadline5 (these install lapack3, blas3, gfortran and history - all required libraries)
7. Make dynamic links for three of these libraries (as SPHARM is expecting older libraries than those in the latest Ubuntu):
    cd /usr/lib
    sudo ln -s liblapack.so.3gf liblapack.so.3
    sudo ln -s libblas.so.3gf libblas.so.3 
    sudo ln -s libgfortran.so.3 libgfortran.so.1
8. Install TCL and TK: sudo apt-get install tcl8.4 tk8.4 vtk-tcl (we are installing 8.4 here, not 8.5)
9. Rename the TCL and TK lib files to the filename that SPHARM recognises:
    cd /usr/lib
    sudo mv libtk8.4.so.0 libtk8.4.so
    sudo mv libtcl8.4.so.0 libtcl8.4.so
10. Test that it's all worked. I run two commands from the command line: shapeAnalysisMANCOVA (it should display the various options) and KWMeshVisu (it should boot up to the GUI for this tool).

I'm pretty sure that's it - I've just had to re-do this myself as a corrupt hard drive took two of my virtual machines with it (both running SPHARM, one being Ubuntu 8.04, one 10.10) and had to re-install. If I find anything else that needs adding in here, then I'll update this document.

Finally, please note that I've done this for the command-line tools only as these are what i use - I do all SPHARM-related analyses from the command line. 

Regards
Mark Walterfang