1
2[//000000001]: # (tcllib\_install\_guide \- )
3[//000000002]: # (Generated from file 'tcllib\_installer\.man' by tcllib/doctools with format 'markdown')
4[//000000003]: # (tcllib\_install\_guide\(n\) 1 tcllib "")
5
6<hr> [ <a href="../../../toc.md">Main Table Of Contents</a> &#124; <a
7href="../../toc.md">Table Of Contents</a> &#124; <a
8href="../../../index.md">Keyword Index</a> &#124; <a
9href="../../../toc0.md">Categories</a> &#124; <a
10href="../../../toc1.md">Modules</a> &#124; <a
11href="../../../toc2.md">Applications</a> ] <hr>
12
13# NAME
14
15tcllib\_install\_guide \- Tcllib \- The Installer's Guide
16
17# <a name='toc'></a>Table Of Contents
18
19  - [Table Of Contents](#toc)
20
21  - [Description](#section1)
22
23  - [Requisites](#section2)
24
25      - [Tcl](#subsection1)
26
27      - [Critcl](#subsection2)
28
29  - [Build & Installation Instructions](#section3)
30
31      - [Installing on Unix](#subsection3)
32
33      - [Installing on Windows](#subsection4)
34
35      - [Critcl & Accelerators](#subsection5)
36
37      - [Tooling](#subsection6)
38
39# <a name='description'></a>DESCRIPTION
40
41Welcome to Tcllib, the Tcl Standard Library\. Note that Tcllib is not a package
42itself\. It is a collection of \(semi\-independent\)
43*[Tcl](\.\./\.\./\.\./index\.md\#tcl)* packages that provide utility functions
44useful to a large collection of Tcl programmers\.
45
46The audience of this document is anyone wishing to build and install the
47packages found in Tcllib, for either themselves, or others\.
48
49For developers intending to work on the packages themselves we additionally
50provide
51
52  1. *[Tcllib \- The Developer's Guide](tcllib\_devguide\.md)*\.
53
54Please read *[Tcllib \- How To Get The Sources](tcllib\_sources\.md)* first,
55if that was not done already\. Here we assume that the sources are already
56available in a directory of your choice\.
57
58# <a name='section2'></a>Requisites
59
60Before Tcllib can be build and used a number of requisites must be installed\.
61These are:
62
63  1. The scripting language Tcl\. For details see [Tcl](#subsection1)\.
64
65  1. Optionally, the __critcl__ package \(C embedding\) for
66     __[Tcl](\.\./\.\./\.\./index\.md\#tcl)__\. For details see __CriTcl__\.
67
68This list assumes that the machine where Tcllib is to be installed is
69essentially clean\. Of course, if parts of the dependencies listed below are
70already installed the associated steps can be skipped\. It is still recommended
71to read their sections though, to validate that the dependencies they talk about
72are indeed installed\.
73
74## <a name='subsection1'></a>Tcl
75
76As we are installing a number of Tcl packages and applications it should be
77pretty much obvious that a working installation of Tcl itself is needed, and I
78will not belabor the point\.
79
80Out of the many possibilities use whatever you are comfortable with, as long as
81it provides at the very least Tcl 8\.2, or higher\. This may be a Tcl installation
82provided by your operating system distribution, from a distribution\-independent
83vendor, or built by yourself\.
84
85*Note* that the packages in Tcllib have begun to require 8\.4, 8\.5, and even
868\.6\. Older versions of Tcl will not be able to use such packages\. Trying to use
87them will result in *package not found* errors, as their package index files
88will not register them in versions of the core unable to use them\.
89
90Myself, I used \(and still use\) [ActiveState's](http://www\.activestate\.com)
91ActiveTcl 8\.5 distribution during development, as I am most familiar with it\.
92
93*\(Disclosure: I, Andreas Kupries, worked for ActiveState until 2016,
94maintaining ActiveTcl and TclDevKit for them\)\.*\. I am currently working for
95SUSE Software Canada ULC, although not in Tcl\-related areas\.
96
97This distribution can be found at
98[http://www\.activestate\.com/activetcl](http://www\.activestate\.com/activetcl)\.
99Retrieve the archive of ActiveTcl 8\.5 \(or higher\) for your platform and install
100it as directed by ActiveState\.
101
102For those wishing to build and install Tcl on their own, the relevant sources
103can be found at
104
105  - Tcl
106
107    [http://core\.tcl\-lang\.org/tcl/](http://core\.tcl\-lang\.org/tcl/)
108
109together with the necessary instructions on how to build it\.
110
111If there are problems with building, installing, or using Tcl, please file a
112ticket against *[Tcl](\.\./\.\./\.\./index\.md\#tcl)*, or the vendor of your
113distribution, and *not* *[Tcllib](\.\./\.\./\.\./index\.md\#tcllib)*\.
114
115## <a name='subsection2'></a>Critcl
116
117The __critcl__ tool is an *optional* dependency\.
118
119It is only required when trying to build the C\-based *accelerators* for a
120number of packages, as explained in [Critcl & Accelerators](#subsection5)
121
122Tcllib's build system looks for it in the , using the name __critcl__\. This
123is for Unix\. On Windows on the other hand the search is more complex\. First we
124look for a proper application __critcl\.exe__\. When that is not found we look
125for a combination of interpreter \(__tclkitsh\.exe__, __tclsh\.exe__\) and
126starkit \(__critcl\.kit__, __critcl__\) instead\. *Note* that the choice
127of starkit can be overriden via the environment variable \.
128
129Tcllib requires Critcl version 2 or higher\.
130
131The github repository providing releases of version 2 and higher, and the
132associated sources, can be found at
133[http://andreas\-kupries\.github\.com/critcl](http://andreas\-kupries\.github\.com/critcl)\.
134
135Any branch of the repository can be used \(if not using the prebuild starkit or
136starpack\), although the use of the stable branch *master* is recommended\.
137
138At the above url is also an explanation on how to build and install Critcl,
139including a list of its dependencies\.
140
141Its instructions will not be repeated here\. If there are problems with these
142directions please file a ticket against the *Critcl* project, and not Tcllib\.
143
144# <a name='section3'></a>Build & Installation Instructions
145
146As Tcllib is mainly a bundle of packages written in pure Tcl building it is the
147same as installing it\. The exceptions to this have their own subsection,
148[Critcl & Accelerators](#subsection5), later on\.
149
150Before that however comes the standard case, differentiated by the platforms
151with material differences in the instruction, i\.e\. *Unix*\-like, versus
152*Windows*\.
153
154Regarding the latter it should also be noted that it is possible set up an
155*Unix*\-like environment using projects like *MSYS*, *Cygwin*, and others\.
156In that case the user has the choice of which instructions to follow\.
157
158Regardless of environment or platform, a suitable
159*[Tcl](\.\./\.\./\.\./index\.md\#tcl)* has to be installed, and its __tclsh__
160should be placed on the \(*Unix*\) or associated with "\.tcl" files
161\(*Windows*\)\.
162
163## <a name='subsection3'></a>Installing on Unix
164
165For *Unix*\-like environments Tcllib comes with the standard set of files to
166make
167
168    ./configure
169    make install
170
171a suitable way of installing it\. This is a standard non\-interactive install
172automatically figuring out where to place everything, i\.e\. packages,
173applications, and the manpages\.
174
175To get a graphical installer invoke
176
177    ./installer.tcl
178
179instead\.
180
181## <a name='subsection4'></a>Installing on Windows
182
183In a Windows environment we have the __installer\.tcl__ script to perform
184installation\.
185
186If the desired __tclsh__ is associated "\.tcl" files then double\-clicking /
187opening the __installer\.tcl__ is enough to invoke it in graphical mode\. This
188assumes that *[Tk](\.\./\.\./\.\./index\.md\#tk)* is installed and available as
189well\.
190
191Without *[Tk](\.\./\.\./\.\./index\.md\#tk)* the only way to invoke the installer
192are to open a DOS window, i\.e\. __cmd\.exe__, and then to invoke
193
194    ./installer.tcl
195
196inside it\.
197
198## <a name='subsection5'></a>Critcl & Accelerators
199
200While the majority of Tcllib consists of packages written in pure Tcl a number
201of packages also have *accelerators* associated with them\. These are
202__critcl__\-based C packages whose use will boost the performance of the
203packages using them\. These accelerators are optional, and they are not built by
204default\. If they are built according to the instructions below then they will
205also be installed as well\.
206
207To build the accelerators the normally optional dependency on __critcl__
208becomes required\.
209
210To build and install Tcllib with the accelerators in a Unix\-like environment
211invoke:
212
213    ./configure
214    make critcl  # Builds the shared library and package holding
215                 # the accelerators, tcllibc
216    make install # Installs all packages, including the new tcllibc.
217
218The underlying tool is "sak\.tcl" in the toplevel directory of Tcllib and the
219command __make critcl__ is just a wrapper around
220
221    ./sak.tcl critcl
222
223Therefore in a Windows environment instead invoke
224
225    ./sak.tcl critcl
226    ./installer.tcl
227
228from within a DOS window, i\.e\. __cmd\.exe__\.
229
230## <a name='subsection6'></a>Tooling
231
232The core of Tcllib's build system is the script "installer\.tcl" found in the
233toplevel directory of a checkout or release\.
234
235The
236
237    configure ; make install
238
239setup available to developers on Unix\-like systems is just a wrapper around it\.
240To go beyond the standard embodied in the wrapper it is necessary to directly
241invoke this script\.
242
243On Windows system using it directly is the only way to invoke it\.
244
245For basic help invoke it as
246
247    ./installer.tcl -help
248
249This will print a short list of all the available options to the standard output
250channel\.
251
252The commands associated with the various *install* targets in the
253*Makefile\.in* for Unix can be used as additional examples on how to use this
254tool as well\.
255
256The installer can operate in GUI and CLI modes\. By default it chooses the mode
257automatically, based on if the Tcl package
258__[Tk](\.\./\.\./\.\./index\.md\#tk)__ can be used or not\. The option
259__\-no\-gui__ can be used to force CLI mode\.
260
261Note that it is possible to specify options on the command line even if the
262installer ultimatively selects GUI mode\. In that case the hardwired defaults and
263the options determine the data presented to the user for editing\.
264
265The installer will select a number of defaults for the locations of packages,
266examples, and documentation, and also the format of the documentation\. The user
267can overide these defaults in the GUI, or by specifying additional options\. The
268defaults depend on the platform detected \(Unix/Windows\) and on the __tclsh__
269executable used to run the installer\.
270
271*Options*
272
273  - __\-help__
274
275    Show the list of options explained here on the standard output channel and
276    exit\.
277
278  - __\+excluded__
279
280    Include deprecated packages in the installation\.
281
282  - __\-no\-gui__
283
284    Force command line operation of the installer
285
286  - __\-no\-wait__
287
288    In CLI mode the installer will by default ask the user to confirm that the
289    chosen configuration \(destination paths, things to install\) is correct
290    before performing any action\. Using this option causes the installer to skip
291    this query and immediately jump to installation\.
292
293  - __\-app\-path__ *path*
294
295  - __\-example\-path__ *path*
296
297  - __\-html\-path__ *path*
298
299  - __\-nroff\-path__ *path*
300
301  - __\-pkg\-path__ *path*
302
303    Declare the destination paths for the applications, examples, html
304    documentation, nroff manpages, and packages\. The defaults are derived from
305    the location of the __tclsh__ used to run the installer\.
306
307  - __\-dry\-run__
308
309  - __\-simulate__
310
311    Run the installer without modifying the destination directories\.
312
313  - __\-apps__
314
315  - __\-no\-apps__
316
317  - __\-examples__
318
319  - __\-no\-examples__
320
321  - __\-pkgs__
322
323  - __\-no\-pkgs__
324
325  - __\-html__
326
327  - __\-no\-html__
328
329  - __\-nroff__
330
331  - __\-no\-nroff__
332
333    \(De\)activate the installation of applications, examples, packages, html
334    documentation, and nroff manpages\.
335
336    Applications, examples, and packages are installed by default\.
337
338    On Windows the html documentation is installed by default\.
339
340    On Unix the nroff manpages are installed by default\.
341