Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#709181: Could NOT find PythonLibs (missing: PYTHON_INCLUDE_DIRS)

428 views
Skip to first unread message

Mathieu Malaterre

unread,
May 21, 2013, 8:10:02 AM5/21/13
to
Package: cmake
Version: 2.8.7-4~bpo60+1
Severity: important

As per documentation:

$ cmake --help-module FindPythonLibs | tail -10

If you'd like to specify the installation of Python to use, you should
modify the following cache variables:

PYTHON_LIBRARY - path to the python library
PYTHON_INCLUDE_DIR - path to where Python.h is found



Defined in: /usr/share/cmake-2.8/Modules/FindPythonLibs.cmake


Indeed the following works (resp. squeeze, wheezy):

$ cmake -DPYTHON_INCLUDE_DIR=/usr/include/python2.6 -DPYTHON_LIBRARY=/usr/lib/python2.6/config/libpython2.6.so ..

$ cmake -DPYTHON_INCLUDE_DIR=/usr/include/python2.7 -DPYTHON_LIBRARY=/usr/lib/python2.7/config/libpython2.7.so ..

However the following now fails (sid, libpython2.7 >= 2.7.5-4)

$ cmake -DPYTHON_INCLUDE_DIR=/usr/include/python2.7 -DPYTHON_LIBRARY=/usr/lib/python2.7/config-x86_64-linux-gnu/libpython2.7.so ..
CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:108 (message):
Could NOT find PythonLibs (missing: PYTHON_INCLUDE_DIRS) (found version
"2.7.5")
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)
CMakeLists.txt:2 (find_package)


-- Configuring incomplete, errors occurred!



where CMakeLists.txt is:

$ cat CMakeLists.txt
cmake_minimum_required(VERSION 2.8)
find_package(PythonLibs REQUIRED)

thanks

-- System Information:
Debian Release: 6.0.7
APT prefers oldstable-updates
APT policy: (500, 'oldstable-updates'), (500, 'oldstable'), (500, 'stable'), (200, 'testing'), (100, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-0.bpo.4-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages cmake depends on:
ii cmake-data 2.8.7-4~bpo60+1 CMake data files (modules, templat
ii libarchive1 2.8.4.forreal-1+squeeze2 Single library to read/write tar,
ii libc6 2.11.3-4 Embedded GNU C Library: Shared lib
ii libcurl3-gnutls 7.21.0-2.1+squeeze3 Multi-protocol file transfer libra
ii libexpat1 2.0.1-7+squeeze1 XML parsing C library - runtime li
ii libgcc1 1:4.4.5-8 GCC support library
ii libstdc++6 4.4.5-8 The GNU Standard C++ Library v3
ii libxmlrpc-c3 1.06.27-1.1 A lightweight RPC library based on
ii procps 1:3.2.8-9squeeze1 /proc file system utilities
ii zlib1g 1:1.2.3.4.dfsg-3 compression library - runtime

cmake recommends no packages.

Versions of packages cmake suggests:
ii gcc 4:4.4.5-1 The GNU C compiler
ii make 3.81-8 An utility for Directing compilati

-- no debconf information


--
To UNSUBSCRIBE, email to debian-bugs-...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Mathieu Malaterre

unread,
May 21, 2013, 8:40:02 AM5/21/13
to
found 709181 2.8.11-2
thanks

Hi,

On Tue, May 21, 2013 at 2:24 PM, Modestas Vainius <mo...@debian.org> wrote:
> On 2013 m. of May 21 d., Tuesday 15:01:17 Mathieu Malaterre wrote:
>> Package: cmake
>> Version: 2.8.7-4~bpo60+1
>
> Why are you using sqeeuze-bpo cmake version on sid and expect everything to
> work?

Sorry my bad. I use reportbug from my oldstable instead of my sid chroot.

>> However the following now fails (sid, libpython2.7 >= 2.7.5-4)
>
>>
>> $ cmake -DPYTHON_INCLUDE_DIR=/usr/include/python2.7
>> -DPYTHON_LIBRARY=/usr/lib/python2.7/config-x86_64-linux-gnu/libpython2.7.s
>> o .. CMake Error at
>> /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:108
>> (message): Could NOT find PythonLibs (missing: PYTHON_INCLUDE_DIRS) (found
>> version "2.7.5")
>> 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) CMakeLists.txt:2 (find_package)
>
> You need 2.8.11-1 or later to get support for multi-arched python. What is

That's no enough.

> more, to support your scenario you may need to set PYTHON_INCLUDE_DIR2 for it
> as well.

Indeed, using:

-DPYTHON_INCLUDE_DIR2=`python-config --includes | cut -f2 -d' '|cut -c3-`

makes the configure go a little further. thanks.

However due to #686407, vtk and vxl (others?) are using the
abovementionned tricks to specify correctly the python version to use
within cmake.

> However, even then, I give no guarentees that this will work. Multiarch Python
> patch is kind of crappy and I still need to figure out what to do with it.

Having to use -DPYTHON_INCLUDE_DIR2 will require source upload of a
couple of packages.

2cts

Modestas Vainius

unread,
May 21, 2013, 8:50:01 AM5/21/13
to
Hello,

On 2013 m. of May 21 d., Tuesday 15:01:17 Mathieu Malaterre wrote:
> Package: cmake
> Version: 2.8.7-4~bpo60+1

Why are you using sqeeuze-bpo cmake version on sid and expect everything to
work?

> However the following now fails (sid, libpython2.7 >= 2.7.5-4)

>
> $ cmake -DPYTHON_INCLUDE_DIR=/usr/include/python2.7
> -DPYTHON_LIBRARY=/usr/lib/python2.7/config-x86_64-linux-gnu/libpython2.7.s
> o .. CMake Error at
> /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:108
> (message): Could NOT find PythonLibs (missing: PYTHON_INCLUDE_DIRS) (found
> version "2.7.5")
> 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) CMakeLists.txt:2 (find_package)

You need 2.8.11-1 or later to get support for multi-arched python. What is
more, to support your scenario you may need to set PYTHON_INCLUDE_DIR2 for it
as well.

However, even then, I give no guarentees that this will work. Multiarch Python
patch is kind of crappy and I still need to figure out what to do with it.


Matthias Klose

unread,
May 21, 2013, 9:20:02 AM5/21/13
to
both python2.7 and python3.3 now come with a compatibility pyconfig.h header, so
adding the second search path isn't needed anymore.

seen build failures with syfi in pure unstable too (see the buildd logs) with
the current cmake version.

Scott Kitterman

unread,
May 22, 2013, 12:30:01 AM5/22/13
to
Could you try this (on top of what's in 2.8.11):

--- cmake-2.8.11.orig/Modules/FindPythonLibs.cmake
+++ cmake-2.8.11/Modules/FindPythonLibs.cmake
@@ -18,6 +18,7 @@
# the following cache variables:
# PYTHON_LIBRARY - path to the python library
# PYTHON_INCLUDE_DIR - path to where Python.h is found
+# PYTHON_INCLUDE_DIR2 - path to where pyconfig.h is found

#=============================================================================
# Copyright 2001-2009 Kitware, Inc.
@@ -121,6 +122,13 @@ foreach(_CURRENT_VERSION ${_Python_VERSI
"Path to where Python.h is found" FORCE)
endif()

+ # For backward compatibility, set PYTHON_INCLUDE_DIR2 to the value of
+ # PYTHON_INCLUDE_DIR when not set.
+ if(DEFINED PYTHON_INCLUDE_DIR AND NOT DEFINED PYTHON_INCLUDE_DIR2)
+ set(PYTHON_INCLUDE_DIR2 "${PYTHON_INCLUDE_DIR}" CACHE PATH
+ "Path to where pyconfig.h is found" FORCE)
+ endif()
+
set(PYTHON_FRAMEWORK_INCLUDES)
if(Python_FRAMEWORKS AND NOT PYTHON_INCLUDE_DIR)
foreach(dir ${Python_FRAMEWORKS})

I think that will solve the backward compatibility issue in the patch.
signature.asc
0 new messages