This is my third installment on setting up a Fedora 12 GIS workstation. The procedures below for compiling the actual GIS “front-end” programs rely on the software and the way it was setup from the first and second articles. So if you want to follow step by step, go back and review those before plunging into this one.
GRASS
Now we’re ready (almost) for compiling GRASS. First get more pre-requisites:
~/Download$ sudo yum install tcl tcl-devel tk-devel fftw2 fftw2-devel libXmu libXmu-devel
The Swig conundrum: SWIG is an interface that “dresses” C/C++ programs for use in scripting languages like python. It seems that the installed version in F12, 1.3.40, has some change that makes it incompatible with certain parts of the GRASS python interface. The recommendation at this point is to roll back to an earlier version of SWIG (Note: if you skip this step, GRASS will be fully functional in both the CLI and the tcl/tk interface but some parts of the wxpython interface won’t work). You’ll have to remove the rpm and download the older 1.3.36 version. To successfully do the compile you need the perl devel package (and others that we’ve already added). So here are the steps:
~/Download$ sudo yum install perl-devel ~/Download$ sudo yum remove swig ~/Download$ tar xvzf swig-1.3.36.tar.gz ~/Download$ cd swig-1.3.36 ~/Download/swig-1.3.36$ ./configure ~/Download/swig-1.3.36$ make && make check ~/Download/swig-1.3.36$ sudo make install
On to GRASS itself. Download the GRASS source code for version 6.4, and as always, unzip the source and go into that directory.
Here’s my configure line:
~/Download/grass-6.4.0RC5$ ./configure --prefix=/usr/local/grass-6.4 \
--with-proj-share=/usr/share/proj \
--with-postgres \
--enable-largefile \
--with-sqlite \
--with-freetype --with-freetype-includes=/usr/include/freetype2 \
--with-python --with-wxwidgets \
--with-cxx
The freetype include headers are in an unusual place: /usr/include/freetype2/freetype. GRASS apparently always looks in a subdir called ‘include’. So in order to get GRASS to recognize the freetype headers I had to do:
~/Download/grass-6.4.0RC5$ cd /usr/include/freetype2 /usr/include/freetype2$ sudo ln -s freetype include
then the above compile line worked. Also don’t forget to add –with-cxx, (otherwise you won’t have the python digitizer)
Now run make and make install
/usr/include/freetype2$ cd ~/Download/grass-6.4.0RC5 ~/Download/grass-6.4.0RC5$ make ~/Download/grass-6.4.0RC5$ sudo make install
Next we’ll be installing Quantum GIS. The path to the grass lib directory must be added to a conf file in ld.so.conf.d (for the same reason explained in the earlier post in the ECW section). In my case I create a file /etc/ld.so.conf.d/grass-6.4 which contains one line:
/usr/local/grass-6.4/grass-6.4.0RC5/lib
then run: $sudo ldconfig
At this point we have one more step before moving on to Qunatum GIS. We compiled GDAL earlier without GRASS support. That’s fine if you don’t need access to GRASS rasters when using the gdal tools. If you do want to manipulate GRASS rasters using GDAL tools, or more importantly, in order to access GRASS raster from QGIS (which depends on GDAL) then you want the gdal-grass plugin. It’s quick and simple. Download the lastest version 1.4.3 and after opening the tar archive do the usual:
~/Download/gdal-grass-1.4.3$ ./configure --with-grass=/usr/local/grass-6.4/grass-6.4.0RC5 ~/Download/gdal-grass-1.4.3$ make && sudo make install
QGIS
Prepare for Quantum GIS with:
~/Download$ sudo yum install cmake gsl gsl-devel geos-devel expat expat-devel
Download the QGIS source code for version 1.4, unzip it and drop into that directory.
Following more or less Tim Sutton’s blog post or my earlier instructions regarding Fedora 10, invoke these commands:
~/Download$ cd qgis-1.4.0/ ~/Download$ mkdir build ~/Download/qgis-1.4.0$ cd build ~/Download/qgis-1.4.0/build$ cmake -L ..
(Be sure to add the ‘..’ at the end of the cmake command). Now check thru the list of cmake parameters to make sure all the dependencies were found. You tune these paths or variables as necessary with the -D option to cmake. In my case I need to indicate where GRASS is located (note the –prefix option in my GRASS compilation previously), and I want to set the final install location to a specific directory under /usr/local for this version of QGIS, so:
~/Download/qgis-1.4.0/build$ cmake -L -DGRASS_PREFIX:PATH=/usr/local/grass-6.4/grass-6.4.0RC5 -DCMAKE_INSTALL_PREFIX:PATH=/usr/local/qgis-1.4.0 ..
With that set up we’re ready for:
~/Download/qgis-1.4.0/build$ make ~/Download/qgis-1.4.0/build$ sudo make install
R statistics
No GIS workstation is complete without R and its spatial packages.
~/Download$ sudo yum install R-core rpy R-devel xml2 libxml2 libxml2-devel
Fire up R and run:
> install.packages("sp",dependencies=TRUE)
> install.packages("spgrass6",dependencies=TRUE)
The R install.packages() function wants to put R libraries into /usr/lib/R/library and the html manuals into /usr/share/doc/R-x.x.x by default. Since these locations are writable only by root, either give yourself necessary permissions on those directories, or (preferably) in the install.packages() functions add the lib=”…” parameter to create an R library in your home dir.
Whew! Congratulations, you’re now the proud owner of an advanced Linux based GIS workstation.

This work, unless otherwise expressly stated, is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.