This cookbook is intended to install Tom Marsh's software with the aim of using the Doppler tomography software that he ported to python. In his website, he has a very detailed explanation of every step (I will not repeat it). If you want to understand the "why" of every step, please feel free to check the documentation. However, it is known (even by Tom Marsh himself) that sometimes there are things that go wrong (expect it to happen). This cookbook compiles (pun intended) some of the lessons learnt in the process by Aarran Shaw and myself to successfully install this fantastic code. The cookbook is designed as if you are installing the software from scratch in a brand new machine. Some of the steps might be redundant but for completeness sake, I have added every single step in my log. Hope this helps anyone who wants to install it.

First let's install all the dependencies required:

sudo apt-get install autoconf automake libtool git gfortran libreadline-dev
sudo apt-get install libxerces-c-dev libpcre3-dev libfftw3-dev libcfitsio-dev
sudo apt-get install libcurl4-gnutls-dev xorg-dev csh libpng-dev
sudo apt-get install g++ libpcre3 libpcre3-dev python-plplot python-pip
sudo apt-get install python-sphinx python-numpy python-astropy python-matplotlib
sudo apt-get install ipython python-scipy cython
Sometimes, the astropy and cython versions are not the latest ones and will have conflicts when running the Doppler scripts. Therefore, let's force an update to the latest version:
sudo pip install --upgrade astropy
sudo pip install --upgrade cython

We need to add environment variables for the different compilers as well as directions to PGPLOT and the installation directories.

# Compilers
export CC=/usr/bin/gcc
export CXX=/usr/bin/g++
export PERL=/usr/bin/perl
export FC=/usr/local/bin/gfortran

export PGPLOT_DIR=/usr/local/lib
export PGPLOT_DEV=/Xserve

export TRM_SOFTWARE=/home/juan/trm_software
export CPPFLAGS="-I/home/juan/trm_software/include -I/usr/local/src/pgplot/include"
export LDFLAGS="-L/home/juan/trm_software/lib -L/usr/local/src/pgplot/lib"
export PYTHONPATH=$TRM_SOFTWARE/lib/python2.7/site-packages
export LD_LIBRARY_PATH=/usr/local/src/pgplot/lib:/usr/local/lib:$TRM_SOFTWARE/lib:$LD_LIBRARY_PATH

Now, the trickiest part of the whole installation: PGPLOT. First, let's create following folders:

sudo mkdir /usr/local/src
sudo mkdir /usr/local/src/pgplot
sudo mkdir /usr/local/pgplot
sudo mkdir /usr/local/src/pgplot/lib
sudo mkdir /usr/local/src/pgplot/include
Then, let's download the latest version of pgplot from here. The filename should be something like pgplot5.2.tar.gz. Once you have this, then you need to download Tom's script to install pgplot. Go here to download Go to the directory where you save the script and run the following commands. Make sure to point towards the directory where pgplot5.2.tar.gz resides.

chmod u+x PGPLOT_INSTALL.csh
sudo ./PGPLOT_INSTALL.csh /home/juan/Downloads/pgplot5.2.tar.gz /usr/local/src/pgplot/ /usr/local/pgplot/ gfortran

At this point two things might have happened:

  • 1) The script succesfully ran and no errors ocurred (it is known to happen). You are lucky and can move on to next part.
  • 2) The script had an error on the last part and you might need to do this by hand.
  • This requires to do soft links to the libraries.
    cd /usr/local/src/pgplot/lib
    sudo ln -sf /usr/local/pgplot/
    sudo ln -sf /usr/local/pgplot/libpgplot.a
    sudo ln -sf /usr/local/pgplot/libcpgplot.a
    cd ../include/
    sudo ln -sf /usr/local/pgplot/cpgplot.h
    Whatever happens, try the demo to check if pgplot works
    cd /usr/local/pgplot

    The next step is to install SLALIB. For this you need to send kind email to Tom Marsh so he can provide you with a link to the download file. Check the documentation to see why this is. Anyway, once you have it. Go to the directory where you saved it and run the following code:

    tar -zxvf sla.tar.gz
    cd sla-1.0.4
    sudo make install
    sudo updatedb

    At this point, you are ready to install all the software.