public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* Tcl_Init failed: can't read "env(TCL_LIBRARY)": no such variable
@ 2006-06-26 13:38 Lai Xuecheng
  2006-06-26 14:01 ` Keith Seitz
  0 siblings, 1 reply; 5+ messages in thread
From: Lai Xuecheng @ 2006-06-26 13:38 UTC (permalink / raw)
  To: insight

Hi all,

After reinstalling my os (redhat 9), the gui version
of insight cannot be used. The following error occurs
when insight is issued: 
Tcl_Init failed: can't read "env(TCL_LIBRARY)": no
such variable

But there is no problem using insight -nw or gdb

The above problem applies to both insight 6.1 and 6.2

The insight document says 

"Name			Description
	----			-----------
	TCL_LIBRARY		The location of the Tcl library files
....

All of the environment variables for controlling
Insight are well documented
in gdb/gdbtk/library/main.tcl. Search for "env" to
find them all",
but I cannot find any occurence of the word
TCL_LIBRARY in the file main.tcl.

Does anyone have any idea about what is happening?

Thanks.

Best regads,

Lai Xuecheng, PhD Candidate
National University of Singapore, Dept. of Electrical & Computer Engineering
Research interests: Path Planning and Navigation for Constrained Mobile Robots
http://xclai.mycezone.com


		
____________________________________________________
Yahoo! Singapore Answers
Real people. Real questions. Real answers. Share what you know at http://answers.yahoo.com.sg

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Tcl_Init failed: can't read "env(TCL_LIBRARY)": no such variable
  2006-06-26 13:38 Tcl_Init failed: can't read "env(TCL_LIBRARY)": no such variable Lai Xuecheng
@ 2006-06-26 14:01 ` Keith Seitz
  2006-06-26 15:05   ` Lai Xuecheng
  0 siblings, 1 reply; 5+ messages in thread
From: Keith Seitz @ 2006-06-26 14:01 UTC (permalink / raw)
  To: Lai Xuecheng; +Cc: insight

Lai Xuecheng wrote:

> After reinstalling my os (redhat 9), the gui version
> of insight cannot be used. The following error occurs
> when insight is issued: 
> Tcl_Init failed: can't read "env(TCL_LIBRARY)": no
> such variable

That usually means that (insight's version of) Tcl is not properly 
installed. Some quick questions:

- How did you build insight?
- Where is it installed, i.e., --prefix?
- Are tcl/tk/itcl installed in --prefix?
- What does "which tclsh8.4" return?
- What does "which insight" return?
- Can you run it from your build directory?

> The above problem applies to both insight 6.1 and 6.2

What about 6.4 or a snapshot (6.5 is around the corner)?

> The insight document says 
> 
> "Name			Description
> 	----			-----------
> 	TCL_LIBRARY		The location of the Tcl library files
> ....
> 
> All of the environment variables for controlling
> Insight are well documented
> in gdb/gdbtk/library/main.tcl. Search for "env" to
> find them all",
> but I cannot find any occurence of the word
> TCL_LIBRARY in the file main.tcl.
> 
> Does anyone have any idea about what is happening?

TCL_LIBRARY is actually defined in and used by the Tcl libraries. Can 
you run just the tcl shell that was installed by your insight installation?

Keith

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Tcl_Init failed: can't read "env(TCL_LIBRARY)": no such variable
  2006-06-26 14:01 ` Keith Seitz
@ 2006-06-26 15:05   ` Lai Xuecheng
  2006-06-26 15:20     ` Keith Seitz
  0 siblings, 1 reply; 5+ messages in thread
From: Lai Xuecheng @ 2006-06-26 15:05 UTC (permalink / raw)
  To: Keith Seitz; +Cc: insight

Hi, thanks.

- How did you build insight?
A: I built it by issuing configure;make; make install
- Where is it installed, i.e., --prefix?
A: I didn't add prefix argument. So it should be
/usr/local
- Are tcl/tk/itcl installed in --prefix?
A: I didn't install them seperately. I think they were
installed when I install insight
- What does "which tclsh8.4" return?
A:/usr/local/bin/tclsh8.4
- What does "which insight" return?
A: /usr/local/bin/insight
- Can you run it from your build directory?
A: you mean ./insight under the build directory? There
is no such file.

- TCL_LIBRARY is actually defined in and used by the
Tcl libraries. Can  you run just the tcl shell that
was installed by your insight installation?
A: when I run tcl, "tcl>" is able to appear.

BTW, the same problem exists for my installation of
insight 6.4.

Thanks again.

--- Keith Seitz <keiths@redhat.com> wrote:

> Lai Xuecheng wrote:
> 
> > After reinstalling my os (redhat 9), the gui
> version
> > of insight cannot be used. The following error
> occurs
> > when insight is issued: 
> > Tcl_Init failed: can't read "env(TCL_LIBRARY)": no
> > such variable
> 
> That usually means that (insight's version of) Tcl
> is not properly 
> installed. Some quick questions:
> 
> - How did you build insight?
> - Where is it installed, i.e., --prefix?
> - Are tcl/tk/itcl installed in --prefix?
> - What does "which tclsh8.4" return?
> - What does "which insight" return?
> - Can you run it from your build directory?
> 
> > The above problem applies to both insight 6.1 and
> 6.2
> 
> What about 6.4 or a snapshot (6.5 is around the
> corner)?
> 
> > The insight document says 
> > 
> > "Name			Description
> > 	----			-----------
> > 	TCL_LIBRARY		The location of the Tcl library
> files
> > ....
> > 
> > All of the environment variables for controlling
> > Insight are well documented
> > in gdb/gdbtk/library/main.tcl. Search for "env" to
> > find them all",
> > but I cannot find any occurence of the word
> > TCL_LIBRARY in the file main.tcl.
> > 
> > Does anyone have any idea about what is happening?
> 
> TCL_LIBRARY is actually defined in and used by the
> Tcl libraries. Can 
> you run just the tcl shell that was installed by
> your insight installation?
> 
> Keith
> 


Lai Xuecheng, PhD Candidate
National University of Singapore, Dept. of Electrical & Computer Engineering
Research interests: Path Planning and Navigation for Constrained Mobile Robots
http://xclai.mycezone.com


		
____________________________________________________
Yahoo! Singapore Answers
Real people. Real questions. Real answers. Share what you know at http://answers.yahoo.com.sg

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Tcl_Init failed: can't read "env(TCL_LIBRARY)": no such variable
  2006-06-26 15:05   ` Lai Xuecheng
@ 2006-06-26 15:20     ` Keith Seitz
  2006-06-27  4:20       ` Lai Xuecheng
  0 siblings, 1 reply; 5+ messages in thread
From: Keith Seitz @ 2006-06-26 15:20 UTC (permalink / raw)
  To: Lai Xuecheng; +Cc: insight

Lai Xuecheng wrote:

> - Can you run it from your build directory?
> A: you mean ./insight under the build directory? There
> is no such file.

Should be $BUILD_DIR/gdb/insight. There is code to deal with the special 
case of running from the build directory.

> - TCL_LIBRARY is actually defined in and used by the
> Tcl libraries. Can  you run just the tcl shell that
> was installed by your insight installation?
> A: when I run tcl, "tcl>" is able to appear.

Hmm. That's odd. So tclsh8.4 runs just fine, but insight will not.

> BTW, the same problem exists for my installation of
> insight 6.4.

Something odd going on. I'm not sure what though. If you set a break at 
gdbtk.c:482, is that breakpoint ever hit? If so, you might try printing 
the tcl variable ::errorInfo at this point (before calling error()).

It occurs to me that this startup script could be failing (see top of 
gdbtk_init):

---- from gdbtk.c ----
       static char set_libs_path_script[] = "\
	  set srcDir [file dirname [file dirname $env(TCL_LIBRARY)]];\n\
\
	  if {![info exists env(TK_LIBRARY)]} {\n\
	      set env(TK_LIBRARY) [file join $srcDir tk library]\n\
	  }\n\
\
	  if {![info exists env(ITCL_LIBRARY)]} {\n\
	      set env(ITCL_LIBRARY) [file join $srcDir itcl itcl library]\n\
	  }\n\
\
	  if {![info exists env(ITK_LIBRARY)]} {\n\
	      set env(ITK_LIBRARY) [file join $srcDir itcl itk library]\n\
	  }\n\
\
	  if {![info exists env(IWIDGETS_LIBRARY)]} {\n\
	      set env(IWIDGETS_LIBRARY)\
                      [file join $srcDir itcl iwidgets generic]\n\
	  }\n\
\
	  if {![info exists env(GDBTK_LIBRARY)]} {\n\
	      set env(GDBTK_LIBRARY) [file join $srcDir gdb gdbtk library]\n\
	  }\n\
\
           # Append the directory with the itcl pkg index\n\
           if {[info exists env(TCLLIBPATH)]} {\n\
             append env(TCLLIBPATH) :[file joing $srcDir itcl]\n\
           } else {\n\
             set env(TCLLIBPATH) [file join $srcDir itcl]\n\
           }\n\
\
           # We also need to append the iwidgets library path.\n\
           # Unfortunately, there is no IWIDGETS_LIBRARY.\n\
           set IWIDGETS_LIBRARY [file join $srcDir itcl iwidgets 
generic]\n";

---- end ----

I wonder if the very first line of this is causing you problems. If you 
set TCL_LIBRARY to /usr/local/share/tcl8.4, does the problem go away?

Keith

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Tcl_Init failed: can't read "env(TCL_LIBRARY)": no such variable
  2006-06-26 15:20     ` Keith Seitz
@ 2006-06-27  4:20       ` Lai Xuecheng
  0 siblings, 0 replies; 5+ messages in thread
From: Lai Xuecheng @ 2006-06-27  4:20 UTC (permalink / raw)
  To: Keith Seitz; +Cc: insight


--- Keith Seitz <keiths@redhat.com> wrote:
> > - Can you run it from your build directory?
> Should be $BUILD_DIR/gdb/insight. There is code to
> deal with the special 
> case of running from the build directory.

Yes, I can run insight from the build directory. So
currently I decide to use insight in this way, which
is good enough for me now :).

> Something odd going on. I'm not sure what though. If
> you set a break at 
> gdbtk.c:482, is that breakpoint ever hit? If so, you
> might try printing 
> the tcl variable ::errorInfo at this point (before
> calling error()).
> 
> It occurs to me that this startup script could be
> failing 

Yes, the error comes from that line, which is "  if
(Tcl_Init (gdbtk_interp) != TCL_OK)
   error ("Tcl_Init failed: %s",
dbtk_interp->result);"


But I am not sure how to pring the errorInfor---I have
tried puts stdout $errorInfo, and error("$errorInfo")
etc. but they seems to be not the right way.

> 
> I wonder if the very first line of this is causing
> you problems. If you 
> set TCL_LIBRARY to /usr/local/share/tcl8.4, does the
> problem go away?
> 
> Keith
> 


I tried "export TCL_LIBRARY=/usr/local/share/tcl8.4"
before issuing insight or before make the
installation, but there occurs the same error.

Lai Xuecheng, PhD Candidate
National University of Singapore, Dept. of Electrical & Computer Engineering
Research interests: Path Planning and Navigation for Constrained Mobile Robots
http://xclai.mycezone.com


		
__________________________________ 
Yahoo! Movies - Search movie info and celeb profiles and photos. 
http://sg.movies.yahoo.com/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-06-27  4:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-26 13:38 Tcl_Init failed: can't read "env(TCL_LIBRARY)": no such variable Lai Xuecheng
2006-06-26 14:01 ` Keith Seitz
2006-06-26 15:05   ` Lai Xuecheng
2006-06-26 15:20     ` Keith Seitz
2006-06-27  4:20       ` Lai Xuecheng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).