Building QGIS on Feisty Fawn

April 27, 2007
By

Here is the process I used to quickly build (OK, but it was faster than usual) QGIS HEAD on Feisty Fawn. What’s QGIS HEAD? It’s the current development version that includes the tasty Python bindings that allow you to write both QGIS plugins and stand-alone mapping applications.

1. With apt-get or synaptic, install the following:

 bison               fftw3
 fftw3-dev           flex
 g++                 libgeos-c1
 libgeos-dev         libgeos2c2a
 libpq-dev           libpq5
 libqt4-core         libqt4-dev
 libqt4-gui          libqt4-qt3support
 libqt4-sql          libreadline5-dev
 libsqlite3-dev      libtiff4-dev
 proj                pyqt4-dev-tools
 python-qt4          python-qt4-dev
 python-sip4         python-sip4-dev
 qt4-designer        qt4-dev-tools
 qt4-doc             qt4-qtconfig
 sip4                sqlite3
 tcl8.4-dev          tk8.4
 tk8.4-dev           x-dev

Some of these may get installed as part of other packages. Also you’ll likely see a bunch of dependent packages pulled in by the ones above.

2. Get and build GDAL 1.4.1 from source (http://www.gdal.org/)

./configure ‘–without-python’ ‘–with-sqlite=/usr’
make
make install

3. Download GRASS 6.2.1 and build (You can use the 6.3.x snapshots as well – http://grass.itc.it)

./configure –with-tcltk-includes=/usr/include/tcl8.4 \
–with-postgres-includes=/usr/include/postgresql –with-readline –with-sqlite
make
make install

4. Rebuild GDAL 1.4.1 with GRASS support

./configure –without-python –with-sqlite=/usr –with-grass=/usr/local/grass-6.2.1
make clean
make
make install

5. Get the current QGIS unstable from the Subversion repository. You’ll need subversion to fetch the code. If you don’t have it, install it using:

sudo apt-get install subversion

then,

svn co https://svn.qgis.org/repos/qgis/trunk/qgis qgis_unstable

5. Build QGIS using the instructions in: http://wiki.qgis.org/qgiswiki/Building_with_CMake
I suggest using a out of source build outlined on the wiki.
If you have problems with cmake finding your GRASS or other components, use ccmake to edit the paths, as well as the install prefix if you like:

cd qgis_unstable
mkdir build
cd build
ccmake ..

Using ccmake

Hit ‘c’ a couple of times and then ‘g’ to generate. You are then ready to:

make
make install

Using the Feisty packages makes it a pretty quick process. You only need to compile GDAL, GRASS and QGIS. If you don’t want to use GRASS, you could get by with GDAL 1.3.2 from apt.

You can also use this process to build the 0.8.0 release or the 0.8.1 release candidate in subversion.

4 Responses to Building QGIS on Feisty Fawn

  1. Tomas on May 2, 2007 at 12:13 am

    Hello,

    when I am compiling the gdal 1.4.1 I with grass I got the following errormessage:

    grass57dataset.cpp: In static member function ‘static GDALDataset* GRASSDataset::Open(GDALOpenInfo*)’:
    grass57dataset.cpp:817: error: invalid conversion from ‘int (*)(char*, int)’ to ‘int (*)(const char*, int)’
    grass57dataset.cpp:817: error: initializing argument 1 of ‘int G_set_error_routine(int (*)(const char*, int))’
    make[2]: *** [../o/grass57dataset.o] Error 1
    make[2]: Leaving directory `/home/tomas/downloads/gdal-1.4.1/frmts/grass’
    make[1]: *** [grass-install-obj] Error 2
    make[1]: Leaving directory `/home/tomas/downloads/gdal-1.4.1/frmts’
    make: *** [frmts-target] Error 2

    Could You give me an advise, pleas?

    Thank You

    Tomas

  2. Gary Sherman on May 2, 2007 at 3:22 pm

    I’ll bet you are using GRASS 6.3 CVS. There has been a recent change that requires a patch for GDAL. See http://trac.osgeo.org/gdal/ticket/1587

  3. martin on May 10, 2007 at 12:16 am

    i habe the same problem. with todays grass-cvs check out and gdal-1.4.1. eventhough the bug should have been fixed following the link in the upper post, the problem remaind
    any suggestions?

    thanks
    martin

  4. Steven on May 17, 2007 at 4:06 am

    I had to install libgsl0-dev to get gsl-config, but otherwise it works great.

Leave a Reply

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

*