Building QGIS on Ubuntu 13.04

It seems upgrading to Ubuntu 13.04 breaks a few things in the QGIS build process. Here’s some quick workarounds I’ve found to get it building again.

Firstly, Ubuntu defaults to Qt 5, causing the error:

CMake Error at /usr/share/cmake-2.8/Modules/FindQt4.cmake:1216 (message):

 Found unsuitable Qt version "5.0.1" from /usr/bin/qmake, this code requires
 Qt 4.x

This can be fixed by switching the system default back to Qt 4, so that  qmake refers to the Qt 4 version. The “qt4-default” package handles this switch for you, so just run:

sudo apt-get install qt4-default

Update: A better solution was found by Pierre and Pvanb and is described here. Basically it involves changing the QMAKE_EXECUTABLE option from /usr/bin/qmake to /usr/bin/qmake-qt4.

Next, I was getting the error:

make[2]: *** No rule to make target `/usr/lib/', needed by `output/lib/'. Stop.

I’m not sure if this is the correct solution, but setting up some links and re-running ldconfig gets around this:

sudo ln -sf /usr/lib/x86_64-linux-gnu/ /usr/lib/
sudo ln -sf /usr/lib/x86_64-linux-gnu/ /usr/lib/
sudo ldconfig

Update: a better solution is to change the PYTHON_LIBRARY option from /usr/lib/ to /usr/lib/x86_64-linux-gnu/ for 64 bit environments, or /usr/lib/ to /usr/lib/i386-linux-gnu/ for 32 bit environments

These two changes were enough to get QGIS building again. If you’ve got a better solution for these errors, let me know…

Tagged , , ,

4 thoughts on “Building QGIS on Ubuntu 13.04

  1. Pierre says:

    I do not think making system-wide changes to compile a single piece of software is a good idea. You should be able to solve both issues with flags during the configuration phase.

    For example, in Archlinux I use this command to configure the build: cmake ../Quantum-GIS -DPYTHON_EXECUTABLE=/usr/bin/python2 -DPYTHON_SITE_PACKAGES_DIR=/usr/lib/python2.7/site-packages -DPYTHON_INCLUDE_PATH=/usr/include/python2.7 -DQT_INCLUDE_DIR=/usr/include/qt4

    • Nyall Dawson says:

      Yeah, I probably should revise this. Build environments aren’t my strong point, but I needed a quick way to get qgis compiling again. I’ll do some more experimenting and see if some variation of your flags works for 13.04.

    • Nyall Dawson says:

      Ok, thanks for the pointer. I’ve revised this post to reflect better solutions based on your advise.

  2. […] compile properly. Not as it turned out, but the solutions were easy and quick, thanks to posts on and […]

Leave a Reply

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