[Python-Dev] Debian wheezy, amd64: make not finding files for bz2 and other packages

Matthias Klose doko at ubuntu.com
Wed May 9 02:17:52 CEST 2012


On 05.05.2012 16:13, Antoine Pitrou wrote:
> On Sat, 05 May 2012 16:04:40 +0200
> Christian Heimes <lists at cheimes.de> wrote:
>> Am 05.05.2012 15:39, schrieb Antoine Pitrou:
>>> On Sat, 05 May 2012 15:31:24 +0200
>>> Christian Heimes <lists at cheimes.de> wrote:
>>>> Am 05.05.2012 12:36, schrieb Antoine Pitrou:
>>>>>
>>>>> Hello,
>>>>>
>>>>> On Fri, 04 May 2012 14:07:28 -0400
>>>>> "Edward C. Jones" <edcjones at comcast.net> wrote:
>>>>>> Filelist of package libbz2-dev in wheezy of architecture amd64
>>>>>>
>>>>>> /usr/include/bzlib.h
>>>>>> /usr/lib/x86_64-linux-gnu/libbz2.a
>>>>>> /usr/lib/x86_64-linux-gnu/libbz2.so
>>>>>> /usr/share/doc/libbz2-dev
>>>>>
>>>>> setup.py probably doesn't search in the right paths for libbz2.so. I
>>>>> suggest you open a bug at http://bugs.python.org
>>>>
>>>> The issue might be caused by Debian's new multiarch libraries. In recent
>>>> versions of Debian (and Ubuntu), 64bit and 32bit libraries can coexist
>>>> on the same system.
>>>
>>> It probably is, but I thought Barry had tackled that in setup.py :-)
>>
>> The fix needs the dpkg-architecture program. As Tshepang pointed out it
>> may not be available on Edward's box. I always install build-essential
>> on all development boxes as it includes GCC, make and dpkg-dev.
> 
> Perhaps setup.py should detect that? It shouldn't be too hard to
> parse /etc/debian_version in order to know whether the system is
> multiarch-enabled. That would avoid confusing build failures.

IMO, the correct fix would be not to hard-code the system include and library
directories, but get them from gcc directly (if CC is gcc), and not relying on
dpkg-architecture.

$ gcc -v -E - </dev/null
[...]
#include <...> search starts here:
 /usr/lib/gcc/x86_64-linux-gnu/4.6/include
 /usr/local/include
 /usr/lib/gcc/x86_64-linux-gnu/4.6/include-fixed
 /usr/include/x86_64-linux-gnu
 /usr/include
End of search list.
[...]
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/4.6/:/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../lib/:/lib/x86_64-linux-gnu/:/lib/../lib/:/usr/lib/x86_64-linux-gnu/:/usr/lib/../lib/:/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../:/lib/:/usr/lib/

  Matthias


More information about the Python-Dev mailing list