6.4.3 Compiling SICStus with Tcl/Tk Support

Please note: This section is only relevant when compiling source distributions with support for Tcl/Tk.

Most UNIX machines today have Tcl/Tk preinstalled. This reduces the risk of installation difficulties since the linker and the runtime linker usually finds Tcl/Tk in its default paths. Most other installation and/or configuration problems related to Tcl/Tk are caused by improper installation or installation in a path where the linker and runtime linker cannot find Tcl/Tk.

Tcl/Tk is configured for installation similar to SICStus; by the use of a configure script generated by GNU Autoconf. The installation directory is specified by the --prefix option. The value of this option is referred to as the installation-dir below.

Question:
The configure-script complains that it cannot find Tcl_Init and/or Tk_Init. What should I do?

The following message from configure indicates that it could not link a test program with the Tcl/Tk libraries.

     ...
     checking for Tcl_Init in -ltcl8.3... no
     checking for Tk_Init in -ltk8.3... no
     ...

The common cause of this is that the compiler cannot find -ltcl8.3 and/or -ltk8.3 (or whichever version it tries to find), usually because Tcl/Tk has been installed in a non-standard directory (i.e. different from /usr/lib, /usr/local/lib, etc.).

If you've installed Tcl/Tk in installation-dir, specify the following to configure:

     % ./configure --with-tcltk=installation-dir more options

The problem can occur even if the Tcl/Tk shared libraries can be found, but the link-phase failed due to other reasons. If this occurs, it is often useful to look in config.log, where output from compilation stages etc. is logged.

Question:
I've installed Tcl and Tk in different directories. What do I do?

You can use:

     % ./configure --with-tcl=tclinstallpath --with-tk=tkinstallpath
Question:
There are no shared Tcl/Tk libraries. What has happened?

You need to specify --enable-shared when configuring Tcl/Tk. This is not enabled by default.