[Python-bugs-list] [ python-Bugs-232606 ] 2.1a2 _tkinter build may pick up wrong Tcl/Tk versions

noreply@sourceforge.net noreply@sourceforge.net
Sat, 17 Mar 2001 17:40:50 -0800


Bugs item #232606, was updated on 2001-02-15 13:21
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=232606&group_id=5470

Category: Build
Group: None
Status: Closed
Priority: 5
Submitted By: Mark Favas (mfavas)
Assigned to: A.M. Kuchling (akuchling)
Summary: 2.1a2 _tkinter build may pick up wrong Tcl/Tk versions

Initial Comment:
Platform: Compaq Tru64 Unix, Version 4.0F, Compaq C V6.3-129 (dtk) on Digital UNIX V4.0F  (Rev. 1229), Compiler Driver V6.3-126 (dtk) cc Driver

setup.py generates the following compile and link lines for _tkinter.c:

cc -O -Olimit 1500 -DWITH_APPINIT=1 -I/usr/X11/include -I. -I/home/gonzo1/mark/groucho1/mark/src/python/CVS/python/dist/src/./Include -IInclude/ -I/usr/local/include -c /home/gonzo1/mark/groucho1/mark/src/python/CVS/python/dist/src/Modules/
_tkinter.c -o build/temp.osf1-V4.0-alpha-2.1/_tkinter.o
cc -O -Olimit 1500 -DWITH_APPINIT=1 -I/usr/X11/include -I. -I/home/gonzo1/mark/groucho1/mark/src/python/CVS/python/dist/src/./Include -IInclude/ -I/usr/local/include -c /home/gonzo1/mark/groucho1/mark/src/python/CVS/python/dist/src/Modules/
tkappinit.c -o build/temp.osf1-V4.0-alpha-2.1/tkappinit.o
ld -shared -expect_unresolved * build/temp.osf1-V4.0-alpha-2.1/_tkinter.o build/
temp.osf1-V4.0-alpha-2.1/tkappinit.o -L/usr/X11/lib -L/usr/local/lib -ltk8.0 -lt
cl8.0 -lX11 -o build/lib.osf1-V4.0-alpha-2.1/_tkinter.so

/usr/X11/include precedes /usr/local/include and /usr/X11/lib precedes /usr/local/lib and will be searched first.  /usr/X11/{include,lib} are, according to the comment in setup.py, the default location for X11. If a system comes with Tcl/Tk installed, and the user installs a later version in /usr/local, setup.py will use the earlier version's include files and (probably) the later versions library files, assuming the version number is part of the library filename and "-l{tcl,tk}" string. This mismatch will not be good... This is the case with Tru64, which comes with an old (7.6) version of Tcl/Tk. The only reason I didn't fall foul of this gotcha was that Tru64 doesn't have a /usr/X11 directory - it has the standard (but probably pre-Linux standard!) /usr/include/X11 and /usr/lib/X11 structure. I'd suggest that for both the includes and libs /usr/local should appear before the "default" system X11 directories.


----------------------------------------------------------------------

>Comment By: Mark Favas (mfavas)
Date: 2001-03-17 17:40

Message:
Logged In: YES 
user_id=44979

Unfortunately, no - the _tkinter compile command is still
generated as:
cc -O -Olimit 1500 -DWITH_APPINIT=1 -I/usr/X11/include -I.
-I/blah/./Include -I/usr/local/include -IInclude/ -c
/blah/Modules/_tkinter.c -o
build/temp.osf1-V4.0-alpha-2.1/_tkinter.o

so a system with an earlier version of Tcl/Tk installed in
/usr/X11/include will pick up the includes (Tcl.h and Tk.h)
from there, rather than the later versions installed in
/usr/local/include. The link phase has a similar order, and,
since it looks for specific versions (-ltk8.0, for example)
is likely to pick up a library that doesn't match the
includes.

The other changes to setup.py to put
/usr/local/{include,lib} first in the search path are good
ones - they just don't apply to _tkinter. 



----------------------------------------------------------------------

Comment By: A.M. Kuchling (akuchling)
Date: 2001-03-17 11:53

Message:
Logged In: YES 
user_id=11375

>From looking at the setup.py code, I believe this problem 
should also be fixed by the change  to put /usr/local first
in inc_dirs and lib_dirs.  

----------------------------------------------------------------------

Comment By: A.M. Kuchling (akuchling)
Date: 2001-02-23 08:45

Message:
The handling of include and lib directories has changed a bit; does it still pick up the wrong versions?

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=232606&group_id=5470