Tuesday, November 17, 2009

Ubuntu Karmic : Building the GRASS GIS and its wxpython source code

From http://grass.osgeo.org/wiki/Compile_and_Install_Ubuntu

First of all, do NOT install the following grass/ogr Ubuntu packages
as they are often broken :gdal-bin libgdal1-dev.
Instead, install grass/ogr from source code (recommended) :
http://midyetavablog.blogspot.com/2009/11/compiling-gdal-on-ubuntu-karmic-910.html

To build grass install the following packages in Ubuntu :

sudo apt-get install build-essential flex bison libncurses5-dev zlib1g-dev \
libjpeg62-dev libgdal1-dev libtiff4-dev libgcc1 tcl8.5-dev tk8.5-dev \
gettext fftw3-dev libfreetype6-dev libavcodec-dev libavformat-dev libxmu-dev make python-dev \
swig libavutil-dev libavutil49 libgl1-mesa-dev libglu1-mesa-dev libcairo2-dev \
libblas-dev liblapack-dev libglw1-mesa-dev

To build the wxphython GUI, install the following Ubuntu packages :

sudo apt-get install libwxbase2.8-0 libwxbase2.8-dbg libwxbase2.8-dev \
libwxgtk2.8-0 libwxgtk2.8-dbg libwxgtk2.8-dev \
python-wxgtk2.8 wx2.8-doc wx2.8-examples \
wx2.8-headers wx2.8-i18n python-numpy

We are ready to configure the system and start building :

./configure \
--with-tcltk-includes=/usr/include/tcl8.5 \
--with-wxwidgets=/usr/bin/wx-config \
--with-postgres-includes=/usr/include/postgresql  --with-postgres=yes \
--with-cairo --with-blas --with-lapack --with-python \
--with-proj-share=/usr/share/proj

make
sudo make install

I was not able to make work the following flags  :
--with-ffmpeg --with-ffmpeg-includes=/usr/include/libavcodec --with-glw

Tuesday, November 10, 2009

Compiling GDAL on Ubuntu Karmic 9.10

First, obtain the latest stable gdal sources from http://trac.osgeo.org/gdal/wiki/DownloadSource .

In my case, I used http://download.osgeo.org/gdal/gdal-1.6.3.tar.gz

Before compiling, I had to install the following Ubuntu packages :

sudo apt-get install libnetcdf4 libnetcdf-dev libpng-dev libtiff4-dev libcurl4-dev libtool python-gdal

The following commands
./configure
make
sudo make install
sudo ldconfig

This will install the binaries in /usr/local/bin and the libraries in /usr/local/lib

This default configuration will compile only a fraction of the formats supported. Feel free to add more components to your taste. After all, it's all FREE software!