Link to NIST Center for Neutron Research home page Link to National Institute of Standards & Technology home page

Building Tcl/Tk 8.2.3 + BLT, BWidget, Tix and dp packages for LINUX

This page contains my notes on building Tcl/Tk and the packages we commonly use for Tcl/Tk at the NIST Center for Neutron Research. I did this on an i586 Red Hat Linux release 6.0 machine using egcs-1.1.2.

1. Files to Download

I downloaded the following:

2. Build and Install Tcl/Tk

Note there are three paths referred to below:
  1. the location where the above files are downloaded. (/net/jazz/usr/user5/linux for this example). I needed ~8 Mb of temporary storage for this.
  2. the location where source files will be placed during the build (/usr/tmp/tcltk823 for this example). I needed will ~50 Mb of temporary storage for this.
  3. the location where the files will be installed, which is determined by the --prefix qualifier on the ./configure script. Note that the same value for --prefix should be used on all of the ./configure commands so that the packages are installed in the same tree. Do not use the defaults, which differ between packages.

    For LINUX systems, I typically use --prefix=/usr so that the Tcl/Tk files overwrite the ones installed with the LINUX distribution, but with an SGI or other computer, I don't like to modify system directories so I tend to use --prefix=/usr/local. If you don't have root access, you can install in some other location, for example, --prefix=/home/mytcltk. I needed ~11 Mb of permanent storage for these files.

2.1 Tcl/Tk

mkdir /usr/tmp/tcltk823
cd /usr/tmp/tcltk823
gunzip < /net/jazz/usr/user5/linux/tcl8.2.3.tar.gz | tar xvf -
cd tcl8.2.3/unix/
./configure --prefix=/usr
make 
make install

cd /usr/tmp/tcltk823
gunzip < /net/jazz/usr/user5/linux/tk8.2.3.tar.gz | tar xvf -
cd tk8.2.3/unix/
./configure --prefix=/usr
make 
make install

2.2 BLT

Note that the package index file created by BLT never seems to work correctly (it does not reference the routines in the bltGraph.tcl file). I overwrite the file in the last installation file. This may have changed in more recent versions. You should check before you make this patch.
cd /usr/tmp/tcltk823
gunzip < /net/jazz/usr/user5/linux/BLT2.4o.tar.gz  | tar xvf -
cd blt2.4o/
./configure --prefix=/usr --enable-shared
make
make install
cp /net/jazz/usr/user5/linux/BLT2.4_pkgIndex.tcl /usr/lib/blt2.4/pkgIndex.tcl

2.3 Tix

Note that the patch is probably not needed with a more recent version of Tix than 4.1.0.
cd /usr/tmp/tcltk823
gunzip < /net/jazz/usr/user5/linux/Tix4.1.0.007.tar.gz | tar xvf -
ln -s tcl8.2.3 tcl8.2
ln -s tk8.2.3 tk8.2
cd Tix4.1.0.007
patch -p4 < /net/jazz/usr/user5/linux/Tix4.1.0.007_tcltk82_patch
cd unix
./configure --prefix=/usr --enable-shared
cd tk8.0
./configure --prefix=/usr --enable-shared
cd ..
make
make install

2.4 BWidget

Note that the BWidget package is pure Tcl/Tk and does not need to be compiled.
cd /usr/lib/
gunzip < /net/jazz/usr/user5/linux/BWidget-1.2.1.tar.gz | tar xvf -

2.5 dp

The dp package is used at the NCNR for scripts that use RPC communication (xpeek). This is probably of little value to most people.
cd /usr/tmp/tcltk823
gunzip < /net/jazz/usr/user5/linux/dp40b2-src.tar.gz  | tar xvf -
cd tcl-dp
patch -p4 < /net/jazz/usr/user5/linux/dp40_tcl82patches 
cd unix
./configure --prefix=/usr --enable-shared --with-tcl=/usr/tmp/tcltk823/tcl8.2.3/unix
make
mkdir /usr/lib/dp4.0
cp ../library/* libdp40.so /usr/lib/dp4.0/
cp /net/jazz/usr/user5/linux/dp4.0_pkgIndex.tcl /usr/lib/dp4.0/

3.0 Select as default version

If you want these versions of Tcl/Tk to be used by default execute the first two link commands. The latter two commands are wise because too many people assume the Tcl is installed in /usr/local rather than /usr.
ln -sf wish8.2 /usr/bin/wish
ln -sf tclsh8.2 /usr/bin/tclsh

ln -sf /usr/bin/wish /usr/local/bin/wish
ln -sf /usr/bin/tclsh /usr/local/bin/tclsh

Neither the author nor the U.S. Government makes any warranty, expressed or implied, or assumes any liability or responsibility for the use of this information or the software described here. Brand names cited here are used for identification purposes and do not consitute an endorsement by NIST.

Comments, corrections or questions: crystal@NIST.gov