Mailing List Archive

Problem compiling Python on Suse 6.1
I have a problem compiling Python 1.5.2 with Tk and readline support.
I'm using Suse 6.1 (evaluation iso):
gcc version egcs-2.91.66 19990314 (egcs-1.1.2 release)
Tcl/Tk 8.0.5
bash-2.02

Can somebody help me.

Here is what I get when I run 'make' ( this is only the part with
errors).

make[1]: Entering directory `/home/tomaz/src/Python-1.5.2/Modules'
gcc -Xlinker -export-dynamic python.o \
../libpython1.5.a -lreadline
-L/usr/lib/libtermcap.so.2 -L/usr/X11/lib -ltk8.0
-ltcl8.0 -L/usr/X11R6/lib -lX11 -lieee -ldl -lm -o python
../libpython1.5.a(_tkinter.o): In function `Tkapp_CreateFileHandler':
/home/tomaz/src/Python-1.5.2/Modules/./_tkinter.c:1456: undefined
reference to `Tcl_GetFile'
../libpython1.5.a(_tkinter.o): In function `Tkapp_DeleteFileHandler':
/home/tomaz/src/Python-1.5.2/Modules/./_tkinter.c:1483: undefined
reference to `Tcl_GetFile'
../libpython1.5.a(_tkinter.o): In function `EventHook':
/home/tomaz/src/Python-1.5.2/Modules/./_tkinter.c:1912: undefined
reference to `Tcl_GetFile'
/usr/lib/libreadline.a(display.o): In function `rl_redisplay':
display.o(.text+0xb6e): undefined reference to `tputs'
/usr/lib/libreadline.a(display.o): In function `update_line':
display.o(.text+0x10c2): undefined reference to `tputs'
/usr/lib/libreadline.a(display.o): In function
`_rl_move_cursor_relative':
display.o(.text+0x1399): undefined reference to `tputs'
/usr/lib/libreadline.a(display.o): In function `_rl_move_vert':
display.o(.text+0x143f): undefined reference to `tputs'
display.o(.text+0x1476): undefined reference to `tputs'
/usr/lib/libreadline.a(display.o)(.text+0x1948): more undefined
references to `tputs' follow
/usr/lib/libreadline.a(display.o): In function `insert_some_chars':
display.o(.text+0x19ea): undefined reference to `tgoto'
display.o(.text+0x19f7): undefined reference to `tputs'
display.o(.text+0x1a27): undefined reference to `tputs'
display.o(.text+0x1a52): undefined reference to `tputs'
display.o(.text+0x1a7f): undefined reference to `tputs'
/usr/lib/libreadline.a(display.o): In function `delete_chars':
display.o(.text+0x1ab1): undefined reference to `tgoto'
display.o(.text+0x1abd): undefined reference to `tputs'
display.o(.text+0x1af2): undefined reference to `tputs'
/usr/lib/libreadline.a(display.o): In function `cr':
display.o(.text+0x1bf5): undefined reference to `tputs'
/usr/lib/libreadline.a(display.o): In function
`_rl_redisplay_after_sigwinch':
display.o(.text+0x1c2c): undefined reference to `tputs'
display.o(.text+0x1c4f): undefined reference to `tputs'
/usr/lib/libreadline.a(display.o)(.text+0x1c79): more undefined
references to `tputs' follow
/usr/lib/libreadline.a(terminal.o): In function `_rl_get_screen_size':
terminal.o(.text+0x84): undefined reference to `tgetnum'
terminal.o(.text+0xda): undefined reference to `tgetnum'
/usr/lib/libreadline.a(terminal.o): In function `get_term_capabilities':
terminal.o(.text+0x1b3): undefined reference to `tgetstr'
/usr/lib/libreadline.a(terminal.o): In function `_rl_init_terminal_io':
terminal.o(.text+0x26b): undefined reference to `tgetent'
terminal.o(.text+0x35c): undefined reference to `PC'
terminal.o(.text+0x366): undefined reference to `BC'
terminal.o(.text+0x370): undefined reference to `UP'
terminal.o(.text+0x3be): undefined reference to `tgetflag'
terminal.o(.text+0x3cf): undefined reference to `tgetflag'
terminal.o(.text+0x41d): undefined reference to `tgetflag'
terminal.o(.text+0x42e): undefined reference to `tgetflag'
/usr/lib/libreadline.a(terminal.o): In function `_rl_backspace':
terminal.o(.text+0x646): undefined reference to `tputs'
/usr/lib/libreadline.a(terminal.o): In function `ding':
terminal.o(.text+0x6df): undefined reference to `tputs'
/usr/lib/libreadline.a(terminal.o): In function `_rl_enable_meta_key':
terminal.o(.text+0x73e): undefined reference to `tputs'
/usr/lib/libreadline.a(terminal.o): In function `_rl_control_keypad':
terminal.o(.text+0x772): undefined reference to `tputs'
collect2: ld returned 1 exit status
make[1]: *** [link] Error 1
make[1]: Leaving directory `/home/tomaz/src/Python-1.5.2/Modules'
make: *** [python] Error 2
Problem compiling Python on Suse 6.1 [ In reply to ]
Tomaz Ficko wrote:

> I have a problem compiling Python 1.5.2 with Tk and readline support.

Can you post the section of your Modules/Setup file that involves Tkinter
and readline? In which directory are your libtcl and libtk files (and are
they
in the same directory)? And where is readline?

Chad
Problem compiling Python on Suse 6.1 [ In reply to ]
Tomaz Ficko <tomaz@gmx.net> wrote:
> I have a problem compiling Python 1.5.2 with Tk and readline support.
> I'm using Suse 6.1 (evaluation iso):
> gcc version egcs-2.91.66 19990314 (egcs-1.1.2 release)
> Tcl/Tk 8.0.5
> bash-2.02
I had also some problems with TK and Readline on SuSE 6.0.
SuSE renamed some files in order to be compatible with older versions
They renamed
/usr/X11R6/include/tk.h to /usr/X11R6/include/tk8.0.h
/usr/X11R6/lib/tkConfig.sh to /usr/X11R6/tkConfig8.0.sh
/usr/X11R6/lib/libtk.a to /usr/X11R6/lib/libtk8.0.a
/usr/X11R6/lib/libtk.so to /usr/X11R6/lib/libtk8.0.so
/usr/include/tcl.h to /usr/include/tcl8.0.h
/usr/lib/tclConfig.sh in /usr/tclConfig8.0.sh
/usr/lib/libtcl.a to /usr/lib/libtcl8.0.a
/usr/lib/libtcl.so to /usr/lib/libtcl8.0.so
See also /usr/doc/packages/tk8.0/README.SuSE and
/usr/doc/packages/tcl8.0/README.SuSE.

So there are two ways to fix this. Either you rename your files which would
break other installed programs or you patch the source :-). For the second
way look into _tkinter.c and tkappinit.c and change some lines containing
tcl.h and tk.h into tcl8.0.h and tk8.0.h
Addionally look into Modules/Setup to make sure that you link tkinter with
the right libraries (-ltk8.0 -ltcl8.0)

To have readline support (and ncurses btw) add -L/usr/lib/termcap everywhere
you find -ltermcap in your Modules/Setup. This seems SuSE specific, too.


Still Problems? Mail me.
Henning
Problem compiling Python on Suse 6.1 [ In reply to ]
Tomaz Ficko wrote:
> =

> I have a problem compiling Python 1.5.2 with Tk and readline support.
> I'm using Suse 6.1 (evaluation iso):
> gcc version egcs-2.91.66 19990314 (egcs-1.1.2 release)
> Tcl/Tk 8.0.5
> bash-2.02
Download the source package of python151 from the suse dist and
look at the changes they made. Http://www.suse.de/ftp.html
lists several ftp-servers. =

For suse60, it boils down to:
=

- grep the python source for <tcl.h> and <tk.h> =

and replace with <tcl80.h> resp. <tk80.h>
- edit Module/Setup. Uncomment several line with respect to the =

software you installed (Tix, BLT, gdbm etc). This includes:
readline readline.c -lreadline # -ltermcap
curses cursesmodule.c -lncurses # -ltermcap
zlib zlibmodule.c -$(prefix)/include -L$(exec_prefix)/lib -lgz #
-lz

- consider installing the ncurses-module by Oliver Andrich
- suse comes with a static lib readline.a .
I built readline.so from source long before
I installed Python 152. This might not be
necessary.

However, your mileage may vary.

regards, =

Mirko

-- =

M Li=DF, <n89553@hrz.uni-paderborn.de>