configure doesn't find Tcl/Tk

First, make sure you have the Tcl/Tk libraries and programs (if you can run tclsh and wish, it should be OK) and the header files (tcl.h, etc -- usually in /usr/include/). The header files come in the Tcl/Tk devel packages.

By default, the configure script expects to find the Tcl/Tk libraries in the standard linker path (without any -Ldirectory linker option) and under the standard names (i.e. with the -ltcl8.4 or -ltcl84 linker option). If you have them in different places or under different names, you have to edit configure.user and explicitly set TK_LIBS there, e.g.

  TK_LIBS="-L/opt/other/lib -ltk8.4 -ltcl8.4".

If configure still fails, look into the config.log file that it creates, and search for "tcl". You should find the compilation or linker errors there, and they should give you some hint what's wrong. If unsure, post it to the mailing list.

configure doesn't find wish

Wish is the "Windowing Shell", part of Tcl/Tk. The configure script looks for wish only in the PATH, under the following names (decreasing preference): wish, wish85, wish8.5, wish84, wish8.4, cygwish, cygwish85, cygwish84. So, you must have wish in the PATH for configure to find it.

It must also be working: you should be able to start it from the command line by typing wish (or one of the names listed above). If you get the error "no display and DISPLAY environment variable not set", then you're either not running X (wish , and thus ./configure won't work just in the console) or you really need to set the DISPLAY variable (export DISPLAY=:0.0 usually does it).

configure doesn't find BLT

Please review the section titled "*** BLT Tcl/Tk extension NOT FOUND -- please install it" first (below).

If it was no help and configure still fails, look into the config.log file that it creates and search for "BLT". The compilation or linker errors in there should give you a clue what's wrong. If they don't, write to the mailing list.

Cannot load

If you get an error message like this when you try to run a simulation: ./tokenring: error while loading shared libraries: cannot open shared object file: No such file or directory, the solution is to add the location of to LD_LIBRARY_PATH.

  export LD_LIBRARY_PATH=$HOME/omnetpp-3.x/lib;/path/to/libtcl-so

"Tcl_Init failed: Can't find a usable init.tcl..."

The TCL_LIBRARY environment variable should point to the directory which contains init.tcl. That is, you probably want to put a line like

  export TCL_LIBRARY=/usr/lib/tcl8.4

into your ~/.bash_profile. (On Windows, you can add environment variables in My Computer->Properties->Advanced). You can verify your setting by running tclsh and/or wish.

If TCL_LIBRARY is not set, tclsh and wish may still work, but OMNeT++ programs probably won't. That's because by default, Tcl tries a series of directory names, but most of them are relative to the executable, like ../lib/tcl8.4 -- which has a good chance to work with tclsh or wish which are installed in fairly standard places like /usr/bin, but not with OMNeT++ simulations or utilities which are probably in your home directory.

"*** BLT Tcl/Tk extension NOT FOUND -- please install it"

First, make sure you do have the BLT files. You should have libBLT2.4.a (usually in /usr/lib), blt.h and some more bltXXX.h files (usually in /usr/include), and a blt2.4 directory with pkgIndex.tcl and many more files (usually under /usr/lib). If you don't have BLT, see section "Getting BLT" below.

Next, make sure you have TCL_LIBRARY set, and it points to a directory which has a subdirectory or sibling directory named blt2.4, containing a BLT-specific pkgIndex.tcl file. That is, if TCL_LIBRARY is set to /usr/lib/tcl8.4, you should have the blt2.4 directory either under /usr/lib/ or under /usr/lib/tcl8.4/ (the first one is more typical).

Cygwin users: see the "Getting BLT" section!

Again, if TCL_LIBRARY is not set, it is possible that tclsh or wish find BLT ("package require BLT" succeeds) but OMNeT++ simulations or utilities don't, because Tcl looks for extensions in a series of directories relative to the the executable itself -- which work with tclsh and wish because they are in /usr/bin or some other standard place, but fails with OMNeT++ simulation programs which are probably in your home directory.

If you don't have the subdirs tcl8.4, tk8.4 and blt8.4 in the same directory, your installation is probably broken. Try moving/softlinking them to the same place. Soft links are created with the ln -s target softlinkname command. Don't use soft links under Cygwin -- non-100%-Cygwin programs won't recognize them.

BLT not found on Ubuntu

From the omnetpp google group (original discussion here:

The default tcl-tk version on ubuntu is 8.4. On the other hand the blt package is using tcl/tk version 8.5 by default after installation (which is not present on your system usually). Blt declares that it depends on tcl and tk packages but not explicitly that it needs 8.5.

Either of the following options should solve the issue:

  • ignore the warning and use OMNeT without BLT. You will have buttons in the dialogs instead of tabs, and there will be no multi column listboxes. You still get all the information, so it is really just about some better looking widgets. All the OMNET functionality is there (In fact OMNeT is not using BLT at all on MAC OS X for example);
  • Install Tcl/Tk-8.5 and run configure again (OMNET will use the highest available Tcl/Tk version so you can keep the 8.4 for other programs);
  • Fix blt to use 8.4 by default. There are symlinks in /usr/lib and libBLT.a and are pointing to the 8.5 compatible versions of the library. Become a root and change the symlink to point to the 8.4 libs. Run configure again.

bad cursor spec "@/usr/share/blt2.4/treeview.cur"

This is a dialog you might get from any OMNeT++ GUI program when running on MinGW on Windows. It is caused by a bug in the BLT make install script: it forgets to copy the treeview.cur file from the source directory. To resolve it on MinGW, copy treeview.cur from the BLT sources (see "Getting BLT" below) library/ subdir into your blt2.4 directory.

Cygwin users: see the "Getting BLT" section for a precompiled and patched copy of BLT.

Getting BLT

If you don't have BLT installed, you can download and build it yourself. You can get the source tarball, BLT2.4z.tar.gz from the Sourceforge BLT project page, (Windows users can download and install blt24z-for-tcl84.exe directly.)

Unpack the source tgz, change into its directory, then type ./configure, then make and make install (for the last step you'll need root privileges -- you may need to contact your sysadmin). If there's any problem, refer to the INSTALL file in the package.

Cygwin users: download and install from the download area. It has been patched for several Cygwin-specific problems.

You can try your installation by running bltwish, or running wish and typing "package require BLT" in it.

If you don't have root privileges:

  1. Download and unpack BLT2.4z.tar.gz
  2. ./configure --prefix=/localpath (localpath is a path that you can write to)
  3. make && make install - This might not work on 64-bit systems. If you get the message bltTree.c:2989: error: `MAX_LIST_VALUES' undeclared, you have to change the file src/bltTree.c. Replace
#if (SIZEOF_VOID_P == 8)
#define RANDOM_INDEX(i)		HashOneWord(mask, downshift, i)
#define BITSPERWORD		64
#define START_LOGSIZE		5 
#define MAX_LIST_VALUES		20


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

and run make && make install again.

  1. export TCLLIBPATH=/localpath/lib/ (A "package require BLT" in wish should say "2.4" now.)
  2. cd into omnetpp directory
  3. Add the following lines to configure.user:
   BLT_LIBS="-I/localpath/include -L/localpath/lib -lBLT24"
   CFLAGS='-O2 -DNDEBUG=1 -I/localpath/include/'
  1. run ./configure again
Edit - History - Print - Recent Changes - Search
Page last modified on July 26, 2011, at 11:26 AM