bigbrovar

February 12, 2009

How to install SGeMS on Ubuntu Hardy Heron

Filed under: Education,FOSS & Mathematical Science — Bigbrovar @ 10:14 pm

SGeMS is a software for 3D geostatistical modeling. It implements many of the classical geostatistics algorithms, as well as new developments made at the SCRF lab, Stanford University.
SGeMS relies on the Geostatistics Template Library (GsTL) to implement its geostatistical routines, including:

* Kriging
* Multi-variate kriging (co-kriging)
* Sequential Gaussian simulation
* Sequential indicator simulation
* Multi-variate sequential Gaussian and indicator simulation
* Multiple-point statistics simulation

For news, tutorials, and an FAQ, visit the SGeMS wiki.

Main Features

* Comprehensive geostatistical toolbox
* Standard data analysis tools: histogram, QQ-plots, variograms,…
* interactive 3D visualization
* Scripting capabilities: SGeMS embeds the Python scripting language, that allows to automatically perform several (repetitive) actions.
* Use of plug-ins to add new geostatistics algorithms, support new file formats, or increase the set of script commands.

http://sgems.sourceforge.net/

Where do i start? ..OK so i happen to be a Linux SysAdmin for some school. we use Linux on all our workstations including the laptops we gave to the students. so when i prof said he need a program called SGeMS for his class, it my job to get it done :(  i searched synaptic and that came with nothing (hmm sign of trouble) a little search on google took me to where i could download the source code. i downloaded it. checked the readme to see what is needs .. that was when i knew i was in for some serious ish. cut the long story short i went through hell  just to get the program to compile. but i the end i did. so i decided i no man should ever go through what i went through and i decided to document how i got SGeMS to install on ubuntu..

WARNING!!!
the following guide involve the use of command line, although i try to make it as simple as possible so you shouldn’t have any problem. .. remember i said shouldn’t

first we download sgems from here http://sourceforge.net/projects/sgems/
for this guide am using version 2.0

once the source code is downloaded.. we now have to install the dependencies it needs to compile which are
– GsTL (Geostatistics Template Library)
– Qt (GUI library) version 3.1 or higher
– Coin3D (OpenIventor library), version 2.x
– SoQt (Qt bindings for OpenIventor), version 1.x
– SimVoleon (Volume rendering extension for Coin3D), version 2.x
– Python
qt , coin,python and SoQt can all be installed from the ubuntu repositories

Qt when i tried searching for qt in synaptic .. billions of files came up out of the lot i installed

libqt3-mt-dev qt3-assistant qt3-qtconfig
and it seem to work fine (guess am lucky)

Coin3D for coin i installed libcoin40-dev libcoin40-runtime

SoQt i installed libsoqt-dev

Python i installed python2.4-dev

you can always open synaptic /System/Admin/Synaptic and search for libqt3-mt-dev libcoin40-dev libcoin40-runtime qt3-assistant qt3-qtconfig python2.4-dev libsoqt-dev

better still you can install everything at a go via terminal /Applications/Accessories/Terminal

install with this command (copy and paste is allowed🙂 )

sudo aptitude install libqt3-mt-dev libcoin40-dev libcoin40-runtime qt3-assistant qt3-qtconfig python2.4-dev libsoqt-dev

Now we have installed all the dependencies that can be gotten from the ubuntu repositories

time to install other dependencies

for some reasons downloading and compiling SimVoleon from here http://www.coin3d.org/lib/simvoleon threw up some funky errors about gcc .. anyway i went round that by downloading the latest version from subversion

Note: to use subversion you need to have it installed .. it can be easily installed by

sudo aptitude install subversion or search and install from synaptic.

now to download simvoleon we do the following

create a directory called svn in your home directory

mkdir $HOME/svn

move into the directory

cd $HOME/svn

next we run the command that would download simvoleon from svn

svn co https://svn.coin3d.org/repos/SIMVoleon/trunk SIMVoleon

give it some time.. you would see a prompt asking you to accept a certificate or some stuff like that .. you can choose to accept temporarily or permanently just don’t reject it🙂

once simvoleon is downloaded you will find it under svn/ directory you created earlier .. now we need to go into the directory so we can compile it.

N.B before compiling any source code on ubuntu you need to install build-essentials meta-package which contains all tools needed for compilations mainly the GNU C compiler gcc

sudo aptitude install build-essential ; cd $HOME/svn/SIMVoleon

the above command install the build-essential package and moves us into the SIMVoleon directory next we run

./configure

then

make

lastly we run

sudo make install

the last command would install SIMvoleon .. i didnt experience any error when i went about it this way.

now to download the last dependencies

GsTL can be download here http://sourceforge.net/projects/gstl/

we don’t need to compile GsTL just place it in the same directory that you would like to install SGeMS.

so place both SGeMS-2.0.tgz and GsTL-1.3.tgz in your home directory and we extract it using the tar command

tar xzvf SGeMS* ; tar xzvf GsTL*

now we enter into the SGeMS Directory to make some pre-compile preparations

cd SGeMS-2.0/

we need to edit a hidden config file named .qmake.cache we would edit this point the variables to the correct location on your computer

gedit .qmake.cache

look for the following lines and

GSTLHOME = /tmp/Linux/GsTL-1.2.1
GSTLAPPLI_HOME = /tmp/Linux/SGeMS-1.4.1

edit them to look like this (we would point the location of GSTL and SGeMS if you followed the guide then there should be in your home directory so you edit them accordingly)

GSTLHOME = /home/bigbrovar/GsTL-1.3
GSTLAPPLI_HOME = /home/bigbrovar/SGeMS-2.0

save the text editor and close

now we need to edit you .bashrc file to include the paths necessarily for SGeMS to work

gedit $HOME/.bashrc

now we add the following to the bottom of the text file

export LD_LIBRARY_PATH=$HOME/SGeMS-2.0/lib/linux:$HOME/SGeMS-2.0/plugins/designer:/usr/local/lib/
export GSTLAPPLIHOME=$HOME/SGeMS-2.0/

now save and close

once this is done we now need to compile SGeMS (about time right) so we move into the SGeMS directory

cd $HOME/SGeMS-2.0

and run

qmake

make

lastly

sudo make install

now the last thing we need to don is direct Qt to libGsTLwidgets.so which can be found under the SGeMS directory

so run this in terminal qtconfig

go to Library Paths and browse to this path under the SGeMS directory /plugins/designer/ click add save and close

now lets see if all the hard work paid up .. to run the program do this

cd $HOME/SGeMS-2.0/bin/linux
then
./s-gems

you can write a script that starts it

open a test file and paste the following into it

#!/usr/bin/env bash

exec $HOME/SGeMS-2.0/bin/linux/s-gems

save it as sgems and move it to /usr/local/bin (remember you have to do that has root)

sudo mv sgems /usr/local/bin

make it executible
chmod +x /usr/local/bin/sgems

so now when you want to start sgems .. just open your terminal and type sgems ..

i Hope this helps some one .

If this works for your please let me know.

Thanks to Ting Li from the SGeMS mailing list for the tips he gave me without which i would still be hitting my head at the wall in frustration.

7 Comments »

  1. hello, bigbrovar, nobu here, answering u’r comment in my LJ🙂

    It is good job u have done here, don’t be shy!

    Some time ago, we tried to compile sgems on linux and failed, because of similar problems. At that time, there was no guide on this (and email list couldn’t help us too).

    So, it is really nice, that now every sgems-linux user can find this post🙂

    p.s.
    I added u’r blog to my rss ^^

    Comment by nobu^ — February 15, 2009 @ 12:25 pm | Reply

  2. many thanks!
    great help, followed your hints and all went well.

    padeco

    Comment by padeco — February 28, 2009 @ 11:10 am | Reply

  3. Thanks!!!

    Comment by Pete — June 16, 2009 @ 1:40 pm | Reply

  4. Thanks for the instruction. The only problem I have now is to compile SIMVoleon. I can compile version 1.0.0 successfully. However, it seems that we need at least version 2.0.0. But I have tried version 2.0.0 and 2.0.1 and the latest subversion, none of them can be successfully compiled. I would be appreciated if you could give some hint on this.

    Thanks

    Comment by Yanbin Zhang — September 8, 2009 @ 2:11 am | Reply

    • hmm do you mind telling me more about the error you were getting?

      Comment by Bigbrovar — September 8, 2009 @ 8:56 am | Reply

  5. good one

    Comment by dammy — September 8, 2010 @ 8:42 am | Reply


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at WordPress.com.

%d bloggers like this: