I am trying to build inria Graphite on my ubuntu which is running in a VirtualBox simulator, I follow the instructions, and install the python-dev
packages, but when I run cmake , still got an error:
CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:108 (message):
Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS)
(Required is at least version "3.2")
Call Stack (most recent call first):
/usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:315 (_FPHSA_FAILURE_MESSAGE)
/usr/share/cmake-2.8/Modules/FindPythonLibs.cmake:208 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
src/packages/OGF/gel_python3/CMakeLists.txt:11 (FIND_PACKAGE)
I checked the /usr/lib/
and find
tintin@tintin-VirtualBox:/usr/lib$ find . -name "libpython*"
./x86_64-linux-gnu/libpython3.4m.so.1.0
./x86_64-linux-gnu/libpython2.7.so.1.0
./x86_64-linux-gnu/libpython3.4m.a
./x86_64-linux-gnu/libpython2.7.a
./x86_64-linux-gnu/libpython3.4m.so
./x86_64-linux-gnu/libpython2.7.so
./x86_64-linux-gnu/libpython2.7.so.1
./x86_64-linux-gnu/libpython3.4m.so.1
so why cmake can not find the PythonLibs, or how should I deal with this?
Installing
python-dev
actually fixed this for me:Got the hint here: https://github.com/Valloric/YouCompleteMe/issues/484
The problem seems to be that Ubuntu 14.04 installs Python 3.4 by default and the CMake version from Ubuntu (2.8) only searches up to Python 3.3. A workaround is to add
set(Python_ADDITIONAL_VERSIONS 3.4)
before thefind_package
statement. Note that I filed a bug about this issue.Since CMake 3.0, CMake searches up to Python 3.4, so installing that version manually should also fix the problem.
For me the issue was a bad cache
Removed the cache with the old 2.7 version and allowed it to find 3.2 in my case.
The cmake I used is
I recently had a similar issue with Ubuntu 14.04 64-bit; apparently, CMake does not look into architecture dependent install folders by default:
(from CMake 2.8.12 online documentation of the find_package command)
A solution consists in setting this CMAKE_LIBRARY_ARCHITECTURE in the project root CMakeLists.txt file (in your case that would be editing src/packages/OGF/gel_python3/CMakeLists.txt) before calling find_package for PythonLibs; for instance:
That worked in my case.