For Programmers: Free Programming Magazines  


Home > Archive > Tcl > February 2005 > Starting over with tcl and tk









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Starting over with tcl and tk
John Culleton

2005-02-19, 3:58 pm

I installed Linux Slackware 10.1 and now I have path problems. First I went
with the Slackware packages---all of them. tclsh works but the statement
package require tcllib
didn't. I downloaded tcllib1.7, installed it, linked it to usr/lib/tcllib
and /usr/local/lib/tcllib, but tclsh can't find it, even when I move to
that directory and run it.

So I deinstalled the standard Slack version, downloaded the latest Tcl and
Tk tarballs, and went through the ./configure, make and make install bit
for each. Make install didn't put things where they could be found so I
moved tclsh to /usr/local/bin. Now I can run it. But it still can't find
tcllib.

In years past I just ran with the standard Slack packages. But something
seems messed up now. Can anyone help?

John Culleton


--
John Culleton
Able Indexers and Typesetters
Jeff Hobbs

2005-02-19, 8:58 pm

John Culleton wrote:
> I installed Linux Slackware 10.1 and now I have path problems. First I went
> with the Slackware packages---all of them. tclsh works but the statement
> package require tcllib
> didn't. I downloaded tcllib1.7, installed it, linked it to usr/lib/tcllib
> and /usr/local/lib/tcllib, but tclsh can't find it, even when I move to
> that directory and run it.
>
> So I deinstalled the standard Slack version, downloaded the latest Tcl and
> Tk tarballs, and went through the ./configure, make and make install bit
> for each. Make install didn't put things where they could be found so I
> moved tclsh to /usr/local/bin. Now I can run it. But it still can't find
> tcllib.
>
> In years past I just ran with the standard Slack packages. But something
> seems messed up now. Can anyone help?


If you are willing to go with premade binarines, the ActiveTcl
distro should work just fine on Slackware. Otherwise, tcllib
isn't part of the Tcl source distro, you do have to install it
separately. To know where tcl expects things, run the tclsh
that you want to run, and ask 'info library', which will tell
you where Tcl's runtime libraries are. Add your packages as
sibling directories to that.

If you want to build yourself, you should just use --prefix
and --exec-prefix (optional) to point to where you want to
have stuff installed.

--
Jeff Hobbs, The Tcl Guy
http://www.ActiveState.com/, a division of Sophos
David N. Welton

2005-02-19, 8:58 pm

John Culleton <john@wexfordpress.com> writes:

> I installed Linux Slackware 10.1 and now I have path problems. First
> I went with the Slackware packages---all of them. tclsh works but
> the statement package require tcllib didn't.


You shouldn't do that in any case. You should do package require
PACKAGE for each package you need.

--
David N. Welton
- http://www.dedasys.com/davidw/

Apache, Linux, Tcl Consulting
- http://www.dedasys.com/
John Culleton

2005-02-19, 8:58 pm

Jeff Hobbs wrote:

> John Culleton wrote:
>
> If you are willing to go with premade binarines, the ActiveTcl
> distro should work just fine on Slackware. Otherwise, tcllib
> isn't part of the Tcl source distro, you do have to install it
> separately. To know where tcl expects things, run the tclsh
> that you want to run, and ask 'info library', which will tell
> you where Tcl's runtime libraries are. Add your packages as
> sibling directories to that.
>
> If you want to build yourself, you should just use --prefix
> and --exec-prefix (optional) to point to where you want to
> have stuff installed.
>

first, thanks for your help. When I ran tclsh and asked
info library
the program responded
/usr/local/lib/tcl8.4

So I moved the library to /usr/local/lib
That directory now looks like this (with some snipping)
-------------------------------------------------------------
drwxr-xr-x 8 safe users 544 2005-02-19 15:09 tcl8.4/
-rw-r--r-- 1 safe users 7287 2005-02-19 13:03 tclConfig.sh
lrwxrwxrwx 1 safe users 18 2005-02-19 12:06 tcllib
-> /usr/lib/tcllib1.7/
drwxrwxrwx 57 safe users 1432 2005-02-19 15:12 tcllib1.7/
drwxr-xr-x 5 safe users 1080 2005-02-19 13:07 tk8.4/
-rw-r--r-- 1 safe users 3620 2005-02-19 13:07 tkConfig.sh
--------------------------------------------------------------
But I still have no joy. Am I missing a step here? I want to try out the
tcl web server.

John Culleton


--
John Culleton
Able Indexers and Typesetters
John Culleton

2005-02-20, 4:03 am

David N. Welton wrote:

> John Culleton <john@wexfordpress.com> writes:
>
>
> You shouldn't do that in any case. You should do package require
> PACKAGE for each package you need.
>

Confusion of terms. Slackware comes with a series of software packages such
as Tcl, Tk, Ruby. Perl, Gimp, KDE etc. I installed all these. These
Slackware packages are not Tcl packages.
--
John Culleton
Able Indexers and Typesetters
Gerry Snyder

2005-02-20, 8:57 am

John Culleton wrote:

> first, thanks for your help. When I ran tclsh and asked
> info library
> the program responded
> /usr/local/lib/tcl8.4
>
> So I moved the library to /usr/local/lib


I think [info library] told you to move the library to
/usr/local/lib/tcl8.4 , not /usr/local/lib .

Hope this helps.

Gerry
John Culleton

2005-02-20, 8:58 pm

Gerry Snyder wrote:

> John Culleton wrote:
>
>
> I think [info library] told you to move the library to
> /usr/local/lib/tcl8.4 , not /usr/local/lib .
>
> Hope this helps.
>
> Gerry

Unfortunately, that move, while logical, didn't seem to do the trick. So I
am abandoning the httpdtclsh project for the moment. I did purge my
partition of all things tcl and tk, then reinstall tcl 8.4.9, tk 8.4.9 and
the latest starkit and sdk packages. Within that subset evrything seems to
be working OK.

If anyone can suggest a good way to make tcllib work on my system I am still
listening. I know it is some dumb little thing that I didn't do (or did.)
--
John Culleton
Able Indexers and Typesetters
Andreas Kupries

2005-02-21, 3:59 am

John Culleton <john@wexfordpress.com> writes:

> Jeff Hobbs wrote:
>
> So I moved the library to /usr/local/lib
> That directory now looks like this (with some snipping)
> -------------------------------------------------------------
> drwxr-xr-x 8 safe users 544 2005-02-19 15:09 tcl8.4/
> -rw-r--r-- 1 safe users 7287 2005-02-19 13:03 tclConfig.sh
> lrwxrwxrwx 1 safe users 18 2005-02-19 12:06 tcllib
> -> /usr/lib/tcllib1.7/
> drwxrwxrwx 57 safe users 1432 2005-02-19 15:12 tcllib1.7/
> drwxr-xr-x 5 safe users 1080 2005-02-19 13:07 tk8.4/
> -rw-r--r-- 1 safe users 3620 2005-02-19 13:07 tkConfig.sh
> --------------------------------------------------------------
> But I still have no joy. Am I missing a step here? I want to try out the
> tcl web server.


Are you saying 'package require tcllib' ? _That_ will not work. Tcllib
is not a single package, but a bundle of many packages. You need the
base64 functionality ? You say 'package require base64'. The pop3
client code ? 'package require pop3'. Etc. In other words, each
package you need in your code you have to require explicitly.

Note: There _was_ a pseudo-package called 'tcllib' you could package
require, up until Tcllib 1.4. In 1.4 this pseudo-package was
functional, but requiring it also printed a message to stderr that
this was not really the correct way to get the functionality, and
deprecated. After Tcllib 1.4 the pseudo-package was removed. Which
makes sense IMHO. All the functionality in Tcllib together comes in at
3.6 Megabyte of Tcl code. Loading everything at once will take time,
even if the procedures themselves are bytecompiled only when actually
used.

--
So long,
Andreas Kupries <akupries@shaw.ca>
<http://www.purl.org/NET/akupries/>
Developer @ <http://www.activestate.com/>
-------------------------------------------------------------------------------
}
John Culleton

2005-02-21, 9:00 pm

Andreas Kupries wrote:

> John Culleton <john@wexfordpress.com> writes:
>
>
> Are you saying 'package require tcllib' ? _That_ will not work. Tcllib
> is not a single package, but a bundle of many packages. You need the
> base64 functionality ? You say 'package require base64'. The pop3
> client code ? 'package require pop3'. Etc. In other words, each
> package you need in your code you have to require explicitly.
>
> Note: There _was_ a pseudo-package called 'tcllib' you could package
> require, up until Tcllib 1.4. In 1.4 this pseudo-package was
> functional, but requiring it also printed a message to stderr that
> this was not really the correct way to get the functionality, and
> deprecated. After Tcllib 1.4 the pseudo-package was removed. Which
> makes sense IMHO. All the functionality in Tcllib together comes in at
> 3.6 Megabyte of Tcl code. Loading everything at once will take time,
> even if the procedures themselves are bytecompiled only when actually
> used.
>

Thank you!

The instructions that accompany the tclhttpd package are then obsolete, at
least the version on the CDR that comes with the Welch and Jones book. Here
is the quote:
------------------------------------------------------------
or a quick test that runs a server on port 8015, do
UNIX:

1) Test preconditions
tclsh8.3
package require tcllib

2) If you can do the above, then you should be able to run the
server directly from this distribution directory without bothering
to configure, make, and install it.
---------------------------------------------------------------

I will try downloading a newer version the tclhttpd package, since the one
on the CDR seems to rely on the (currently nonexistent) pseudo-library.

If anyone has any furhter hints/warnings with respect to tclhttpd they would
be much appreciated.

--
John Culleton
Able Indexers and Typesetters
Andreas Kupries

2005-02-22, 4:00 am


John Culleton <john@wexfordpress.com> writes:
> Andreas Kupries wrote:
> Thank you!
>
> The instructions that accompany the tclhttpd package are then obsolete, at
> least the version on the CDR that comes with the Welch and Jones book. Here
> is the quote:
> ------------------------------------------------------------
> or a quick test that runs a server on port 8015, do
> UNIX:
>
> 1) Test preconditions
> tclsh8.3
> package require tcllib
>
> 2) If you can do the above, then you should be able to run the
> server directly from this distribution directory without bothering
> to configure, make, and install it.
> ---------------------------------------------------------------


Definitely out of date. I believe the most recent release of tclhttpd,
available from its sourcEforge site has this fixed and package
require's just the packages it needs instead of the full tcllib.

http://sourceforge.net/project/show...?group_id=12884

IIRC Colin McCormack did the change.

> I will try downloading a newer version the tclhttpd package, since the one
> on the CDR seems to rely on the (currently nonexistent) pseudo-library.



> If anyone has any furhter hints/warnings with respect to tclhttpd they would
> be much appreciated.


--
So long,
Andreas Kupries <akupries@shaw.ca>
<http://www.purl.org/NET/akupries/>
Developer @ <http://www.activestate.com/>
-------------------------------------------------------------------------------
}
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com