Getting QGIS 1.8 running on Scientific Linux 6

Quantum GIS is marching ahead and the latest stable version, 1.8.0, provides some new features and improvements. RPM packages are already out for Fedora, but not yet for the Red Hat 6 clones like Scientific Linux 6. Compiling on your own isn’t hard, so if you don’t want to wait for the official package, here are a few pointers.

We’ll assume you already have a build environment with gcc-c++, flex, bison, PyQt4 etc. Check the QGIS wiki wiki page for details regarding dependencies. While the instructions are specific for Ubuntu systems, it’s fairly clear which parallel packages you will need to install on SL6. Also you will want to install the whole geospatial stack, all from standard repos or the EPEL and elgis repos. This includes geos, proj, grass-6.4.2, gdal-1.8.1 and all the -devel packages as well.

Download the source code for QGIS and untar in a directory of your choice. Before starting the configure and make steps there’s one simple edit required for EL6 and similar: under the python directory open the file CMakeLists.txt. You’ll find four lines like:
SET(SIP_EXTRA_OPTIONS ${PYQT4_SIP_FLAGS} -o -a ${CMAKE_BINARY_DIR}/python/qgis.core.api)
These are lines 64, 80, 94, 100
You need to remove the “-o” option from each. This is a flag for “sip” which handles bindings between c++ and python. This new flag was introduced in recent versions of sip, and it’s not available in the EL6 sip packages. Removing the extra flag has no ill effects on the compilation (I believe it’s only applicable to the comments in the source code). So each of the four lines should be:

If you prefer to make the above changes with ‘patch’ here’s a diff file provided by Volker Froehlich (Fedora GIS maintainer).
Now, following more or less the instructions from that same wiki page above, you create a subdirectory “build’, drop into that directory and run:
$ cmake -L -DGRASS_PREFIX=/usr/grass-6.4.2 -DGDAL_LIBRARY=/usr/lib64/ ..
(Don’t skip the two dots .. at the end of the command)

The two specific directives to the cmake command indicate where the GRASS installation and libgdal are. These paths are based on GRASS and GDAL being installed from RPM’s. If you’ve cooked your own GRASS or GDAL, set the above appropriately. Now you’re ready to go:
$ make
$ sudo make install

One more step is required so that QGIS can “find” the GRASS libraries. Add a one line file into /etc/ which contains:
$ cat /etc/

and do:
sudo ldconfig

Now you should be ready to enjoy the new, updated QGIS 1.8.0 ‘Lisboa’

Leave a Reply

Your email address will not be published. Required fields are marked *