Building Metlibs and Diana with Autotools

Warning: This page is currently being revised. Details may be incorrect and are subject to change.

Obtaining the source code

Obtain the latest source code from the subversion repositories:

fimex:

svn co https://svn.met.no/fimex/tags/version0_51 fimex

metlibs:

svn co https://svn.met.no/metlibs/common
svn co https://svn.met.no/metlibs/diana-support
svn co https://svn.met.no/metlibs/gl-support
svn co https://svn.met.no/metlibs/tseries-support
svn co https://svn.met.no/metlibs/qt-utilities

Diana:

svn co https://svn.met.no/diana/trunk diana

Prerequisites

Ubuntu 12.04 (Precise)

On a clean stock Ubuntu Precise (12.04) install, you will first need to install build tools:

build-essential

autoconf

automake

libtool

subversion

sudo apt-get install build-essential autoconf automake libtool subversion gfortran

Fedora 20

sudo yum -y install gcc-c++ make wget tar subversion automake findutils libtool

Fimex

sudo yum -y install udunits2-devel boost-devel proj-devel udunits-devel libxml2-devel netcdf-devel

Metlibs

Next, you will need to install various third-party libraries that Metlibs and Diana depend on:

Ubuntu 12.04 (Precise)

Without optional libraries:

sudo apt-get install flex bison ftgl-dev libhdf4g-dev libtiff4-dev libqt4-dev proj \
libboost-dev libboost-date-time-dev libboost-serialization-dev \
libboost-thread-dev libmysqlclient-dev liblog4cpp5-dev libcurl4-gnutls-dev

With optional libraries:

sudo apt-get install flex bison ftgl-dev libhdf4g-dev libhdf5-serial-dev libtiff4-dev \
libqt4-dev proj libboost-dev libboost-date-time-dev \
libboost-serialization-dev libboost-thread-dev libgeotiff-dev \
libfimex-dev libmysqlclient-dev libpqxx-dev \
libomniorb4-dev omniidl4 libldap2-dev liblog4cpp5-dev libcurl4-gnutls-dev

Fedora 20

sudo yum -y install log4cpp

Diana

libshp-dev

libavformat-dev (Optional)

libxt-dev

Without optional libraries:

sudo apt-get install libshp-dev libxt-dev

With optional libraries:

sudo apt-get install libshp-dev libavformat-dev libxt-dev

For observation buffer support in Diana:

EMOSLIB (no package; install manually from source)

For GRIB support in Metlibs and Diana:

GRIB API (no package; install manually from source)

For fimex support in Metlibs and Diana:

libfimex-dev (no package; install manually from source)

Except for those marked with (*), configure will terminate with an error message if any required package is absent.

Installation

Metlibs

Enter the subdirectories for each of the metlibs modules, configuring, building and installing them in the order shown below. Note that, by default, the libraries will be installed under /usr/local unless you specify a prefix to the configure script.

#/bin/sh
set -e
THIS_DIR=`pwd`
cd $THIS_DIR/common/miLogger/trunk
./autogen.sh && ./configure && make
sudo make install
cd $THIS_DIR/common/puCtools/trunk
./autogen.sh && ./configure && make
sudo make install
cd $THIS_DIR/common/puTools/trunk
./autogen.sh && ./configure && make
sudo make install
cd $THIS_DIR/tseries-support/puDatatypes/trunk
./autogen.sh && ./configure && make
sudo make install
cd $THIS_DIR/diana-support/diField/trunk
./autogen.sh && ./configure && make
sudo make install
cd $THIS_DIR/diana-support/miRaster/trunk
./autogen.sh && ./configure && make
sudo make install
cd $THIS_DIR/gl-support/glp/trunk
./autogen.sh && ./configure && make
sudo make install
cd $THIS_DIR/gl-support/miFTGL/trunk
./autogen.sh && ./configure && make
sudo make install
cd $THIS_DIR/gl-support/glText/trunk
./autogen.sh && ./configure && make
sudo make install
cd $THIS_DIR/qt-utilities/qUtilities/trunk
./autogen.sh && ./configure && make
sudo make install
cd $THIS_DIR/qt-utilities/coserver/trunk
./autogen.sh && ./configure && make
sudo make install

Otherwise, to configure the library for installation in a directory where you have permission to write files, run the configure script in the following way:

./configure --enable-xfonts --enable-allprofet --with-fimex --prefix=$HOME/diana

where, in this example, we used $HOME/diana to specify a directory called diana in the user's home directory.

Build and install the library with the following commands:

make
make install

You may need root privileges to install the library unless you specified a prefix in the configuration step.

Diana

By default, support for profet and observation buffers is disabled, while video export is enabled.

Unpack the diana archive and enter the directory containing the source files. If you have root privileges on your system, configure the library by running the configure script:

./configure --enable-xlib --enable-geotiff

Otherwise, to configure the library for installation in a directory where you have permission to write files (for example, $HOME/diana for a directory in the user's home directory), run the configure script in the following way:

./configure --enable-xlib --enable-geotiff --prefix=$HOME/diana

Build and install the application with the following commands:

make
make install

You may need root privileges to install the application unless you specified a prefix in the configuration step.