Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I want to install QGIS from source on Ubuntu 13.10. (saucy). into ~/bin. There is Python 2.7.5+ installed. Therefore, I cloned the repository to my machine and checked out the master branch. First I did what the QGIS documentation recommends:

  1. $ export CMAKE_INSTALL_PREFIX=$HOME/bin
  2. $ cd QGIS
  3. $ mkdir build-master
  4. $ cd build-master
  5. $ ccmake ..

CMake stops with the following error message:

CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake files: PYTHON_LIBRARY
linked by target "qgispython" in directory /home/jjd/QGIS/src/python
linked by target "python_module_qgis_analysis" in directory /home/jjd/QGIS/python
linked by target "python_module_qgis_core" in directory /home/jjd/QGIS/python
linked by target "python_module_qgis_gui" in directory /home/jjd/QGIS/python
linked by target "python_module_qgis_networkanalysis" in directory /home/jjd/QGIS/python

Second try following the advise of Secagy ...

  1. $ export CMAKE_INSTALL_PREFIX=$HOME/bin
  2. $ cd QGIS
  3. $ mkdir build-master
  4. $ cd build-master
  5. $ ccmake -DPYTHON_LIBRARY=/usr/bin/python2 ..

This time CMake stops with:

BINDINGS_GLOBAL_INSTALL: Install bindings to global python directory? (might need root)

Running the above command with sudo does not make a difference. In the following I tried various build flags inspired by different posts without success.

References:


Solution

Actually, the message "BINDINGS_GLOBAL_INSTALL: Install bindings to global python directory? (might need root)" shown at the bottom is not an error but a help message. So after supplying the include and library paths I could continue by pressing g in the ccmake wizard to start the generate task.
Here are the steps (customize the paths for your system!):

  1. $ cd QGIS
  2. $ mkdir build-master
  3. $ cd build-master
  4. $ ccmake ..
  5. In the wizard set CMAKE_INSTALL_PREFIX to /home/user/bin/qgis. Make sure to append qgis here!
  6. In the wizard set PYTHON_INCLUDE_PATH to /usr/include/python2.7. Should be already set.
  7. In the wizard set PYTHON_LIBRARY to /usr/lib/x86_64-linux-gnu/libpython2.7.so.
  8. Press c
  9. Press g
  10. $ make -j2 The number should correspond to the number of processors in your machine.
  11. $ make install
  12. Add export LD_LIBRARY_PATH=$HOME/bin/qgis/lib to your ~/.bashrc or ~/.zshrc and re-source the shell.
  13. Start QGIS from ~/bin/qgis/bin/qgis.
  14. You can also create a .desktop file as described here.
share|improve this question

1 Answer 1

up vote 1 down vote accepted

in the ccmake step there are two PYTHON related paths:

the header files:

PYTHON_INCLUDE_PATH (with me pointing to: /usr/include/python2.7)

and the libs:

PYTHON_LIBRARY (with me pointing to: /usr/lib/x86_64-linux-gnu/libpython2.7.so)

of course pick the right paths in your own situation.

share|improve this answer
    
Same paths on my system. So I tried ccmake -DPYTHON_LIBRARY=/usr/lib/x86_64-linux-gnu/libpython2.7.so -DPYTHON_INCLUDE_PATH=/usr/include/python2.7 .. but the problem remains. –  JJD Jun 16 at 10:45

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.