[GRASS5] [bug #1561] (grass) tcl command error in tcltkgrass startup

Glynn Clements glynn.clements at virgin.net
Sat Feb 1 15:57:41 EST 2003


David D Gray wrote:

> > It appears that the -dictionary switch was added in Tcl 8.0. It is a
> > case-insensitive version of -ascii.
> 
> That helps to clarify the difficulty. It indicates that the problem is 
> version skew between the version that is used at compile-time, and the 
> Tcl/Tk binaries picked up at runtime. In fact I found that at startup 
> the script was attempting to run a version 7.6/4.2 installation.

OK.

However, for tcltkgrass, there isn't any "compile time". The Tcl/Tk
configure checks are solely for NVIZ (which uses a custom binary built
against the Tcl/Tk libraries); tcltkgrass is just a set of Tcl/Tk
scripts.

> > [...]
> > For the developers: do we just change -dictionary to -ascii, or should
> > we try to use -dictionary if it is available (e.g. using "catch" to
> > fall-back to -ascii)?
> > 
> 
> If the -dictionary switch was added with version 8.0, then it is 
> probably worth retaining, for as I understand, tcltkgrass requires 
> version 8.0+, and there are probably other issues apart from this 
> switch, so not much point attempting to support previous versions.
> 
> But, is it generally Ok to put some environment variables in Init.sh or 
> the tcltkgrass startup that uses the Tcl/Tk base set at compile time? 
> Then the correct paths for wish and the libs could be set. I found that 
> setting these manually got round the problem by putting the following in 
> Init.sh:
> 
> # Tcl/Tk base
> 
> export TCLTKBASE=/usr  # Configure should set this. Does it already?

No.

> export TCLTKLIB=$TCLTKBASE/lib  # But maybe wish calls the right libs 
> anyway?

Probably; most distributions include the version in the library name
(e.g. libtcl8.3.so etc); in that case, it would be impossible for wish
to use the wrong library.

> export GRASS_TCLSH=$TCLTKBASE/bin/tclsh
> export GRASS_WISH=$TCLTKBASE/bin/wish

If you have multiple versions of Tcl/Tk, then this may be necessary. 
Although, I'm not sure whether anything actually uses $GRASS_TCLSH.

> if [ ! "$LD_LIBRARY_PATH" ] ; then
>    LD_LIBRARY_PATH=$TCLTKLIB
> else
>    LD_LIBRARY_PATH=$TCLTKLIB:$LD_LIBRARY_PATH # export later; searching 
> /usr first might cause problems for some?
> fi

This shouldn't be necessary.

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




More information about the grass-dev mailing list