Building Metlibs and Diana with Autotools

OUTDATED: This page is no longer up to date, diana and metlibs are now built using cmake.

This document describes how to build the Diana application and its main dependencies (Fimex and Metlibs) from source code, focusing on Ubuntu 12.04 (Precise) and Fedora 20. We provide commands to install further dependencies as they are needed, but this assumes that previous steps have been followed. For example, we list the common dependencies between Metlibs and Fimex as Fimex dependencies.

This section describes the basic set of packages that will be required to build the software.

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

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

On Fedora 20, this command has been found to install a reasonable base set of tools:

sudo yum install gcc-c++ make wget tar subversion autoconf automake \
                 findutils libtool flex bison autoconf-archive \
                 gcc-gfortran file

Obtain the latest source code from the source code repositories. Currently, fimex, metlibs and Diana are held in git repositories:

fimex:

git clone https://github.com/metno/fimex.git

metlibs:

git clone https://github.com/metno/metlibs-milogger.git
git clone https://github.com/metno/metlibs-puctools.git
git clone https://github.com/metno/metlibs-putools.git
git clone https://github.com/metno/metlibs-pudatatypes.git
git clone https://github.com/metno/metlibs-qutilities.git
git clone https://github.com/metno/metlibs-coserver.git

Diana:

git clone https://github.com/metno/diana.git

Install the dependencies using the following command:

sudo apt-get install libxml2-dev libproj-dev libudunits2-dev \
                     libnetcdf-dev libgrib-api-dev libjasper-dev libpng12-dev \
                     libjpeg-dev libpq-dev liblog4cpp5-dev \
                     libboost-filesystem-dev libboost-system-dev \
                     libboost-iostreams-dev libboost-program-options-dev \
                     libboost-regex-dev libboost-test-dev \
                     libboost-date-time-dev

Install the dependencies using the following command:

sudo yum install boost-devel libxml2-devel udunits2-devel \
                 netcdf-devel grib_api-devel jasper-devel libpng-devel \
                 libjpeg-turbo-devel libpqxx-devel log4cpp-devel \
                 proj-devel udunits-devel

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

Without optional libraries:

sudo apt-get install ftgl-dev libhdf4g-dev libtiff4-dev libqt4-dev proj \
                     libmysqlclient-dev liblog4cpp5-dev libcurl4-gnutls-dev \
                     libgeotiff-dev libboost-thread-dev

With optional libraries:

sudo apt-get install ftgl-dev libhdf4g-dev libhdf5-serial-dev libtiff4-dev \
                     libqt4-dev proj libmysqlclient-dev libpqxx-dev \
                     libomniorb4-dev omniidl4 libldap2-dev liblog4cpp5-dev \
                     libcurl4-gnutls-dev libgeotiff-dev libboost-thread-dev
sudo yum install ftgl-devel libgeotiff-devel mesa-libGL-devel mesa-libGLU-devel \
                 qt-devel

Diana can be configured to be used for creating animations. If this is desired then libavformat and its development headers need to be installed. On Ubuntu 12.04, a package exists for the optional EMOSLIB dependency, required to support viewing of observation files. However, it is not available for every distribution.

sudo apt-get install libemos-dev libgrib-api-dev libshp-dev libxt-dev

For observation buffer support in Diana, install EMOSLIB from source.

sudo yum install grib_api-devel shapelib-devel

Enter the fimex directory and configure the library with the following command:

./configure

If you want to install the library in an alternative location, specify it using the --prefix option; for example, use the following command to specify a directory inside the user's home directory:

./configure --prefix=$HOME/diana

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.

Enter the subdirectories for each of the metlibs modules, configuring, building and installing them using the scripts listed below. Note that, by default, the libraries will be installed under /usr/local unless you specify a prefix to the configure script, such as --prefix=$HOME/diana to install the libraries in the diana directory inside the user's home directory.

#/bin/sh

set -e

THIS_DIR=`pwd`
# uncomment next line on Fedora
#PREFIX="--prefix=/usr/local"
SUDO=sudo

for l in milogger puctools putools pudatatypes qutilities coserver; do
  cd "$THIS_DIR/metlibs-$l"
  ./autogen.sh && ./configure $PREFIX && make
  $SUDO make install
done

Note: By default, support for observation buffers is conditionally enabled and video export is enabled. To disable video support, append the --disable-video-support option to the command line you use to configure the build.

Enter the diana directory. If you have root privileges on your system, configure the library by running the configure script:

./autogen.sh
./configure --enable-xlib --enable-geotiff

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), use the --prefix option to specify the installation directory:

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

Enter the diana directory. If you have root privileges on your system, configure the library by running the configure script:

./autogen.sh
./configure --enable-xlib --enable-geotiff --prefix=/usr/local \
            --with-png-libdir=/usr/lib64 --enable-vcross-v2 --with-udunits2-includedir=/usr/include/udunits2

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), use the --prefix option to specify the installation directory:

./autogen.sh
./configure --enable-xlib --enable-geotiff --prefix=$HOME/diana \
            --with-png-libdir=/usr/lib64 --enable-vcross-v2 --with-udunits2-includedir=/usr/include/udunits2

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.

If you want to use the video export function, you have to install the avconv utility.

  • Ubuntu/Debian: sudo apt-get install libav-tools

See the Installing Data Files section of the Getting Started document for instructions about configuring and running Diana.

This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
  • diana/autotools.txt
  • Last modified: 2022-05-31 09:29:31
  • (external edit)