[CMake] CMake inconsistent with python libraries

Alan W. Irwin irwin at beluga.phys.uvic.ca
Tue Jul 28 23:25:48 EDT 2015


On 2015-07-28 21:46-0400 Nils Guillermin wrote:

> Hello everyone,
>
> My first time posting to this mailing list so forgive me if I'm off base. I
> first wanted to make sure this was a new problem before I posted a bug
> report, as the cmake website asks. I was trying to install gr-air-modes (
> https://github.com/bistromath/gr-air-modes/) and I ran into an issue where
> CMake straight up says two things at once and the eventual result is a
> fatal Python error due to mismatched libraries.
>
> First, the cmake command I use is a plain `cmake ../`.
>
> The relevant part of the build output is
>
> -- Found PythonLibs:
> /usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib
> (found version "2.7.6")
> -- Found PythonLibs:
> /usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib
> (found suitable version "2.7.6", minimum required is "2")
>
> As far as I understand, it found python 2.7.10 files, but for some reason
> is calling them version 2.7.6. I'd expect it to say "found suitable version
> '2.7.10'" but perhaps I'm wrong.
>
> After this it builds fine, but when run immediately crashes with a Fatal
> Python Error, and the Error Reporter that comes up makes it clear that its
> a problem of mismatched libraries. I can post that if anyone needs.
>
> Am I wrong in what I'm expecting? Should I open a proper bug report?

Just to add some more information to your report in case my comments
below don't help you find the answer, what are the results of

python --version

for the same PATH setup you had when running the cmake command?

If that result is 2.7.6, that explains the above incompatibility, and
you will have to install instead a package that contains a python
interpreter that is consistent with the python libraries version you
have installed or vice versa.  If instead, the problem is multiple
versions of the python interpreter, then your software distribution
may have some method of singling out which python interpreter
alternative is the one that you want to correspond exactly to the
"python" used in the above command.  (For example, the Debian
distribution of Linux has the update-alternatives command to handle
this issue, and I presume most other Linux distributions have
something similar.) Also, look at the Python_ADDITIONAL_VERSIONS
CMake variable.  (I have no experience with that, but from what the CMake
documentation says, that is a way to select a particular version of
the interpreter and the libraries, which presumably can be used to
look only for consistent versions.)

HTH.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__________________________

Linux-powered Science
__________________________


More information about the CMake mailing list