Skip to content

Installation on Linux

Damiano G. Preatoni edited this page Aug 4, 2015 · 5 revisions

Note: a "fast install", based on grass-dev is possibile on Ubuntu 13.10 and above, this avoids to download and compile GRASS.

Note: this version of instructions possibly needs to be updated. Be aware that MDiG presently runs under GRASS 6.5.x series, that has been superseded by GRASS 7. If you manage to follow the instructions for creating an MDiG distribution please let me know how it went, posting on the mailing list, or even better update the instructions for others ;-)

Table of Contents

Download sources

Get the GRASS sources from here. I recommend the 6.5.x series or later.

Install Bazaar VCS:

 sudo apt-get install bzr

Get the MDiG source from the Launchpad bazaar repository:

 bzr branch lp:mdig

This will create a subdirectory "mdig" with all the MDiG source.

Compile grass

We recommend using GRASS version 6.4.3, and using a svn snapshot/checkout. (6.4.2 has known issues in r.reclass and r.recode. And 6.4.0 has g.region bugs.)

Ubuntu

The setup below requires the following Ubuntu packages (current, for 11.04 Natty Narwhal):

sudo apt-get install flex bison libncurses5-dev proj libjpeg-dev libgdal-dev \
 gdal-bin tcl8.4-dev tk8.4-dev libglut3-dev ffmpeg libpq-dev libavcodec-dev  \
 libswscale-dev build-essential zlib1g-dev libreadline6-dev        \
 libjpeg62-dev libtiff4-dev libpng12-dev postgresql libpq-dev libstdc++6 \
 unixodbc-dev fftw-dev lesstif2-dev libfreetype6-dev \
 sqlite3 libsqlite3-dev libavcodec-dev libavformat-dev make g++ swig libxmu-dev \
 python-dev libavutil-dev libavutil50 libswscale-dev libwxgtk2.8-dev libcairo-dev \
 python-wxversion

For 12.04 LTS (these can porbably be run as one command, but I had to resolve some conflicts to get all the packages installed):

sudo apt-get install build-essential zlib1g-dev libreadline6-dev \
  flex bison libncurses5-dev proj libgdal-dev gdal-bin \
  tcl8.4-dev tk8.4-dev freeglut3-dev ffmpeg libpq-dev libavcodec-dev \
  libjpeg-dev libtiff-dev libpng12-dev postgresql libpq-dev libstdc++6
sudo apt-get install unixodbc-dev fftw-dev lesstif2-dev libfreetype6-dev \
  sqlite3 libsqlite3-dev libavcodec-dev libavformat-dev make g++ swig libxmu-dev \
  python-dev libavutil-dev libavutil50 libswscale-dev libwxgtk2.8-dev libcairo-dev \
  python-wxversion

I'm in 64-bit Ubuntu I use the following configure command:

CHOST="x86_64-pc-linux-gnu" CFLAGS="-march=k8 -O2 -pipe -Wall" \
./configure \
     --with-tcltk-includes=/usr/include/tcl8.4 \
     --with-motif --with-motif-includes=/usr/include/X11 \
     --with-readline --with-cxx --with-odbc --with-sqlite \
     --with-freetype --with-freetype-includes=/usr/include/freetype2 \
     --without-postgres --with-proj-share=/usr/share/proj \
     --with-ffmpeg \
     --with-ffmpeg-includes="/usr/include/libavcodec /usr/include/libavformat /usr/include/libavutil /usr/include/libswscale" \
     --with-wxwidgets --with-cairo --with-geos \
     --with-python --with-postgres --with-postgres-includes=/usr/include/postgresql/ \
     --enable-64bit 2>&1 | tee config_log.txt

This is the configure command for 32-bit Ubuntu:

CFLAGS="-O2 -pipe -Wall" \
./configure \
     --with-tcltk-includes=/usr/include/tcl8.4 \
     --with-motif --with-motif-includes=/usr/include/X11 \
     --with-readline --with-cxx --with-odbc --with-sqlite \
     --with-freetype --with-freetype-includes=/usr/include/freetype2 \
     --without-postgres --with-proj-share=/usr/share/proj \
     --with-ffmpeg \
     --with-ffmpeg-includes="/usr/include/libavcodec /usr/include/libavformat /usr/include/libavutil /usr/include/libswscale" \
     --with-wxwidgets --with-cairo --with-geos \
     --with-python --with-postgres --with-postgres-includes=/usr/include/postgresql/ \
      2>&1 | tee config_log.txt

Once you've run configure, run:

 make
 sudo make install

Special setup for wx gui and v.digit

(This is probably redundant and fixed in newer version of python/wx)

 sudo ln -s /usr/lib/python2.4/site-packages/wx-2.8-gtk2-unicode/wx/_gdi_.so \
   /usr/local/lib/libgdi.so

Compile MDiG

Prerequisites

MDiG requires:

  1. GNU Scientific Library
  2. bc
  3. lxml and its depedency, the Gnome XML library
  4. ImageTk
  5. Numpy, Scipy, and Matplotlib
  6. ConfigObj
  7. Paste (optional)

These requirements correspond to Ubuntu packages:

 sudo apt-get install \
   gsl-bin libgsl0-dev bc libxml2 libxml2-dev python-lxml python-imaging-tk \
   python-scipy python-matplotlib python-numpy python-configobj python-paste \
   python-simplejson imagemagick

Compile modules

Change into MDiG's grass-module dir

 cd mdig/grass-modules

and run:

 export GRASS_SRC=~/src/grass63_release
 make -S MODULE_TOPDIR=$GRASS_SRC
 cd $GRASS_SRC
 make install