Diva on web on Ubuntu

From GHER

Jump to: navigation, search

This guide was actualized for Ubuntu 14.04

Most packages for "Diva on web" are already in Ubuntu's repositories, can be installed with:

sudo apt-get install python-scipy  python-matplotlib python-mpltoolkits.basemap python-lxml python-netcdf python-imaging apache2  \
                     libgeos-dev libapache2-mod-wsgi octave libnetcdf-dev libhdf5-dev octave-octcdf python-egenix-mxdatetime \
                      gfortran python-setuptools python-dev python-setuptools libav-tools

Recommended packages:

sudo apt-get install ipython netcdf-bin build-essential

Other packages must be installed from source:

Contents

Basemap

The basemap package can be installed from source by

wget -O - 'http://ovh.dl.sourceforge.net/sourceforge/matplotlib/basemap-0.99.3.tar.gz' | tar zxf -
cd basemap-*
python setup.py build
sudo python setup.py install


For a more recent matplotlib, one has to install it from source. It can be conveniently done by "easy_install" which belongs to the package python-setuptools:

sudo easy_install numpy
sudo apt-get  build-dep python-matplotlib
wget http://downloads.sourceforge.net/matplotlib/matplotlib-0.98.5.2.tar.gz
tar zxf matplotlib-0.98.5.2.tar.gz
cd matplotlib-0.98.5.2
python setup.py build
sudo python setup.py install
sudo easy_install scipy
sudo easy_install basemap
PYTHONPATH=$HOME/Python/packages easy_install -d $HOME/Python/packages basemap-0.99.4.tar.gz

NetCDF or OPeNDAP

OPeNDAP

Build requirements for OPeNDAP

sudo aptitude install libcurl4-openssl-dev libxml2-dev

Compilation of OPeNDAP:

export VER=3.8.2
wget -O - http://www.opendap.org/pub/source/libdap-$VER.tar.gz | tar zxvf -
cd libdap-$VER
./configure
make -j 2
#make check 
sudo make install
export PATH="/usr/local/bin:$PATH"
cd ..

Compilation of NetCDF library with OPeNDAP support:

export VER=3.7.3
wget -O - http://www.opendap.org/pub/source/libnc-dap-$VER.tar.gz | tar zxvf -
cd libnc-dap-$VER
./configure
make -j 2 
#make check
sudo make install
cd ..
sudo ldconfig


NetCDF4

See NetCDF4


Installation in a virtual environment

mkdir ~/web-vis
cd  ~/web-vis
virtualenv --no-site-packages ~/web-vis/env
source env/bin/activate
easy_install numpy==1.3.0
wget http://downloads.sourceforge.net/project/matplotlib/matplotlib/matplotlib-0.98.5/matplotlib-0.98.5.3.tar.gz
wget http://downloads.sourceforge.net/project/matplotlib/matplotlib-toolkits/basemap-0.99.4/basemap-0.99.4.tar.gz
easy_install matplotlib-0.98.5.3.tar.gz
easy_install basemap-0.99.4.tar.gz


Install in custom directory

Make sure that the following packages are installed:

python-setuptools
python-dev
gfortran
HDF5 and NetCDF4

If HDF5 and NetCDF4 are installed in non-default locations, it is necessary to set the following variables, e.g.

export HDF5_DIR=$HOME/opt/netcdf-4.0
export NETCDF4_DIR=$HOME/opt/netcdf-4.0


In some cases you might want to install diva-on-web and its dependencies in a non-default directory, e.g. '$HOME/Python/packages':

export PYTHONPATH="$PYTHONPATH:$HOME/Python/packages" # add this to your shell start-up file (e.g. .bashrc)
easy_install --install-dir ~/Python/packages divaonweb.tar.gz

Oddly, sometimes the easy_install commands returns and error. Repeating the same command and sometimes the error goes away.

Personal tools