statically linked tcl conflict with dynamically linked tcl error

statically linked tcl conflict with dynamically linked tcl error

Post by TingCho » Thu, 07 Aug 2003 08:54:36



My solaris 8 computer have a dynamically linked tclsh as the default.
After another statically linked tclsh is executed, the computer
environment is corrupted for that shell.
How to solve this problem?

This is what I had done:
pwdly0ee% which tclsh
/opt/bsmext/bin/tclsh

pwdly0ee% /opt/bsm/lib/home/bsmbin/tcma/tclsh
application-specific initialization failed: Can't find a usable
init.tcl in the following directories:
    /bsmbootstrap/lib/tcl8.3 /opt/bsm/lib/home/bsmbin/lib/tcl8.3
/opt/bsm/lib/home/lib/tcl8.3 /opt/bsm/lib/home/bsmbin/library
/opt/bsm/lib/home/library /opt/bsm/lib/home/tcl8.3/library
/opt/bsm/lib/tcl8.3/library /bsmbootstrap/lib/tcl8.3

This probably means that Tcl wasn't installed properly.

% ls
invalid command name "ls"

 
 
 

statically linked tcl conflict with dynamically linked tcl error

Post by Rich Tee » Thu, 07 Aug 2003 09:15:22



Quote:> My solaris 8 computer have a dynamically linked tclsh as the default.
> After another statically linked tclsh is executed, the computer
> environment is corrupted for that shell.
> How to solve this problem?

Don't use statically linked binaries.

--
Rich Teer, SCNA, SCSA

President,
Rite Online Inc.

Voice: +1 (250) 979-1638
URL: http://www.rite-online.net

 
 
 

statically linked tcl conflict with dynamically linked tcl error

Post by Derk Gwe » Thu, 07 Aug 2003 12:43:43


# My solaris 8 computer have a dynamically linked tclsh as the default.
# After another statically linked tclsh is executed, the computer
# environment is corrupted for that shell.
# How to solve this problem?

The environment of each process is separate and cannot corrupt the environment
of the parent process. If you enter a command '(.../tclsh ...)' it runs in a
separate process all by itself.

# pwdly0ee% /opt/bsm/lib/home/bsmbin/tcma/tclsh
# application-specific initialization failed: Can't find a usable
# init.tcl in the following directories:

If you look at the usual Tcl install, you find a directory something like
/usr/local/lib/tcl which then has a bunch of *.tcl scripts. Tcl expects to
find this directory and sources what it finds to establish of its behaviour.
An intepretter can run with it, but it's going to be missing some things. Like
        % ls
        invalid command name "ls"
the bgerror magic that tries to exec as unix command an unrecognised
tcl command.

If you want all the usual Tcl behavior, you need to have this directory
where Tcl can find it, or tell Tcl where it is. After about 8.4 some
Tcl and Tk were supposed to be removed so that instead you can encode all
these scripts into the binary program. It's been a while since I had to
deal with this.

--
Derk Gwen http://derkgwen.250free.com/html/index.html
TEMPORARILY CLOSED
BE OPENED AFTER FIRST PERIOD

 
 
 

statically linked tcl conflict with dynamically linked tcl error

Post by Don Porte » Thu, 07 Aug 2003 14:04:23



> My solaris 8 computer have a dynamically linked tclsh as the default.
> After another statically linked tclsh is executed, the computer
> environment is corrupted for that shell.
> How to solve this problem?

> This is what I had done:
> pwdly0ee% which tclsh
> /opt/bsmext/bin/tclsh

> pwdly0ee% /opt/bsm/lib/home/bsmbin/tcma/tclsh
> application-specific initialization failed: Can't find a usable
> init.tcl in the following directories:
>     /bsmbootstrap/lib/tcl8.3 /opt/bsm/lib/home/bsmbin/lib/tcl8.3
> /opt/bsm/lib/home/lib/tcl8.3 /opt/bsm/lib/home/bsmbin/library
> /opt/bsm/lib/home/library /opt/bsm/lib/home/tcl8.3/library
> /opt/bsm/lib/tcl8.3/library /bsmbootstrap/lib/tcl8.3

> This probably means that Tcl wasn't installed properly.

> % ls
> invalid command name "ls"

Static vs dynamic linking has nothing to do with this.  Your tclsh
program under ...../tcma/ cannot find a suitable script library.
As the error message tells you, "This probably means that Tcl
wasn't installed properly."

It appears your tclsh under ...../tcma/ believes it was configured
and built to be installed as /bsmbootstrap/bin/tclsh .  Yet you are
not running it from that location.  Did you fail to do the
`make install` that would have installed in the location chosen
during configuration?  Did you instead just copy the single
executable file from one place to another, without doing a complete
install at all?  

Basic tclsh built from the tcl source distribution does not work like
that.  It is not deployable as a single executable file.  It needs to
find a script library at run time that is installed as a collection of
separate files.

If you need a single-file version of tclsh, Google for TclKit.  It
may fit your needs better.

--
| Don Porter          Mathematical and Computational Sciences Division |

| http://math.nist.gov/~DPorter/                                  NIST |
|______________________________________________________________________|

 
 
 

statically linked tcl conflict with dynamically linked tcl error

Post by r.. » Thu, 07 Aug 2003 16:03:15



> My solaris 8 computer have a dynamically linked tclsh as the default.
> After another statically linked tclsh is executed, the computer
> environment is corrupted for that shell.
> How to solve this problem?

> This is what I had done:
> pwdly0ee% which tclsh
> /opt/bsmext/bin/tclsh

> pwdly0ee% /opt/bsm/lib/home/bsmbin/tcma/tclsh
> application-specific initialization failed: Can't find a usable
> init.tcl in the following directories:
>     /bsmbootstrap/lib/tcl8.3 /opt/bsm/lib/home/bsmbin/lib/tcl8.3
> /opt/bsm/lib/home/lib/tcl8.3 /opt/bsm/lib/home/bsmbin/library
> /opt/bsm/lib/home/library /opt/bsm/lib/home/tcl8.3/library
> /opt/bsm/lib/tcl8.3/library /bsmbootstrap/lib/tcl8.3

> This probably means that Tcl wasn't installed properly.

> % ls
> invalid command name "ls"

Take it at its word: that other TCL isn't installed properly.
What evidence is there indicating a dynamic versus static
library issue?

You ran tclsh, it gave a startup error message telling you it
believes itself to be incomplete, but "survived" this leaving
you in the tcl interpreter anyway (did not corrupt your original
shell).  Try "exec ls -C" instead as a command to run /bin/ls
from there.  You can exit to return to the shell, or use your
shell's method (like control-Z) to suspend it.

Without the init.tcl, the unknown procedure handler never gets
defined that can search your PATH and run programs (ls) for you.
--
Knock, Knock
 ........ Who's there?
Without Al Gore.
 ........ "Without Al Gore" who?
Without algorithms, internet life itself would be impossible.

 
 
 

statically linked tcl conflict with dynamically linked tcl error

Post by lvir.. » Thu, 07 Aug 2003 22:40:50



:pwdly0ee% which tclsh

At this point, you are in some normal shell program - csh, bash, I can't tell.

:pwdly0ee% /opt/bsm/lib/home/bsmbin/tcma/tclsh

:% ls
:invalid command name "ls"

At this point, you are inside of the executing
/opt/bsm/lib/home/bsmbin/tcma/tclsh command.  At that point, input needs
to be in the format that Tcl expects.

As other posters have mentioned, the particular error here is because of
the problem with the way the binary is being located.  If this
is not a case of you copying the tclsh by itself to a new location, but
instead a case where you install on one machine in one directory, and then
run from another machine with the install directory NFS mounted to another
name, then you have a bit of a problem. Tcl needs to be configured, built
and then installed using the user execution environment's naming conventions.

--
<URL: http://wiki.tcl.tk/ > <URL: http://www.tcl.tk/ >
Even if explicitly stated to the contrary, nothing in this posting
should be construed as representing my employer's opinions.