critcl_howto_install(3tcl)
β¨ NAME β¨
critcl_howto_install β How To Install CriTcl π
okay so this is the install guide for CriTcl, aka the C Runtime In Tcl, section 3tcl of the manual. Sit down, grab a strawberry drink π, we're getting you from zero to compiling.
π«Ά DESCRIPTION π«Ά
Be welcome to the C Runtime In Tcl (short: CriTcl) bestie!! It's a whole system for embedding and using C code from inside your Tcl (http://core.tcl-lang.org/tcl) scripts. no cap, it's iconic.
CriTcl is 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
Once that's done, it is now possible to follow the instructions on How To Use CriTcl. π¦
π οΈ 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 π
While CriTcl requires a working C compiler to both install itself, and to process CriTcl-based packages, installing such is very much out of scope for this document. like, not our job, respectfully π
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:
http://www.tldp.org/HOWTO/HOWTO-INDEX/programming.html
πΈ 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. π
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 (https://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. fr fr, just do it.
π 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
Attention This command uses default locations for the placement of the critcl application, the various packages, and header files.
- Invoke
./build.tcl dirs
to performing the installation.
- Use the options listed below to change the paths used for installation as desired. This is the same method as with
configurebased 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
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 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 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
configurebased 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. cute, it tests itself π«Ά
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.
This is possible because building a package from CriTcl-based sources is the operation mode not using MD5, therefore there is no circular dependency.
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.
π 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
and that's the whole page bestie, no skips, no crumbs π
this was doc, version 3.3.1, page critcl_howto_install(3tcl) β go forth and compile, you absolute icon π¦π
π¦ where this page comes from
- debian trixie: critcl 3.3.1+dfsg-1 Β· BSD
- ubuntu questing: critcl 3.3.1+dfsg-1
- ubuntu resolute: critcl 3.3.1+dfsg-1build1 Β· BSD
- ubuntu stonking: critcl 3.3.1+dfsg-1.1 Β· BSD
- Copyright (c) 2011-2024 Andreas Kupries
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms