Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

how to install/configure tcllib for tcltk

676 views
Skip to first unread message

Charles Russell

unread,
Aug 8, 2006, 8:34:24 PM8/8/06
to
Simply running the install routine for tcllib (from sourceforge) ran
without error messages but the library routines are still not accessible
using a package require command. Note to package maintainer: is there
some reason tcllib is not routinely included with cygwin tcltk? A
repackaging of tcllib into .rb code is included in the cygwin ruby
package! (I would contact the maintainer directly if I knew how.)


Charles Russell

unread,
Aug 8, 2006, 9:10:02 PM8/8/06
to

Oops! Intended for the cygwin mailing list.

sleb...@gmail.com

unread,
Aug 8, 2006, 11:13:31 PM8/8/06
to
Charles Russell wrote:
> Simply running the install routine for tcllib (from sourceforge) ran
> without error messages but the library routines are still not accessible
> using a package require command.

Probably because cygwin installs tcl somewhere where the tcllib install
script doesn't expect. Run the followin command in tclsh to find out
where your library should be installed:

puts $tcl_library

Then run ./configure with the --prefix set to the correct path. For
example if $tcl_library is "/usr/lib/tcl8.4" then run "./configure
--prefix /usr". I think by default the configure script expects tcl to
be installed in /usr/local and a lot of people including myself have
tcl in /usr.

Hope that helps.

Charles Russell

unread,
Aug 9, 2006, 12:35:10 AM8/9/06
to


puts $tcl_library returns "/usr/share/tcl8.4" tcllib is now in
"/usr/share/lib/tcllib1.8", after following your suggestion. The .tcl
files are there, including fileutil.tcl

The makefile reads:

srcdir = .
top_srcdir = .
prefix = /usr/share
exec_prefix = ${prefix}
libdir = ${exec_prefix}/lib
mandir = ${prefix}/man
bindir = ${exec_prefix}/bin


But I still get:

$ tclsh
% package require fileutil
can't find package fileutil
%

Michael Schlenker

unread,
Aug 9, 2006, 3:11:54 AM8/9/06
to
Charles Russell schrieb:

> sleb...@yahoo.com wrote:
>> Charles Russell wrote:
>>> Simply running the install routine for tcllib (from sourceforge) ran
>>> without error messages but the library routines are still not accessible
>>> using a package require command.
>>
>> Probably because cygwin installs tcl somewhere where the tcllib install
>> script doesn't expect. Run the followin command in tclsh to find out
>> where your library should be installed:
>>
>> puts $tcl_library
>>
>> Then run ./configure with the --prefix set to the correct path. For
>> example if $tcl_library is "/usr/lib/tcl8.4" then run "./configure
>> --prefix /usr". I think by default the configure script expects tcl to
>> be installed in /usr/local and a lot of people including myself have
>> tcl in /usr.
>>
>> Hope that helps.
>>
>
>
> puts $tcl_library returns "/usr/share/tcl8.4" tcllib is now in
> "/usr/share/lib/tcllib1.8", after following your suggestion. The .tcl
> files are there, including fileutil.tcl
>
This is wrong too..., tcl_library is basically irrelevant, you need to
look at auto_path. The tcllib dir has to be a subdir of a directory in
the $auto_path variable of your tclsh in cygwin.

Please try to install tcllib using the installer.tcl file, running from
your cygwin tclsh instead of doing make install..., make install should
work, it basically calls installer.tcl but may pick up the wrong path.,,

Make install should do the right thing on cygwin, if not, please file a
bug report at:

Please file a bug report for this at
https://sourceforge.net/tracker/?group_id=12883&atid=112883
Category Installation...

Michael

Charles Russell

unread,
Aug 9, 2006, 10:35:47 AM8/9/06
to

Thanks. installer.tcl works, .\configure; make install does not.
Will file bug report.

Michael A. Cleverly

unread,
Aug 9, 2006, 1:11:33 AM8/9/06
to
On Wed, 9 Aug 2006, Charles Russell wrote:

> But I still get:
>
> $ tclsh
> % package require fileutil
> can't find package fileutil

What does:

puts $auto_path

return? The pkgIndex.tcl files will need to be in or under an immediate
subdirectory of one of the directories in the auto_path list.

Michael

Charles Russell

unread,
Aug 10, 2006, 11:19:25 AM8/10/06
to

I now have a working installation, which shows:

tcl_library=
C:/cygwin/usr/share/tcl8.4
auto_path=
C:/cygwin/usr/share/tcl8.4 C:/cygwin/usr/share C:/cygwin/lib

The pkgIndex.tcl fies are under, for example, share/tclib1.8/fileutil/
Unless "in or under an immediate subdirectory" means the same as "in or
under a subdirectory," I am missing some subtlety.

Bruce Hartweg

unread,
Aug 10, 2006, 11:42:24 AM8/10/06
to

yes you are ;)

immediate subdirectory - means 1 level down, not recursively down an
arbitrary amount of subdirectories so since C:/cygwin/usr/share is in
the path, it will look in share and share/tcllib1.8 but NOT in
share/tclib1.8/fileutil by default. Now, there may be a pkgIndex.tcl
file in the tcllib1.8 directory that will add the subdirectories itself,
but the auto-searching functionality of the package system does not keep
going down to lower levels.

Bruce

Charles Russell

unread,
Aug 10, 2006, 4:27:04 PM8/10/06
to

I see. I now notice another pkgIndex.tcl directly under tclib1.8/ which
appears to reference the pkgIndex.tcl files in the subdirectories.
By the way, does the interpreter search for these files just once per
invocation and then retain an index to the location of the actual
package codes?

Bruce Hartweg

unread,
Aug 10, 2006, 4:43:03 PM8/10/06
to
Charles Russell wrote:

>
> I see. I now notice another pkgIndex.tcl directly under tclib1.8/ which
> appears to reference the pkgIndex.tcl files in the subdirectories.
> By the way, does the interpreter search for these files just once per
> invocation and then retain an index to the location of the actual
> package codes?

Yes it does. the first time you do a package require, it does the search for all
the pkgIndex files and then "knows" about all the packages they describe, then
when a package require is done again for one of the packages, the code defined
in the pkgIndex file is run to actualy load the code.

mode reading can be found at

http://wiki.tcl.tk/package

which has some discussion and many links, some interesting ones being

http://www.tcl.tk/man/tcl8.4/TclCmd/pkgMkIndex.htm
http://wiki.tcl.tk/3382
http://math.nist.gov/~DPorter/tcltk/package/

Bruce

0 new messages