critcl_howto_install(n)
πΈ critcl_howto_install(n) β How To Install CriTcl β¨
Hiii bestie π welcome to the C Runtime In Tcl (short: CriTcl), a whole system for embedding and using C code from inside Tcl [http://core.tcl-lang.org/tcl] scripts. This is the critcl_howto_install(n) page and honestly it's giving "setup guide that actually respects you" π
.
CriTcl gets installed in four major steps:
- Install The Requisites
- Follow the instructions on How To Get The CriTcl Sources
- Install The CriTcl Packages
- Test The Installation
After that you can literally just follow the instructions on How To Use CriTcl. Periodt. π
π INSTALL THE REQUISITES π
This major step breaks down into three minor steps:
- Install A Working C Compiler and development environment.
- Install A Working Tcl Shell
- Install Supporting Tcl Packages
π οΈ INSTALL A WORKING C COMPILER
Okay so real talk: CriTcl requires a working C compiler both to install itself and to process CriTcl-based packages β but installing that compiler is very much out of scope for this document. Not our lane, not our problem π.
Please follow the instructions for the platform and system CriTcl is to be installed on.
The important pieces of information are this:
- The path to the directory containing the C compiler binary has to be listed in the environment variable
PATH, for CriTcl to find it. - On Windows(tm) the environment variable
LIBhas to be present and contain the paths of the directories holding Microsoft's libraries. The standard CriTcl configuration for this platform searches these paths to fine-tune its settings based on available libraries and compiler version.
Links of interest:
π INSTALL A WORKING TCL SHELL
That a working installation of CriTcl will require a working installation of Tcl [http://core.tcl-lang.org/tcl] should be obvious. Like, obviously π.
Installing Tcl however is out of scope here, same as for installing a working C compiler.
There are too many options, starting from building it from scratch [http://core.tcl-lang.org/tcl], installing what is provided by the platform's package manager (zypper [https://en.opensuse.org/Portal:Zypper], yum [https://access.redhat.com/solutions/9934], apt-get [https://help.ubuntu.com/community/AptGet/Howto], and more), to using some vendor's distribution [http://core.tcl-lang.org/dist.html].
A single piece of advice however. π«Ά
While CriTcl currently supports running on Tcl 8.4 and higher, and the creation of packages for the same, the last release for this version was in 2013 (9 years ago at the time of writing). Similarly, the last release for Tcl 8.5 was in 2016 (6 years ago). Both are official end of life.
Given this I recommend to install and use Tcl 8.6. That's the main character version, no cap β¨.
π¦ INSTALL SUPPORTING TCL PACKAGES
The implementation of CriTcl uses and depends on
cmdline
Depending on how Tcl was installed this package may be available already without action, or not. Invoke the command
echo 'puts [package require cmdline]' | tclsh
to check if the package is present or not. If it is present then its version number will be printed, else the error message can't find package cmdline or similar.
If it is not present install the package as per the instructions for the chosen Tcl installation.
Note, the package cmdline may not exist as its own installable package. In such a case check if the chosen Tcl installation provides a tcllib package and install that. This should install all the packages in the Tcllib bundle, including cmdline.
As a last fallback, go to Tclib [http://core.tcl-lang.org/tcllib] and follow the instructions to install the bundle from scratch.
π INSTALL THE CRITCL PACKAGES π
Note that this step has different instructions dependent on the platform CriTcl is to be installed on. In other words, only one of the sub sections applies, the other can be ignored. Pick your fighter π.
π§ INSTALL ON UNIX
This section offers instructions for installing CriTcl on various kinds of Unix and Unix-related systems, i.e. Linux, the various BSDs, etc. It especially covers Mac OS X as well.
Use the instructions in section Install On Windows when installing on a Windows platform and not using a unix-like environment as provided by tools like MinGW [https://www.mingw-w64.org], CygWin [https://www.cygwin.com/], Git For Windows [https://gitforwindows.org], WSL [https://docs.microsoft.com/en-us/windows/wsl/faq], etc.
- Change the working directory to the top level directory of the CriTcl checkout obtained by following the instructions of How To Get The CriTcl Sources.
- Verify that the file
"build.tcl"is marked executable. Make it executable if it is not. - Invoke
./build.tcl install
to do the installation.
Attention This command uses default locations for the placement of the critcl application, the various packages, and header files.
- Invoke
./build.tcl dirs
to see the directories in play before actually performing the installation. π
- Use the options listed below to change the paths used for installation as desired. This is the same method as with configure based packages.
--prefixpath β Base path for non-package files.--include-dirpath β Destination path for header files.--exec-prefixpath β Base path for applications and packages.--bin-dirpath β Destination path for applications.--lib-dirpath β Destination path for packages.
These options are especially necessary in all environments not using the semi-standard "bin", "lib", "include" locations from configure.
As an example of such environments, Ubuntu (and possibly Debian) expect Tcl packages to be installed into the "/usr/share/tcltk" directory, therefore requiring the use of
--lib-dir /usr/share/tcltk
for that setup π.
Note that this guide neither covers the details of the install method, nor does it cover any of the other methods available through the build.tcl tool of CriTcl. These can be found in the CriTcl build.tcl Tool Reference.
πͺ INSTALL ON WINDOWS
This section offers instructions for installing CriTcl on a Windows (tm) host. Note that environments as provided by tools like MinGW [https://www.mingw-w64.org], CygWin [https://www.cygwin.com/], Git For Windows [https://gitforwindows.org], WSL [https://docs.microsoft.com/en-us/windows/wsl/faq], etc. are classed as Unix-like, and the instructions in section Install On Unix apply.
- In a DOS box, change the working directory to the top level directory of the CriTcl checkout obtained by following the instructions of How To Get The CriTcl Sources.
- In the same DOS box, invoke
tclsh.exe ./build.tcl install
to do the installation.
Attention This command uses default locations for the placement of the critcl application, the various packages, and header files.
- Invoke
tclsh.exe ./build.tcl dirs
to check the directories before actually performing the installation. π
- Use the options listed below to change the paths used for installation as desired. This is the same method as with configure based packages.
--prefixpath β Base path for non-package files.--include-dirpath β Destination path for header files.--exec-prefixpath β Base path for applications and packages.--bin-dirpath β Destination path for applications.--lib-dirpath β Destination path for packages.
Attention! The current installer does not put an extension on thecritclapplication. This forces users to either explicitly choose thetclshto run the application, or manually rename the installed file to"critcl.tcl". The latter assumes that an association for".tcl"is available, to eithertclsh, orwish. π
Note that this guide neither covers the details of the install method, nor does it cover any of the other methods available through the build.tcl tool of CriTcl. These can be found in the CriTcl build.tcl Tool Reference.
π§ͺ TEST THE INSTALLATION π§ͺ
Installing CriTcl contains an implicit test of its functionality. Self-testing queen π .
One of its operation modes uses the MD5 hash internally to generate unique ids for sources, as a means of detecting changes. To make generation of such hashes fast a CriTcl-based package for MD5 is installed as part of the main installation process.
In other words, after installing the core packages of CriTcl this partial installation is used to build the rest. Iconic behaviour honestly π.
This is possible because building a package from CriTcl-based sources is the operation mode not using MD5, therefore there is no circular dependency. We love a non-circular situation β¨.
For our purposes this however is also a self-test of the system, verifying that the core of CriTcl works, as well as the C compiler.
For additional testing simply move on to section The First Package of the guide on How To Use CriTcl.
π AUTHORS
Jean Claude Wippler, Steve Landers, Andreas Kupries
π BUGS, IDEAS, FEEDBACK
This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report them at https://github.com/andreas-kupries/critcl/issues. Ideas for enhancements you may have for either package, application, and/or the documentation are also very welcome and should be reported at https://github.com/andreas-kupries/critcl/issues as well. Fr fr, they wanna hear from you π«Ά.
π₯ KEYWORDS
C code, Embedded C Code, calling C code from Tcl, code generator, compile & run, compiler, dynamic code generation, dynamic compilation, generate package, linker, on demand compilation, on-the-fly compilation
π¦ CATEGORY
Glueing/Embedded C code
π COPYRIGHT
Copyright (c) Jean-Claude Wippler
Copyright (c) Steve Landers
Copyright (c) 2011-2024 Andreas Kupries
That's the whole thing bestie, you're literally ready to go πβ¨ This was critcl_howto_install(n) from the doc source, version 3.3.1 β slay, go install something ππ
π¦ where this page comes from
- alpine 3.24: critcl-doc 3.3.1-r1 Β· TCL
- Copyright (c) 2011-2024 Andreas Kupries
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms