Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
diana:autotools [2012-10-25 08:33:40]
lisbethb
diana:autotools [2022-05-31 09:29:31] (current)
Line 1: Line 1:
 ====== Building Metlibs and Diana with Autotools ====== ====== Building Metlibs and Diana with Autotools ======
  
-  Download source 3.29.2 +**OUTDATED:** //This page is no longer up to date, diana and metlibs are now built using cmake.//
-     [[ftp://ftp.met.no/projects/diana/metlibs-4.7.0.tar.gz|metlibs-4.7]] +
-    * [[ftp://ftp.met.no/projects/diana/diana-3.29.2.tar.gz|diana-3.29.2]]+
  
-They both use a number of specially-written autoconf macroswhich can be found in metlibs' ''m4'' subdirectory.+This document describes how to build the Diana application and its main dependencies (Fimex and Metlibs) from source codefocusing 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. 
 +===== General Prerequisites =====
  
-===== Prerequisites =====+This section describes the basic set of packages that will be required to build the software. 
 +==== Ubuntu 12.04 (Precise) ====
  
-On a clean stock Ubuntu Lucid (10.04) install, you will first need to install build tools:+On a clean stock Ubuntu Precise (12.04) install, you will first need to install build tools:
  
-  * ''build-essential'' +<code> 
-  * ''gfortran'' +sudo apt-get install build-essential autoconf automake libtool subversion \ 
-  * ''autoconf'' +                     gfortran flex bison 
-  * ''automake'' +</code> 
-  * ''libtool'' + 
-  * ''subversion''+==== Fedora 20 ==== 
 + 
 +On Fedora 20, this command has been found to install a reasonable base set of tools:
  
 <code> <code>
-sudo apt-get install build-essential gfortran autoconf automake libtool subversion+sudo yum install gcc-c++ make wget tar subversion autoconf automake 
 +                 findutils libtool flex bison autoconf-archive \ 
 +                 gcc-gfortran file
 </code> </code>
  
-Next, you will need to install various third-party libraries that Metlibs and Diana depend on:+===== Obtaining the source code =====
  
-== Metlibs == +Obtain the latest source code from the source code repositories. Currently, fimex, metlibs and Diana are held in git repositories:
-  * ''flex'' +
-  * ''bison'' +
-  * ''libftgl-dev'' +
-  * ''libhdf4g-dev'' +
-  * ''libhdf5-serial-dev'' (XXX actually optional) +
-  * ''libtiff4-dev'' +
-  * ''libqt4-dev'' +
-  * ''libproj-dev'' +
-  * ''libboost-dev'' (*) +
-  * ''libboost-date-time-dev'' +
-  * ''libboost-serialization-dev'' +
-  * ''libboost-thread-dev'' +
-  * ''libgeotiff-dev'' (Optional) +
-  * ''libfimex-dev'' (Optional) +
-  * ''libmysqlclient-dev'' (*) +
-  * ''libpqxx-dev'' (*) (Optional) +
-  * ''libomniorb4-dev'' (Optional) +
-  * ''omniidl'' (Optional) +
-  * ''libldap2-dev'' (optional)  +
-  * ''liblog4cpp5-dev'' +
-  * ''libcurl4-gnutls-dev''+
  
-**Without optional libraries:**+**fimex:**
 <code> <code>
-sudo apt-get install flex bison ftgl-dev libhdf4g-dev libtiff4-dev libqt4-dev proj libboost-dev libboost-date-time-dev \ +git clone https://github.com/metno/fimex.git
-                     libboost-serialization-dev libboost-thread-dev libmysqlclient-dev liblog4cpp5-dev libcurl4-gnutls-dev+
 </code> </code>
  
-**With optional libraries:**+**metlibs:**
 <code> <code>
-sudo apt-get install flex bison ftgl-dev libhdf4g-dev libhdf5-serial-dev libtiff4-dev libqt4-dev proj libboost-dev libboost-date-time-dev \ +git clone https://github.com/metno/metlibs-milogger.git 
-                     libboost-serialization-dev libboost-thread-dev libgeotiff-dev libfimex-dev libmysqlclient-dev libpqxx-dev \ +git clone https://github.com/metno/metlibs-puctools.git 
-                     libomniorb4-dev omniidl4 libldap2-dev liblog4cpp5-dev libcurl4-gnutls-dev+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
 </code> </code>
  
-== Diana ==+**Diana:** 
 +<code> 
 +git clone https://github.com/metno/diana.git 
 +</code>
  
-  * ''libshp-dev'' +===== Fimex ===== 
-  * ''libavformat-dev'' (Optional) + 
-  * libxt-dev+==== Ubuntu 12.04 (Precise) ==== 
 + 
 +Install the dependencies using the following command: 
 + 
 +<code> 
 +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 
 +</code> 
 + 
 +==== Fedora 20 ==== 
 + 
 +Install the dependencies using the following command: 
 + 
 +<code> 
 +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 
 +</code> 
 + 
 +===== Metlibs ===== 
 + 
 +Next, you will need to install various third-party libraries that Metlibs and Diana depend on: 
 + 
 +==== Ubuntu 12.04 (Precise) ====
  
 **Without optional libraries:** **Without optional libraries:**
 <code> <code>
-sudo apt-get install libshp-dev libxt-dev+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
 </code> </code>
  
 **With optional libraries:** **With optional libraries:**
 <code> <code>
-sudo apt-get install libshp-dev libavformat-dev libxt-dev+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
 </code> </code>
  
-For observation buffer support in Diana: +==== Fedora 20 ====
-  * ''EMOSLIB'' (no package; install manually [[http://www.ecmwf.int/products/data/software/interpolation.html|from source]])+
  
-For GRIB support in Metlibs and Diana: +<code> 
-  * ''GRIB API'' (no package; install manually [[http://www.ecmwf.int/products/data/software/download/grib_api.html|from source]])+sudo yum install ftgl-devel libgeotiff-devel mesa-libGL-devel mesa-libGLU-devel \ 
 +                 qt-devel 
 +</code>
  
-For fimex support in Metlibs and Diana+===== Diana =====
-  * ''libfimex-dev'' (no package; install manually [[https://wiki.met.no/fimex/start|from source]])+
  
-Except for those marked with (*)''configure'' will terminate with an error message if any required package is absent.+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.04package exists for the optional EMOSLIB dependency, required to support viewing of observation files. However, it is not available for every distribution.
  
 +==== Ubuntu 12.04 (Precise) ====
  
-===== Installation ====== +<code> 
- +sudo apt-get install libemos-dev libgrib-api-dev libshp-dev libxt-dev 
-==== Metlibs ====+</code>
  
-By default, all modules are enabled except for ''GribAPI'', "geotiff", "fimex", ''pods'', ''profet'' and ''proFunctions''.+==== Fedora 20 ====
  
-Unpack the metlibs archive and enter the directory containing the source files. +For observation buffer support in Dianainstall EMOSLIB [[https://software.ecmwf.int/wiki/display/EMOS/Emoslib|from source]].
-If you have root privileges on your systemconfigure the library by running the +
-''configure'' script:+
  
 <code> <code>
-./configure --enable-xfonts --enable-allprofet --with-fimex+sudo yum install grib_api-devel shapelib-devel
 </code> </code>
  
-Otherwise, to configure the library for installation in a directory where you +===== Installing Fimex ===== 
-have permission to write files, run the ''configure'' script in the following + 
-way:+Enter the ''fimex'' directory and configure the library with the following command:
  
 <code> <code>
-./configure --enable-xfonts --enable-allprofet --with-fimex --prefix=$HOME/diana+./configure
 </code> </code>
  
-where, in this examplewe used ''$HOME/diana'' to specify a directory called +If you want to install the library in an alternative locationspecify it using the <nowiki>--prefix</nowiki> 
-''diana'' in the user's home directory.+option; for example, use the following command to specify a directory inside the user's home directory
 + 
 +<code> 
 +./configure --prefix=$HOME/diana 
 +</code>
  
 Build and install the library with the following commands: Build and install the library with the following commands:
Line 122: Line 147:
 You may need root privileges to install the library unless you specified a You may need root privileges to install the library unless you specified a
 prefix in the configuration step. prefix in the configuration step.
-==== Diana ====+===== Installing Metlibs ======
  
-By default, support for ''profet'' and observation buffers is disabledwhile video export is enabled.+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 scriptsuch as <nowiki>--prefix=$HOME/diana</nowiki> to install the libraries in the ''diana'' directory inside the user's home directory.
  
-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:+<code> 
 +#/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 
 +</code> 
 + 
 +===== Installing Diana ===== 
 + 
 +**Note:** By default, support for observation buffers is conditionally enabled and video export is enabled. To disable video support, append the <nowiki>--disable-video-support</nowiki> option to the command line you use to configure the build. 
 + 
 +==== Ubuntu 12.04 (Precise) ==== 
 + 
 +Enter the ''diana'' directory. If you have root privileges on your system, configure the library by running the configure script:
  
 <code> <code>
-./configure --enable-xlib --enable-obs-bufr --enable-profet --enable-proddb+./autogen.sh 
 +./configure --enable-xlib --enable-geotiff
 </code> </code>
  
-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:+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 <nowiki>--prefix</nowiki> option to specify the installation directory:
  
 <code> <code>
-./configure --enable-xlib --enable-obs-bufr --enable-profet --enable-proddb --prefix=$HOME/diana+./autogen.sh 
 +./configure --enable-xlib --enable-geotiff --prefix=$HOME/diana
 </code> </code>
  
-where, in this example, we used $HOME/diana to specify a directory called diana in the user's home directory.+==== Fedora 20 ==== 
 + 
 +Enter the ''diana'' directory. If you have root privileges on your systemconfigure the library by running the configure script: 
 + 
 +<code> 
 +./autogen.sh 
 +./configure --enable-xlib --enable-geotiff --prefix=/usr/local \ 
 +            --with-png-libdir=/usr/lib64 --enable-vcross-v2 --with-udunits2-includedir=/usr/include/udunits2 
 +</code> 
 + 
 +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 <nowiki>--prefix</nowiki> option to specify the installation directory: 
 + 
 +<code> 
 +./autogen.sh 
 +./configure --enable-xlib --enable-geotiff --prefix=$HOME/diana \ 
 +            --with-png-libdir=/usr/lib64 --enable-vcross-v2 --with-udunits2-includedir=/usr/include/udunits2 
 +</code> 
 + 
 +==== Building ====
  
 Build and install the application with the following commands: Build and install the application with the following commands:
Line 147: Line 215:
 </code> </code>
  
-You may need root privileges to install the library unless you specified a prefix in the configuration step.+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'' 
 + 
 +===== Next Steps =====
  
 +See the [[gettingstarted#installing_data_files|Installing Data Files]] section of the [[gettingstarted|Getting Started]] document for instructions about configuring and running Diana.
  • diana/autotools.1351154020.txt.gz
  • Last modified: 2022-05-31 09:23:13
  • (external edit)