Tiny Core Linux

Tiny Core Extensions => TCE Q&A Forum => Topic started by: kagashe on December 22, 2008, 10:10:40 AM

Title: {SOLVED} Compiling pygtk-2,12,1 error headers not found.
Post by: kagashe on December 22, 2008, 10:10:40 AM
I am trying to compile pygtk-2.12.1 and getting error:
Quote
Checking for headers required to compile python extensions... not found
configure: error: could not find Python headers.
I have loaded python and python-devs

kagashe

This is how it was solved:
I used python and python-dev .tce packages instead .tcz and the headers were detected. I don't know why it did not work on .tcz although, headers were in the same location.
Title: Re: Compiling pygtk-2,12,1 error headers not found.
Post by: Jason W on December 22, 2008, 10:22:18 AM
I assume you also issued:

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig

That is of course needed when building against most extensions.
Title: Re: Compiling pygtk-2,12,1 error headers not found.
Post by: kagashe on December 22, 2008, 10:38:41 AM
I assume you also issued:

export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig

That is of course needed when building against most extensions.
yes.

kagashe
Title: Re: Compiling pygtk-2,12,1 error headers not found.
Post by: Jason W on December 22, 2008, 11:03:14 AM
I am not on TC now and won't be until Friday, but one more thought would be to

export CPPFLAGS="-I/usr/local/include"

if the Python.h is under /usr/local/include. 
Title: Re: Compiling pygtk-2,12,1 error headers not found.
Post by: kagashe on December 22, 2008, 11:14:58 AM
I am not on TC now and won't be until Friday, but one more thought would be to

export CPPFLAGS="-I/usr/local/include"

if the Python.h is under /usr/local/include. 
it is at /usr/local/include/python2.5

kagashe
Title: Re: Compiling pygtk-2,12,1 error headers not found.
Post by: Jason W on December 22, 2008, 04:17:52 PM
One more thing, do you also have pygobject and pycairo built, and perhaps libglade loaded?  Looking around those seem to also be dependencies.  That is of course in addition to the usual gtk-dev stuff which I am sure you already have loaded.

Pygtk was on the list of things I was going to build since there is an Mplayer front end that uses it I would like to try.  Pygobject as well as pycairo if they are needed could go in the same extension as pygtk.  I am able to sneak about an hour with TC now so I will try to help see what the issue is.  I wil let you know if I see what is causing an error.
Title: Re: Compiling pygtk-2,12,1 error headers not found.
Post by: Jason W on December 22, 2008, 05:15:32 PM
I was able to compile pygtk with the above mentioned stuff.  Basically:

Load Xorg-devs and gtk2-devs and dependencies ( I will create a dependency file for gtk2-devs as it is quite a list and I get tired of hunting them down after a clean install. ) python/devs and libglade.

Be prepared for the usual issue of some Xlib .la files in /usr/local/lib instead of /usr/lib.  Pycairo will complain of missing .la files in /usr/lib as they are located in /usr/local/lib.

Build and install pygobject, pycairo, and then pygtk.

Let us know if there are any other  issues with the build.



Title: Re: Compiling pygtk-2,12,1 error headers not found.
Post by: kagashe on December 23, 2008, 06:30:58 AM
Be prepared for the usual issue of some Xlib .la files in /usr/local/lib instead of /usr/lib.  Pycairo will complain of missing .la files in /usr/lib as they are located in /usr/local/lib
What to do for the errors?
Quote
grep: /usr/lib/libexpat.la: No such file or directory
/bin/sed: can't read /usr/lib/libexpat.la: No such file or directory
libtool: link: '/usr/libexpat.la' is not a valid libtool archive
make[2]: *** [_cairo.la] Error 1
make[2]: Leaving directory '/tmp/pycairo-1.4.0'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/tmp/pycairo-1.4.0'
make: *** [all] Error 2

kagashe
Title: Re: Compiling pygtk-2,12,1 error headers not found.
Post by: Juanito on December 23, 2008, 07:32:45 AM
from the error message, either you don't have the expat2/expat2-devs extensions loaded or you need PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/local/lib/pkgconfig"
Title: Re: Compiling pygtk-2,12,1 error headers not found.
Post by: kagashe on December 23, 2008, 07:44:12 AM
from the error message, either you don't have the expat2/expat2-devs extensions loaded or you need PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/local/lib/pkgconfig"
libexpat.la is there is /usr/local/lib
Make is looking for in /usr/lib

PKG_CONFIG_PATH has been set.

kagashe
Title: Re: Compiling pygtk-2,12,1 error headers not found.
Post by: Juanito on December 23, 2008, 07:49:17 AM
you might be be able to get by if you make symlinks to the missing libs, eg:
Code: [Select]
$ sudo ln -s /usr/local/lib/libexpat.la /usr/lib
Title: Re: Compiling pygtk-2,12,1 error headers not found.
Post by: kagashe on December 23, 2008, 08:01:08 AM
you might be be able to get by if you make symlinks to the missing libs, eg:
Code: [Select]
$ sudo ln -s /usr/local/lib/libexpat.la /usr/lib
Then it is complaining for next libXrender.la
then next libX11.la

How can I go on setting symlinks?

kagashe
Title: Re: Compiling pygtk-2,12,1 error headers not found.
Post by: Juanito on December 23, 2008, 09:00:43 AM
Code: [Select]
$ sudo ln -s /usr/local/lib/libXrender.la /usr/lib
$ sudo ln -s /usr/local/lib/libX11.la /usr/lib

..but it might be better to try "export LDFLAGS=$LDFLAGS:/usr/local/lib" and then run ./configure again?
Title: Re: Compiling pygtk-2,12,1 error headers not found.
Post by: Jason W on December 23, 2008, 10:32:16 AM
expat dev files get installed by three different extensions- Xorg-dev, expat-dev, and perl_xml.  So they are present in both /usr/lib and /usr/local/lib.  That is ok since they are all the same version.  So by all means expat should be detected as present.  But somewhare some files get lost since I noticed the same error with expat. 

Xorg-dev places it's .la and .a files in /usr/local/lib though the ones whose shared libs are in /usr/lib seem to expect to find the .a and .la files there when compiling.  I may soon move files around in my own copy of xorg-dev and edit the pkgconfig files and see if that helps as I run into this issue every time I compile anything involving X.
Title: Re: Compiling pygtk-2,12,1 error headers not found.
Post by: kagashe on December 23, 2008, 10:54:09 AM
Code: [Select]
$ sudo ln -s /usr/local/lib/libXrender.la /usr/lib
$ sudo ln -s /usr/local/lib/libX11.la /usr/lib

..but it might be better to try "export LDFLAGS=$LDFLAGS:/usr/local/lib" and then run ./configure again?
This results into error:
Quote
configure: error: C compiler cannot create executables.

kagashe
Title: Re: Compiling pygtk-2,12,1 error headers not found.
Post by: kagashe on December 23, 2008, 10:57:47 AM
I think that problem with installing libcairo is "all libraries are not available at one place".

kagashe
Title: Re: Compiling pygtk-2,12,1 error headers not found.
Post by: Juanito on December 23, 2008, 11:32:03 AM
ah - perhaps LDFLAGS was unset and you need "export LDFLAGS=/lib:/usr/lib:/usr/local/lib"

..or otherwise continue down the symlinks route  :)
Title: Re: Compiling pygtk-2,12,1 error headers not found.
Post by: kagashe on December 24, 2008, 04:05:06 AM
ah - perhaps LDFLAGS was unset and you need "export LDFLAGS=/lib:/usr/lib:/usr/local/lib"

..or otherwise continue down the symlinks route  :)
Let me clarify what is happening. I could configure PYcairo but the make failed to detect those libs. When I try to configure with "export LDFLAGS=/lib:/usr/lib:/usr/local/lib" I get the error:
Quote
configure: error: C compiler cannot create executables.

Now I am trying to compile cairo (required by pycairo and assuming it is not present) it fails to detect pixman (which is present).

kagashe
Title: Re: Compiling pygtk-2,12,1 error headers not found.
Post by: Jason W on December 24, 2008, 04:12:16 AM
Cairo is part of gtk+-2 in TC, so it is present.

It still sounds like you have a bad syntax in your exported flags.  I usually use something like this for LDFLAGS:

export LDFLAGS="-L/usr/local/lib -L/usr/lib"

I am not saying Juanito is wrong, but I have not tried other LDFLAGS syntax and I cannot test it now to see.

ALso, pycairo will not detect GTK and other libs if it is still having trouble with with the X development libs.
Title: Re: Compiling pygtk-2,12,1 error headers not found.
Post by: Juanito on December 24, 2008, 11:10:10 AM
Quote
I am not saying Juanito is wrong
but I think I was wrong - well spotted, I should have had the -L in front of each lib location.

Note that one other option is to edit the Makefile and correct the location of the libs - the line(s) to edit are usually near the beginning.
Title: Re: Compiling pygtk-2,12,1 error headers not found.
Post by: kagashe on December 24, 2008, 11:09:22 PM
While I am trying to compile this package it is a good learning experince and thanks to both of you Jason and Juanito. Couple of questions:

Although the Python.h was in /usr/local/include/python2.5 (I think that is the default location) it could be detected only when I used python.tce. Using python.tcz always produced error no matter what I do with CPPFLAGS.

Similarly even after using correct syntax in LDFLAGS the libs in /usr/local/lib were not detected, however, "sudo ln -s /usr/local/xxxx.la /usr/lib" seems to work.

That brings me to the questions:
1. Is it necessary to use .tce packages instead of .tcz for compiling? Specially when our libs are located in /usr/local/lib?

2. When I compile with "sudo ln -s /usr/local/xxxx.la /usr/lib" the compiled program may also look for the symlink in /usr/lib and not finding it fails.

I will try the suggestion of Juanito to edit the makefile.

With the above I could compile pygobject and pycairo and almost succeeded in compiling pygtk but pygtk hangs in make at this point:
Creating gtkunixprint.la
..
..
..
gtk:c:68363:...:assignment for incomplete pointer type

It might be hanging also because I am trying this on 256 MB RAM machine and Python and Python-devs are loaded as .tce, others (gtk, libs Xorg etc) are .tcz.

I will also try disabling gtkunixprint in ./configure.
Title: Re: Compiling pygtk-2,12,1 error headers not found.
Post by: Juanito on December 25, 2008, 03:45:23 AM
That brings me to the questions:
1. Is it necessary to use .tce packages instead of .tcz for compiling? Specially when our libs are located in /usr/local/lib?

2. When I compile with "sudo ln -s /usr/local/xxxx.la /usr/lib" the compiled program may also look for the symlink in /usr/lib and not finding it fails.
ref 1: I've used tcz extensions to compile large stuff like oo without problems

ref 2: As long as you use "l" in the extension name (i.e. tcel), the libraries will be loaded and you should be OK
Title: Re: {SOLVED} Compiling pygtk-2,12,1 error headers not found.
Post by: kagashe on December 25, 2008, 04:37:35 AM
I have finally compiled pygtk-2.10.6.tcelm package which includes pygobject-2.12.3 pycairo-1.4.0 and pygtk-2.10.6

I did not go for pygtk-2.12.1 because of dependency problems with cairo.

kagashe
Title: Re: {SOLVED} Compiling pygtk-2,12,1 error headers not found.
Post by: jls on March 24, 2009, 09:01:54 AM
I can't see pygtk in the repository
Title: Re: {SOLVED} Compiling pygtk-2,12,1 error headers not found.
Post by: jls on March 24, 2009, 08:39:38 PM
never mind I compiled myself all this libs for nicotine, I'll send soon to the tcl team