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:
- $ export CMAKE_INSTALL_PREFIX=$HOME/bin
- $ cd QGIS
- $ mkdir build-master
- $ cd build-master
- $ 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 ...
- $ export CMAKE_INSTALL_PREFIX=$HOME/bin
- $ cd QGIS
- $ mkdir build-master
- $ cd build-master
- $ 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!):
- $ cd QGIS
- $ mkdir build-master
- $ cd build-master
- $ ccmake ..
- In the wizard set CMAKE_INSTALL_PREFIXto/home/user/bin/qgis. Make sure to appendqgishere!
- In the wizard set PYTHON_INCLUDE_PATHto/usr/include/python2.7. Should be already set.
- In the wizard set PYTHON_LIBRARYto/usr/lib/x86_64-linux-gnu/libpython2.7.so.
- Press c
- Press g
- $ make -j2The number should correspond to the number of processors in your machine.
- $ make install
- Add export LD_LIBRARY_PATH=$HOME/bin/qgis/libto your~/.bashrcor~/.zshrcand re-source the shell.
- Start QGIS from ~/bin/qgis/bin/qgis.
- You can also create a .desktopfile as described here.