[GRASSLIST:1264] Re: readline problem and fix

Glynn Clements glynn.clements at virgin.net
Tue Sep 16 17:45:06 EDT 2003


Jack Varga wrote:

> Sharing a quick fix to a configuration error due to a problem with 
> readline.  Not sure if it's been documented (or how many find readline 
> useful), but if so, it is not yet reflected in configure.  This problem 
> exists primarily on linux for reasons not entirely clear, (although it 
> appears there is a link failure between the shared readline 
> (libreadline.so) and ncurses libraries (libncurses.so) in multiple 
> distributions.  I'm running Mandrake 9.1)...

It's a known problem. FWIW, readline is only used by r.mapcalc.

> Using linker to test readline...
> 
> $ ld /usr/lib/libreadline.so
> ld: warning: cannot find entry symbol _start; not setting start address
> /usr/lib/libreadline.so: undefined reference to `tgetnum'
> /usr/lib/libreadline.so: undefined reference to `tgoto'
> /usr/lib/libreadline.so: undefined reference to `tgetflag'
> /usr/lib/libreadline.so: undefined reference to `BC'
> /usr/lib/libreadline.so: undefined reference to `tputs'
> /usr/lib/libreadline.so: undefined reference to `PC'
> /usr/lib/libreadline.so: undefined reference to `tgetent'
> /usr/lib/libreadline.so: undefined reference to `UP'
> /usr/lib/libreadline.so: undefined reference to `tgetstr'
> 
> ...all of which are references supplied by ncurses.  

And also supplied by libtermcap and libtinfo:

$ nm -D /usr/lib/libncurses.so | fgrep tgetnum
000292a0 T tgetnum
$ nm -D /usr/lib/libtermcap.so | fgrep tgetnum
00001e60 T tgetnum
$ nm -D /usr/lib/libtinfo.so | fgrep tgetnum
00011e34 T tgetnum

And therein lies the problem. There may be multiple libraries which
could be used, and it may make a difference depending upon which one
is actually chosen (some libraries may use termcap, others terminfo).

I'm fairly sure that there is no practical way to autodetect which is
the correct library to use. We could add an addtional switch, e.g. 
--with-readline-deps={curses,ncurses,termcap,tinfo} to allow the user
to select which additional library to try, although I'd rather they
just filed bug reports with their OS vendor until the vendor issues a
version of readline with the correct dependency information (as is the
case for e.g. RH6.2's readline).

-- 
Glynn Clements <glynn.clements at virgin.net>




More information about the grass-user mailing list