[cairo] Pycairo: can't find python devel header files?

Dimiter 'malkia' Stanev malkia at gmail.com
Wed Feb 22 13:51:59 PST 2012


Hi Fabrice,

I think this might be a Python installation problem, rather than cairo.

Maybe you need to make your python with --enable shared, as in:

make clean; configure --enable-shared --prefix=/usr --sysconfdir=/etc 
--localstatdir=/var; make; make install

It could be that libm.so/.dylib/.dll would be loaded later somehow.

Thanks,
Dimiter 'malkia' Stanev,

On 2/22/2012 11:39 AM, Fabrice DELENTE wrote:
> Hello.
>
> I have installed from scratch python 2.7 on my system with 'configure
> --prefix=/usr --sysconfdir=/etc --localstatdir=/var; make; make
> install'
>
> Then I have tried to compile py2cairo-1.10.0 but I get an error:
>
> # ./waf configure --prefix=/usr
>    ./options()
> Setting top to                           : /usr/local/testSpace/blueman/py2cairo-1.10.0
> Setting out to                           : /usr/local/testSpace/blueman/py2cairo-1.10.0/build_directory
>    ./configure()
> Checking for 'gcc' (c compiler)          : ok
> Checking for program python              : /usr/bin/python
> Checking for python version              : (2, 7, 2, 'final', 0)
> Checking for library python2.7           : yes
> Checking for program python2.7-config    : /usr/bin/python2.7-config
> Checking for header Python.h             : Could not find the python development headers
> The configuration failed
> (complete log in /usr/local/testSpace/blueman/py2cairo-1.10.0/build_directory/config.log)
>
> The config.log file shows:
>
> ---------
> Checking for header Python.h
> ==>
>
> #ifdef __cplusplus
> extern "C" {
> #endif
>          void Py_Initialize(void);
>          void Py_Finalize(void);
> #ifdef __cplusplus
> }
> #endif
> int main()
> {
>     Py_Initialize();
>     Py_Finalize();
>     return 0;
> }
>
> <==
> [1/2] ESC[32mc: build_directory/.conf_check_4655f12356c24d5ecc2679a5b579be45/test.c ->  build_directory/.conf_check_4655f12356c24d5ecc2679a5b579be45/testbuild/test.c.0.o
> ESC[0m
> ['/usr/bin/gcc', '-pthread', '-fno-strict-aliasing', '-fwrapv', '-fno-strict-aliasing', '-I/usr/include/python2.7', '-DPYTHONDIR="/usr/lib/python2.7/site-packages"', '-DPYTHONARCHDIR="[\'/usr/lib/python2.7/site-packages\']"', '-DNDEBUG', '../test.c', '-c', '-o', 'test.c.0.o']
> [2/2] ESC[33mcprogram: build_directory/.conf_check_4655f12356c24d5ecc2679a5b579be45/testbuild/test.c.0.o ->  build_directory/.conf_check_4655f12356c24d5ecc2679a5b579be45/testbuild/testprog
> ESC[0m
> ['/usr/bin/gcc', 'test.c.0.o', '-o', '/usr/local/testSpace/blueman/py2cairo-1.10.0/build_directory/.conf_check_4655f12356c24d5ecc2679a5b579be45/testbuild/testprog', '-Wl,-Bstatic', '-Wl,-Bdynamic', '-lpython2.7', '-pthread']
> err: /usr/lib/gcc/i486-slackware-linux/4.5.2/../../../libpython2.7.a(posixmodule.o): In function `posix_tmpnam':
> /home/fab/test/Python-2.7.2/./Modules/posixmodule.c:7370: warning: the use of `tmpnam_r' is dangerous, better use `mkstemp'
> /usr/lib/gcc/i486-slackware-linux/4.5.2/../../../libpython2.7.a(posixmodule.o): In function `posix_tempnam':
> /home/fab/test/Python-2.7.2/./Modules/posixmodule.c:7317: warning: the use of `tempnam' is dangerous, better use `mkstemp'
> /usr/lib/gcc/i486-slackware-linux/4.5.2/../../../libpython2.7.a(signalmodule.o): In function `timeval_from_double':
> /home/fab/test/Python-2.7.2/./Modules/signalmodule.c:112: undefined reference to `floor'
> /home/fab/test/Python-2.7.2/./Modules/signalmodule.c:112: undefined reference to `floor'
> /home/fab/test/Python-2.7.2/./Modules/signalmodule.c:113: undefined reference to `fmod'
> /home/fab/test/Python-2.7.2/./Modules/signalmodule.c:113: undefined reference to `fmod'
> /usr/lib/gcc/i486-slackware-linux/4.5.2/../../../libpython2.7.a(floatobject.o): In function `float_divmod':
> /home/fab/test/Python-2.7.2/Objects/floatobject.c:750: undefined reference to `fmod'
> /usr/lib/gcc/i486-slackware-linux/4.5.2/../../../libpython2.7.a(floatobject.o): In function `float_rem':
> /home/fab/test/Python-2.7.2/Objects/floatobject.c:718: undefined reference to `fmod'
> /usr/lib/gcc/i486-slackware-linux/4.5.2/../../../libpython2.7.a(floatobject.o): In function `float_pow':
> /home/fab/test/Python-2.7.2/Objects/floatobject.c:912: undefined reference to `pow'
> /home/fab/test/Python-2.7.2/Objects/floatobject.c:863: undefined reference to `fmod'
> ....snip...
> from /usr/local/testSpace/blueman/py2cairo-1.10.0: Test does not build: Traceback (most recent call last):
>    File "/usr/local/testSpace/blueman/py2cairo-1.10.0/.waf-1.6.3-3c3129a3ec8fb4a5bbc7ba3161463b22/waflib/Tools/c_config.py", line 435, in run_c_code
>      bld.compile()
>    File "/usr/local/testSpace/blueman/py2cairo-1.10.0/.waf-1.6.3-3c3129a3ec8fb4a5bbc7ba3161463b22/waflib/Build.py", line 193, in compile
>      raise Errors.BuildError(self.producer.error)
> BuildError: Build failed
>   ->  task failed (exit status 1):
>          {task 154509132: cprogram test.c.0.o ->  testprog}
> ['/usr/bin/gcc', 'test.c.0.o', '-o', '/usr/local/testSpace/blueman/py2cairo-1.10.0/build_directory/.conf_check_4655f12356c24d5ecc2679a5b579be45/testbuild/testprog', '-Wl,-Bstatic', '-Wl,-Bdynamic', '-lpython2.7', '-pthread']
>
> Could not find the python development headers
> ------------
>
> so there is a problem with linking libm.
>
> How can I add libm to the list of libraries to link against? I can't
> modify the waf script since it is encoded?
>
> Thanks.
>


More information about the cairo mailing list