Installation on Linux

From Modular Dispersal in GIS

Jump to: navigation, search

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, and using a svn snapshot/checkout. The 6.4RC5 version has an annoying g.region bug that can create obscure errors. Follow the INSTALL file that comes with GRASS, and see below for installing dependencies in Ubuntu.

Ubuntu

The setup below requires the following Ubuntu packages (although this may not be complete):

sudo apt-get install flex bison libncurses5-dev proj libjpeg-dev libgdal-dev \
 gdal-bin tcl8.4-dev tk8.4-dev libglut-dev ffmpeg libpq-dev libavcodec-dev  \
 libswscale-dev build-essential zlib1g-dev libreadline5-dev        \
 libjpeg62-dev libtiff4-dev libpng12-dev postgresql libpq-dev libstdc++6 \
 unixodbc-dev fftw-dev lesstif2-dev libfreetype6-dev libgdal1-dev gdal-bin proj \
 sqlite3 libsqlite3-dev libavcodec-dev libavformat-dev make g++ swig libxmu-dev \
 python-dev libavutil-dev libavutil49 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