← Back to team overview

kicad-developers team mailing list archive

CMake doesn't find the right PythonLibs on recent Ubuntus, workaround included

 

As part of setting up the build server, I've been taking a harder look
at the Ubuntu packages.

CMake isn't detecting the right Python libs on some systems, including
Ubuntu 12.10.  I'm not sure if the issue is in CMake, or Ubuntu, or
Python, or whatever else, but there's a simple enough workaround...

If you get something like this when you cmake for kicad:

-- Found PythonInterp: /usr/bin/python (found version "2.7.3")
-- Check for installed Python Interpreter -- found
-- Python module install path: /usr/lib/python2.7/dist-packages
-- Found PythonLibs: /usr/lib/python3.2/config/libpython3.2.so (found
version "2.7.3")

Your build will probably die when it reaches anything SWIGgy, due to
CMake detecting /usr/lib/python3.2/config/libpython3.2.so as matching
the version of your interpreter, which is 2.7.3.  You can point cmake
to the appropriate PythonLibs, like the following:

cmake ../ -DKICAD_TESTING_VERSION=ON -DKICAD_SCRIPTING=ON
-DKICAD_SCRIPTING_MODULES=ON -DKICAD_SCRIPTING_WXPYTHON=ON
-DCMAKE_BUILD_TYPE=DEBUG
-DPYTHON_LIBRARY=/usr/lib/python2.7/config/libpython2.7.so

This appears to fix it.  I can make builds and use the Python library.

This has been documented by some other folks, with a different
workaround as well.  If you add a minimum version number requirement,
like find_package(PythonLibs 2.6) it seems to work on Ubuntu as well.
With all the cmake balls we're juggling, it's probably safest to just
override it on the command line until it gets fixed upstream.

References:
http://public.kitware.com/Bug/view.php?id=13794
http://www.ruby-forum.com/topic/4151421

Adam Wolf
Wayne and Layne, LLC


Follow ups