Bug report #5069

cmake fails to detect correct python version

Added by milovanderlinden - over 12 years ago. Updated over 10 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Build/Install
Affected QGIS version:master Regression?:No
Operating System:Archlinux Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:14836

Description

I am trying to compile qGIS from git on archlinux. My system contains various python versions:

/usr/bin/python -> python3
/usr/bin/python2 -> python2.7
/usr/bin/python2.7
/usr/bin/python2.7-config
/usr/bin/python2-config -> python2.7-config
/usr/bin/python3
/usr/bin/python3.2
/usr/bin/python3.2-config -> python3.2mu-config
/usr/bin/python3.2mu
/usr/bin/python3.2mu-config
/usr/bin/python3-config -> python3.2-config
/usr/bin/python-config -> python3-config

with ccmake I set:
PYTHON_LIBRARY /usr/bin/python2.7

But when I run cmake, output is:

-- Quantum GIS version: 1.9.90 Alpha (10990)
-- Could not find GRASS
-- Found Proj: /usr/lib/libproj.so
-- Found GEOS: /usr/lib/libgeos_c.so
-- Found GDAL: /usr/lib/libgdal.so
-- Found Expat: /usr/lib/libexpat.so
-- Found Qwt: /usr/lib/libqwt.so (6.0.1)
-- Found PostgreSQL: /usr/lib/libpq.so
-- Pedantic compiler settings enabled
-- Found Python executable: /usr/bin/python
-- Found Python include path: /usr/include/python3.2mu ### ADDED BY ME IN FindPythonLibrary.cmake ###
-- Found Python version: 3.2.2
-- Found Python library: /usr/bin/python2.7
-- Found SIP version: 4.13.2
-- Found PyQt4 version: 4.9.1
-- Found GSL: L/usr/lib -lgsl -lgslcblas -lm
-
Ctest Binary Directory set to: /data/Development/Quantum-GIS/build/output/bin
-- Configuring done
-- Generating done
-- Build files have been written to: /data/Development/Quantum-GIS/build

I isolated the problem to FindPythonLibrary.cmake, but since I am new to cmake scripts, I will need some time to investigate further, hoping to come up with a patch myself.

History

#1 Updated by Jürgen Fischer over 12 years ago

Set PYTHON_EXECUTABLE to /usr/bin/python2.7 and PYTHON_LIBRARY to /usr/lib/libpython2.7.so

#2 Updated by milovanderlinden - over 12 years ago

cmake -D PYTHON_EXECUTABLE=/usr/bin/python2.7 ..

produces

-- Quantum GIS version: 1.9.90 Alpha (10990)
-- Could not find GRASS
-- Found Proj: /usr/lib/libproj.so
-- Found GEOS: /usr/lib/libgeos_c.so
-- Found GDAL: /usr/lib/libgdal.so
-- Found Expat: /usr/lib/libexpat.so
-- Found Qwt: /usr/lib/libqwt.so (6.0.1)
-- Found PostgreSQL: /usr/lib/libpq.so
-- Pedantic compiler settings enabled
-- Found PythonInterp: /usr/bin/python2.7 (found version "2.7.2")
-- Found Python executable: /usr/bin/python2.7
-- Found Python include path: /usr/include/python2.7
-- Found Python version: 2.7.2
-- Found Python library: /usr/lib/libpython2.7.s0
-- Found SIP version: 4.13.2
-- Found PyQt4 version: 4.9.1
-- Found GSL: L/usr/lib -lgsl -lgslcblas -lm
-
Ctest Binary Directory set to: /data/Development/Quantum-GIS/build/output/bin
-- Configuring done
-- Generating done
-- Build files have been written to: /data/Development/Quantum-GIS/build

so that looks good!

Starting the make process now.

#3 Updated by milovanderlinden - over 12 years ago

Setting PYTHON_LIBRARY to /usr/lib/libpython2.7.so is necessary, but from there forward, everything works fine. This is a perfectly acceptable work around. I will see if I can add the information to the install wiki

#4 Updated by Matthias Kuhn over 10 years ago

  • Status changed from Open to Closed

Also available in: Atom PDF