[Tkinter-discuss] Building python 2.6.5 w/TK-TCL 8.5.11 on linux, 32 & 64 bit

jrm at exa.com jrm at exa.com
Tue Feb 14 18:26:01 CET 2012


I may have made some headway, everything seems to build, but still no joy.

1) My configure command looks like this:

  ./configure --prefix="/proj/python/2.6.5-08-jrm-01/x86_linux_na" \
                   --with-tk="/proj/tools/tk/8.5.11-01/x86_linux_na/lib" \
                  --with-tcl="/proj/tools/tcl/8.5.11-01/x86_linux_na/lib" \


2) I've also set LD_LIBRARY_PATH and CFLAGS to include the appropriate
-I and -L flags beforehand invoking configure

CFLAGS="-D_FILE_OFFSET_BITS=64 -D_LARGE_FILES=1 -D_XOPEN_SOURCE=1
-march=i686 -O3 -DQT_NO_DEBUG  -L/proj/readline/6.1-03/x86_linux_na/lib
-L/proj/tools/tk/8.5.11-01/x86_linux_na/lib
-L/proj/tools/tcl/8.5.11-01/x86_linux_na/lib
-I/proj/tools/tk/8.5.11-01/x86_linux_na/include
-I/proj/tools/tcl/8.5.11-01/x86_linux_na/include
-I/proj/readline/6.1-03/x86_linux_na/include" ; export CFLAGS;
LDFLAGS="-D_FILE_OFFSET_BITS=64 -D_LARGE_FILES=1 -D_XOPEN_SOURCE=1
-march=i686 -O3 -DQT_NO_DEBUG  -L/proj/readline/6.1-03/x86_linux_na/lib
-L/proj/tools/tk/8.5.11-01/x86_linux_na/lib
-L/proj/tools/tcl/8.5.11-01/x86_linux_na/lib" ; export LDFLAGS;


3) I added some print statements to the setup.py operation, and it's now
definitely finding what I want it to:
ENTERING detect_tkinter!
  inc_dirs = ['.', 'Include', './Include',
'/proj/python/2.6.5-08-jrm-01/x86_linux_na/Python-2.6.5/Include',
'/proj/python/2.6.5-08-jrm-01/x86_linux_na/Python-2.6.5',
'/usr/include']
  lib_dirs = ['/proj/readline/6.1-03/x86_linux_na/lib',
'/proj/tools/tk/8.5.11-01/x86_linux_na/lib',
'/proj/tools/tcl/8.5.11-01/x86_linux_na/lib', '/lib64', '/usr/lib64',
'/lib', '/usr/lib']
  for version 8.5, found
/proj/tools/tk/8.5.11-01/x86_linux_na/lib/libtk8.5.so and
/proj/tools/tcl/8.5.11-01/x86_linux_na/lib/libtcl8.5.so
  finished library search with
/proj/tools/tk/8.5.11-01/x86_linux_na/lib/libtk8.5.so and
/proj/tools/tcl/8.5.11-01/x86_linux_na/lib/libtcl8.5.so


4) The build of the _tkinter module seems to go correctly too!

...
building '_tkinter' extension
/opt/gcc-4.3.2/bin/gcc -m32 -D__LINUX__ -D__X86_LINUX__
-D__X86_LINUX2_NA__ -pthread -fPIC -fno-strict-aliasing -DNDEBUG -g -O3
-Wall -Wstrict-prototypes -DWITH_APPINIT=1 -I/usr/X11R6/include -I.
-I/proj/python/2.6.5-08-jrm-01/x86_linux_na/Python-2.6.5/./Include -I.
-IInclude -I./Include
-I/proj/python/2.6.5-08-jrm-01/x86_linux_na/Python-2.6.5/Include
-I/proj/python/2.6.5-08-jrm-01/x86_linux_na/Python-2.6.5 -c
/proj/python/2.6.5-08-jrm-01/x86_linux_na/Python-2.6.5/Modules/_tkinter.c
-o
build/temp.linux-x86_64-2.6/proj/python/2.6.5-08-jrm-01/x86_linux_na/Python-2.6.5/Modules/_tkinter.o
/opt/gcc-4.3.2/bin/gcc -m32 -D__LINUX__ -D__X86_LINUX__
-D__X86_LINUX2_NA__ -pthread -fPIC -fno-strict-aliasing -DNDEBUG -g -O3
-Wall -Wstrict-prototypes -DWITH_APPINIT=1 -I/usr/X11R6/include -I.
-I/proj/python/2.6.5-08-jrm-01/x86_linux_na/Python-2.6.5/./Include -I.
-IInclude -I./Include
-I/proj/python/2.6.5-08-jrm-01/x86_linux_na/Python-2.6.5/Include
-I/proj/python/2.6.5-08-jrm-01/x86_linux_na/Python-2.6.5 -c
/proj/python/2.6.5-08-jrm-01/x86_linux_na/Python-2.6.5/Modules/tkappinit.c
-o
build/temp.linux-x86_64-2.6/proj/python/2.6.5-08-jrm-01/x86_linux_na/Python-2.6.5/Modules/tkappinit.o
/opt/gcc-4.3.2/bin/gcc -m32 -D__LINUX__ -D__X86_LINUX__
-D__X86_LINUX2_NA__ -pthread -shared -D_FILE_OFFSET_BITS=64
-D_LARGE_FILES=1 -D_XOPEN_SOURCE=1 -march=i686 -O3 -DQT_NO_DEBUG
-D_FILE_OFFSET_BITS=64 -D_LARGE_FILES=1 -D_XOPEN_SOURCE=1 -march=i686 -O3
-DQT_NO_DEBUG
build/temp.linux-x86_64-2.6/proj/python/2.6.5-08-jrm-01/x86_linux_na/Python-2.6.5/Modules/_tkinter.o
build/temp.linux-x86_64-2.6/proj/python/2.6.5-08-jrm-01/x86_linux_na/Python-2.6.5/Modules/tkappinit.o
-L/usr/X11R6/lib64 -L/usr/X11R6/lib
-L/proj/readline/6.1-03/x86_linux_na/lib
-L/proj/tools/tk/8.5.11-01/x86_linux_na/lib
-L/proj/tools/tcl/8.5.11-01/x86_linux_na/lib -ltk8.5 -ltcl8.5 -lX11 -o
build/lib.linux-x86_64-2.6/_tkinter.so
/opt/binutils-2.19.1/bin/ld: skipping incompatible
/usr/X11R6/lib64/libX11.so when searching for -lX11
/opt/binutils-2.19.1/bin/ld: skipping incompatible
/usr/X11R6/lib64/libX11.a when searching for -lX11
creating build/temp.linux-x86_64-2.6/libffi
...


5) Yet, at the ultimate moment of invocation.... :( !!!!


dust:/sw/registry/13796-tk_python-01/serverdist/dist/x86_linux/lib% exapython
Python 2.6.5 (r265:79063, Feb 14 2012, 11:46:18)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import Tkinter
>>> print Tkinter.TkVersion
8.4


6) I checked sys.path, and verified that it had a specification for
tk-lib.  I thought that perhaps the system library versions of 8.4
tcl/tk might be getting found so I put the 8.5 versions in a location
I figured would be checked first:

>>> import os
>>> print os.environ["LD_LIBRARY_PATH"]
/proj/registry/13796-tk_python-01/serverdist/dist/x86_linux/lib:/grid/sge/lib/glinux:/usr/exaplat/lib:/opt/gm/lib:/opt/mx/lib
>>>
dust:/sw/registry/13796-tk_python-01/serverdist/dist/x86_linux/lib% ls
/proj/registry/13796-tk_python-01/serverdist/dist/x86_linux/lib/*tk*.so
/proj/registry/13796-tk_python-01/serverdist/dist/x86_linux/lib/libtk8.5.so
dust:/sw/registry/13796-tk_python-01/serverdist/dist/x86_linux/lib% ls
/proj/registry/13796-tk_python-01/serverdist/dist/x86_linux/lib/*tcl*.so
/proj/registry/13796-tk_python-01/serverdist/dist/x86_linux/lib/libtcl8.5.so

The files were there alright - but it didn't help...

-jrm



> Hi,
>
> Thus spoketh jrm at exa.com
> unto us on Mon, 13 Feb 2012 21:04:49 -0500 (EST):
>
>> Trying to build python 2.6.5 with a modern TK.  The obvious approach of
>> setting --with-tcl and --with-tk at configure time is nicely consumed
>> without error...and then does nothing!   When the setup.py script runs
>> to build _tkinter later, the 8.5 information is nowhere to be found.
>>
>> I'm presently trying to hack the 8.5 information directly into setup.py
>> but that's not going smoothly.  There must be a better way...
>>
>> Has anyone else experienced this situation?
>>
>> BTW, upgrading to 3 is not an option...
>>
>
> I am not sure what actually happens, is no _tkinter built at all or does
> it build, but against the wrong of multiple installed Tk versions?
>
> Then, have you checked that all necessary Tcl/Tk headers are installed?
> If yes, maybe before compiling Python calling
>
>    $ export LD_LIBRARY_PATH=/usr/local/lib
>
> (or where ever your Tk-8.5 install resides of course) may help. If not,
> then please give us more information about your system, installed library
> versions, error messages while compiling and so on.
>
> Best regards
>
> Michael
>
> .-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.
>
> It would seem that evil retreats when forcibly confronted.
> 		-- Yarnek of Excalbia, "The Savage Curtain", stardate
>                    5906.5
> _______________________________________________
> Tkinter-discuss mailing list
> Tkinter-discuss at python.org
> http://mail.python.org/mailman/listinfo/tkinter-discuss
>




More information about the Tkinter-discuss mailing list