This blog shares some tips and tricks for working with data - particularly aimed at ecologists and conservation biologists.

I am a conservation biologist, so I use GIS and data analysis tools a lot for reports and articles. Other people may on occasion read these publications, so I like to think that any one can repeat / reproduce my work, which is why I tend to use “free” software for processing spatial data and running analysis. I have Windows on my laptop and Linux (openSUSE) on a desktop (which does most of the heavier analysis). So I need programs that run on both.

Monday, May 30, 2011

Install SAGA GIS on openSUSE 11.4 64 bit

Here I am going to show how to install SAGA GIS on openSUSE 11.4 (64 bit, KDE 4.6 desktop) .

There is a one click installer available here: (https://build.opensuse.org/package/show?package=saga-gis&project=Application%3AGeo). However the “one click install” seems to want to change architecture and install things that seemed unnecessary (e.g. 32 bit version of “libre office”). Plus it's not the most recent version …...

So I decided to install from source.This is not a “minimal” installation, I have installed various packages that are not necessary (some I will probably use later others maybe not). However it worked for me!

What is presented here is based on the SAGA GIS wiki (mainly for Ubuntu / Fedora) http://sourceforge.net/apps/trac/saga-gis/wiki/Compiling%20a%20Linux%20Unicode%20version

and threads on the SAGA user group:

http://sourceforge.net/projects/saga-gis/forums/forum/790705/topic/4545252


http://sourceforge.net/projects/saga-gis/forums/forum/790705/topic/4550329


There are basically 2 steps:

1) Install dependencis (took me 3 hours - depends mainly on internet speed)

2) Install SAGA and configure the system (took me 40 minutes)

So it is not that quick. But for me it is well worth a little time.


1) Install dependencies.

I used the package manager that comes with openSUSE - "YAST" . You need to install:

1.1) necessary dependencies, development libraries, debug libraries (helpful when things don't quite work) for the following:

jasper, geos , gdal , tiff , unixodbc , proj4 , wxgtk , openjpeg , gif , xerces , poppler and mysqlclient

1.2) configuration tools

GCC (Various compilers ), GCC-C++ (C++ support for GCC ), Automake, Autoconf, Libtool

I have the following repositories:



JASPER – open YAST, and this is what the search for jasper returned. So I installed all:


GEOS – again using search to get geos, development and debug libraries (YAST also automatically installs some additional packages / libraries):


GDAL: all except the grass support (I am not going to install GRASS at least for a while).

At this step the package manager automatically adds a whole bunch of additional packages as well.


Now TIFF, I also added “xv” as it looked quite interesting.......


Unixodbc – plus some that I may need later:

Now PROJ4 (no development packages):


wxgtk, now this is tricky (there are different packages, with different names for different versions of openSUSE). Errors are most likely to occur here.

Searching for “wxgtk” on 11.4 just brings one. But if I search for “wxWidgets” there are loads, some conflicting.

If you search in YAST using ““wxWidgets”: go to the bottom of the list and tick where the six big green ticks are in the picture below (will also automatically add other packages/libraries):


openjpeg:


GIF: based on previous steps it seems that I have all that is needed, nothing added.

xerces, again looks OK, nothing added.

poppler, was not sure what would be needed so I picked all:

mysqlclient, in my case already there, so added nothing:


Now for the configuration tools.

GCC and GCC-C++, I have the following:

Automake, I have the following, nothing added:


Autoconf, I have the following, nothing added:

Libtool, I have the following, nothing added:


After all this installing I did a restart (or switch off and switch on again).

Now need to open a command line terminal and do the following. I ran as root. Be warned this is not recommended procedure. Back up before proceding.

What is presented here is based on the SAGA GIS wiki (mainly for Ubuntu / Fedora) http://sourceforge.net/apps/trac/saga-gis/wiki/Compiling%20a%20Linux%20Unicode%20version

su

mkdir /usr/local/src/saga-svn

cd /usr/local/src/saga-svn

svn co https://saga-gis.svn.sourceforge.net/svnroot/saga-gis/trunk

cd /usr/local/src/saga-svn/trunk/saga-gis

autoreconf -i

./configure --enable-unicode

make


The last step here ("make") does most of the work and takes a few minutes (20 minutes on my PC. Coffee time), then finish off the installation:

make install

cd /usr/local/lib

ldconfig

export SAGA_MLB=/usr/local/lib/saga

exit

Now as a normal user, check both saga_cmd and saga_gui work. The GUI first.

Open a command line terminal and type:

saga_gui

which should open SAGA:


And then check the command line “saga_cmd” (I will need this later to work with R). When I type "saga_cmd" in the terminal, some “error” messages appear, but they do not seem to be anything that interferes with the command line running (the same "errors" are shown here : https://sourceforge.net/apps/trac/saga-gis/wiki/Executing%20Modules%20with%20SAGA%20CMD) :

saga_cmd




Calendar