CCP4i: Installation Issues for Tcl/Tk and BLT

Details and links to appropriate sites to obtain Tcl/Tk and BLT can be found here. It is worth checking first whether you need to install the latest versions - see the CCP4i installation instructions for information about how to do this.

This page is intended to provide some hints for problems with the installation of Tcl/Tk and BLT. A general bit of advice is to make sure you start clean: if you do have problems it is probably worthwhile to delete the Tcl/Tk/BLT directories and start again clean by re-unpacking them.

If you already have an older version of Tcl/Tk installed on your system then beware of confusions with that.

Finally, if you think you can contribute something to this page to help out other people in future please contact

General Problems

Tcl/Tk keyboard input fails to work on Linux with Chinese/Japanese/Korean input schemes

If you are using software on Linux to enable input of Chinese/Japanese/Korean characters such as SCIM (standard with SuSE) you may find that you cannot enter text in CCP4i text boxes using the keyboard. This is a known issue with Tcl/Tk. Some suggestions about how to solve it are here but the sure-fire way to fix this at present is to disable/uninstall the SCIM or equivalent package.

Under Tcl/Tk 8.3.3, I get an error and core dump when exiting bltwish

BLT 2.4u builds successfully using Tcl/Tk 8.3.3, but on some platforms the following error message appears on exiting bltwish:

Font -dt-interface user-medium-r-normal-xs*-*-*-*-*-*-*-*-* still in
TkFontPkgFree: all fonts should have been freed already
Abort (core dumped)
A large core file will also have been generated.

This appears to be the result of changes between Tcl/Tk 8.3.2 (where the error is not observed) and 8.3.3 (where it is). Our recommendation is to switch to Tcl/Tk 8.3.2 for the time being - this can no longer be obtained from the official Tcl/Tk archive, but is bundled in the tar file distributed by CCP4 - see

The build is successful but subsequently the interface buttons do not respond to mouse clicks

If there is already a version of Tcl/Tk installed on your system, if so then this may be a library clash. You do not need to rebuild the libraries, but you must ensure that the environment variables TCL_LIBRARY and TK_LIBRARY are set to the lib directory of the current installation (rather than an earlier version).

Problems with Building Tcl

Compilation fails under SuSe Linux egcs 2.91

Compilation of Tcl fails with errors associated with the functions Tcl_ErrnoId() and Tcl_ErrnoMsg().

The fix is to modify the tclPosixStr.c file as described in

NB: the above fix is for Tcl 8.0.4, but may be relevant for other versions too.

(Thanks to Charlie Bond)

Compilation fails under SunOS

The compiler requires the -Xa flag to build successfully. I added this directly to the CFLAGS variable in */unix/Makefile after configure had run. The build script will be tidied at some point.

(Martyn Winn)

Problems with Building BLT 2.4z

Compilation failure in bltTree on 64-bit machines

Often blt 2.4z can fail to compile on 64-bit machines

bltTree.c:2690: error: START_LOGSIZE undeclared (first use in this function)

This is due to misordered statements in blt2.4z/src/bltTree.c, which must undergo the following rearrangement.

@@ -95,17 +95,16 @@ static Value *TreeNextValue _ANSI_ARGS_(

+#define START_LOGSIZE		5 /* Initial hash table size is 32. */
+#define MAX_LIST_VALUES		20 /* Convert to hash table when node
+				    * value list gets bigger than this
+				    * many values. */

 #if (SIZEOF_VOID_P == 8)
 #define RANDOM_INDEX(i)		HashOneWord(mask, downshift, i)
 #define BITSPERWORD		64

-#define START_LOGSIZE		5 /* Initial hash table size is 32. */
-#define MAX_LIST_VALUES		20 /* Convert to hash table when node
-				    * value list gets bigger than this
-				    * many values. */
  * The following macro takes a preliminary integer hash value and
  * produces an index into a hash tables bucket list.  The idea is

Compilation failure on OSF1 V5.1

We have observed a compilation failure when using native compilers to build BLT 2.4z with Tcl/Tk 8.4.9, the compiler issues the following complaint:

cc: Error: ./bltInit.c, line 292: In this statement, the libraries on this platform do not yet support compile-time evaluation of the constant expression "0.0/0.0". (constfoldns)
    return 0.0 / 0.0;           /* Generate IEEE 754 Not-A-Number. */
*** Exit 1

A fix that appears to work is to modify the file blt2.4z/src/bltInit.c to remove the explicit zero division, and replace it with an appropriate macro from float.h:

*** blt2.4z/src/bltInit.c       Thu Sep  1 13:50:55 2005
--- blt2.4z-patched/src/bltInit.c       Thu Feb  9 15:11:10 2006
*** 289,295 ****
  static double
!     return 0.0 / 0.0;         /* Generate IEEE 754 Not-A-Number. */
  #endif /* !__BORLANDC__  && !_MSC_VER */

--- 289,295 ----
  static double
!     return DBL_SNAN;          /* Generate IEEE 754 Not-A-Number. */
  #endif /* !__BORLANDC__  && !_MSC_VER */

(Peter Briggs, February 2006)

Problems with Building BLT 2.4u

Choice of C compiler

The Tcl and Tk makes default to the native C compiler for your system, normally cc, but the BLT make will default to gcc (the GNU C compiler) if available. This can potentially cause problems, the way to avoid them is ensure that the same compiler has been used throughout.

e.g. add the following option to the BLT configure command:
before running make.

If you have already tried building BLT without this option it may be necessary to delete the config.cache file.

BLT "make install" fails

(On DEC Alpha OSF1/Tru64Unix V4.0 and SGI IRIX64 6.5)

The "make install" step fails because of missing dependencies in src/shared/ in the BLT distribution.

Make the following changes to the Makefile and to

*** Makefile-orig       Thu Feb 22 10:30:01 2001
--- Makefile    Thu Feb 22 10:21:05 2001
*** 124,134 ****
  install: install_dirs install_lib install_demo
! install_demo: $(bltwish)
        $(INSTALL) -m 0755 bltwish$(version) $(bindir)
        $(INSTALL) -m 0755 bltsh$(version) $(bindir)
! install_lib: $(lib_so)
        $(INSTALL) -m 0755 $(lib_so) $(libdir)
        $(INSTALL) -m 0755 $(tcl_only_lib_so) $(libdir)
--- 124,134 ----
  install: install_dirs install_lib install_demo
! install_demo: $(bltwish) $(bltsh)
        $(INSTALL) -m 0755 bltwish$(version) $(bindir)
        $(INSTALL) -m 0755 bltsh$(version) $(bindir)
! install_lib: $(lib_so) $(tcl_only_lib_so)
        $(INSTALL) -m 0755 $(lib_so) $(libdir)
        $(INSTALL) -m 0755 $(tcl_only_lib_so) $(libdir)

Can't build static version of BLT

Trying to build a statically linked version of the BLT package may fail, due to problems with the BLT Makefile.

A workaround is as follows. Run the BLT configure step, then do:

>  cd src
>  grep -v "cd shared" Makefile > Makefile.static
>  cp Makefile Makefile.bak
>  mv -f Makefile.static Makefile
>  cd ..

This should cut out the line which causes the error. You should then be able to run make and make install to complete the build and installation.