Archive for February 21st, 2010

Installing packages from source in Ubuntu

I just found these instructions in the Ubuntu documentation:

Compiling Software

I can’t believe I hadn’t read this before, it explains several things I didn’t know. To start with, it recommends installing the following packages using “apt-get install”:

build-essential
automake
checkinstall

I already had build-essential, and I went ahead and got the other two. I knew that the first step was to run the configure script, using “./configure”. But I didn’t realize this is the script that will define where the software gets installed (ie. the lib and include directories).  To see the options for a configure script, use the command <code>./configure –help</code>

Then there’s the make command, which is used to compile the code.

The part that was really different was using “checkinstall” – I have been using “make install”. Using checkinstall actually creates a .deb file, which makes removing the package later on much easier.  If I ever want to remove it later, I just have to use the command dpkg -r gdal171.

So, this is all good, I think I learned some things, but I am *still* getting the same errors when I try to install MB-System – undefined references to anything related to GDAL.

Organizing installed software in Ubuntu

After trying for quite some time now to install MB-System and GMT, I’ve decided to make an effort to organize my file system a bit. So far – not really knowing any better – I have been installing my software in all kinds of different places, basically in whichever folder it ended up, based on mish-mashing instructions that I only half understood from different forums, etc. Figuring out how to build software from source has been a bit frustrating, since I don’t really know enough to have very effective troubleshooting skills. This is a small step, but I’ve been putting my installed software all into my /usr/local/ directory. So I now have:
/usr/local/GMT452
/usr/local/mbsystem512
/usr/local/netcdf363

I then had to change the references for this software in my .bashrc file:
export PATH=$PATH:/usr/local/GMT452/bin:/usr/local/GMT452/src:/usr/local/GMT452
MANPATH=/usr/local/GMT452/man
export NETCDFHOME=/usr/local/netcdf363
export GDAL_INC=/usr/include
export GDAL_LIB=/usr/lib
export GMTLIBDIR=/usr/local/GMT452/lib
export GMTHOME=/usr/local/GMT452
export MGD77_HOME=/usr/local/GMT452/share/mgd77
export X2SYS_HOME=/usr/local/GMT452/share/x2sys
export MBSYSTEM_HOME=/usr/local/mbsystem512

The only one that I didn’t change was the GDAL install, because I don’t really know why the include and lib directories went where they did, so I don’t want to make any changes. (although maybe I should since it’s the one thing that is still giving me trouble).

First GMT chart

I still haven’t got MB-System working right. Not sure why…but since I was getting no where figuring that out, I decided to go back to GMT, and at least make a chart. And I did it! I went to one of the very first examples in the GMT tutorial online, and tried it out. For some reason, I have to be in my home directory for it to work – if I try to run the command from anywhere else, I get the error:
bash: map.ps: permission denied
But here’s the resulting chart (the Maritime provinces – yay!):
Maritime Provinces (Eastern Canada)