Notes Regarding Tcl on Various Platforms


Introduction

This document contains notes on building Tcl (and to some extent Tk) on various platforms. The information contained herein was previously a part of the Tcl Language Usage Questions And Answers document, but has been removed from it, because these notes pertain to older versions (7.3 and earlier) of Tcl.

Last modified: Tue Oct 31 18:49:15 PST 1995


Index of Questions:

Introduction

Q.A1- How can I create shared Tcl/Tk libraries on AIX?

Dov Grobgeld (dov@menora.weizmann.ac.il) provided info on creating Tcl and Tk shared libraries under AIX 3.1.5:

For Tcl:

    cc -o tkshar.o *.o -bE:tclshar.exp -bM:SRE -berok -lX11 -lm
    ar r libtclshr tclshar.o

For Tk:

    cc -o tkshar.o *.o -bE:tkshar.exp -bM:SRE -berok -Ltcl -lX11 -lm -ltclshr
    ar r libtkshr tkshar.o

where tclshar.exp and tkshar.exp had lists of the external functions.

There are also problems with fonts on AIX and the IBM. A patch is needed from IBM to fix the X server so that fonts are working.

Q.A2- Has anyone gotten Tcl to compile under HP-UX?

See the porting notes. Also, be aware that there have been some reports of Configure assuming that you should use the compatibility version of opendir() and that you have no dirent.h . This causes glob-ing to fail, as well as TclX's readdir, etc.

Changing tcl7.3 to remove the opendir compatibility file and removing the -DNO_DIRENT, -DUSE_DIRENT2 fixed it all up.

Q.A3- Has anyone gotten Tcl to compile under VMS?

Information from John Kimball (jkimball@src.honeywell.com) on May 4, 1993 was that he had gotten Tcl 6.7 and Tk 3.2 ported to VMS 5.5. See the catalog for the file information.

Q.A4- What does it take to get Tcl to compile under SCO Unix?

Add a "#undef select" to tkEvent.c, and remove the reference to TK_EXCEPTION around line 460 of main.c.

Tk uses its own scheme for allocating the border colors for its 3D widgets, which causes problems when running TK on a system with "PseudoColor" display class, and a 16-cell colormap.

If you can't go to eight bitplanes, you can instead start the server with a "-static" (Xsco) or "-analog" (Xsight) option, making the display class become "StaticColor". This makes the entire colormap read-only, and it will return the color that most closely maps to the desired color as possible.

This information is from Keith Amann (Keith_Amann@stortek.com).

Q.A5- Why do I get format and scan errors when I run tclTest?

That's a problem (scanf/printf) many systems seem to have. Don't worry too much about it - just don't use these 'advanced' features. If you're hacking C, you'll have the same problems.

For instance, printf("%Ng", double_value) and strtod("+",&terminal) produce incorrect results.

Q.A6- Why do I get lots of errors under Irix 4.0.1 when I run tclTest?

There's a bug in the 4.0.1 optimizer that's fixed in 4.0.2. Compile tclVar.c using -O0 (no optimization).

Q.A7- Does anyone else have problems with Tcl on a Cray?

See the porting notes for a set of changes mentioned. Also, Booker C. Bense (benseb@grumpy.sdsc.edu) reports that version 3.0.1.6 has some real problems with char pointers, causing Tcl to crash. Using version 3.0.2.1, things are much better, except for a minor formatting problem and serious problems with scan.

Q.A8- How do I install Tcl 7.1/Tk 3.4 on NeXTSTEP 3.1?

I have indicated in the past that this particular question seems to generate controversy - I have replaced previous explanations with the latest msg from someone who sounds authoritative...

From: Robert Nicholson (robert@steffi.demon.co.uk)

This is for TCL7.1 and TK3.4

This is a variation on Thomas Funke's entry.

Installing TCL7.1 on NeXT

To install tcl7.1 on NeXTSTEP 3.1 you must:

At this point you probably want to rename the all calls to strtod and tmpnam to something else in order to distinguish them from those that are supplied in the NeXT libraries libsys_a.a. You can do this by adding the following line to AC_FLAGS

    -Dstrtod=newstrtod -Dtmpnam=newtmpnam

and renaming the names of the definitions in the appropriate compat/*.c files.

To check everything is working correctly open a tclsh

    % expr {"0" == "+"} 
    0

Using the wrong strtod function will cause this test to return 1 which is a serious error. Ignore the precision errors.

Installing TK3.4 on NEXTSTEP 3.1

There is a call to strtod in TK3.4 so you should link against ../tcl-7.1/compat/strtod.o and apply the -Dstrtod=newstrtod to AC_FLAGS in Tk also.

Note:Tk's raise test will fail when running the tvtwm window manager. Changing to either twm or even better fvwm ensures that this test will succeed.

Q.A9- Why am I getting errors on my SGI Indigo workstation?

From Gordon Lack (gml4410@ggr.co.uk) we are told that the SGI c compiler has some bugs with variable arguments.

tclVar.c must be compiled with -O0 at IRIX C 4.0.1 because of a compiler bug with varargs.

Done by placing specific rule into Makefile.

    # GGR SG needs -O0 for varargs at 4.0.1

    CC_SWITCHES0 =  -O0 -I. -I${SRC_DIR} ${AC_FLAGS} ${MATH_FLAGS} \
          ${GENERIC_FLAGS} ${PROTO_FLAGS} ${MEM_DEBUG_FLAGS} \
          -DTCL_LIBRARY=\"${TCL_LIBRARY}\"

    tclVar.o: tclVar.c
          $(CC) -c $(CC_SWITCHES0) $<

Peter Neelin (neelin@pet.mni.mcgill.ca) also noted that:

I get tclX 7.3a to compile on an SGI (irix 4.0.5) with the following changes to the Config.mk file:

    71c71
    < CFLAGS=-cckr -D__GNU_LIBRARY__
    ---
    > #CFLAGS=
    106,107c106,107
    < TCL_PLUS_BUILD=TCL_PLUS
    < CCPLUS=g++
    ---
    > #TCL_PLUS_BUILD=TCL_PLUS
    > CCPLUS=CC
    191,193c191
    < MAN_DIR_SEPARATOR=
    < 
    < LIBOBJS=strftime.o
    ---
    > #MAN_DIR_SEPARATOR=.

The -D__GNU_LIBRARY solves the srandom problem and I think that the -cckr gets around the prototype error with waitpid (it's crude, but it works). I've forgotten why I needed the strftime.

If you want the version of Config.mk that worked for me, send me mail.

Q.A10- How do I build expect on Solaris 2.3?

From Jeff Abramson (jra@hrcms.jazz.att.com) we are told that,

using either SunPro cc 2.0.1 or gcc 2.5.8 with no problems. For SunPro I do:

    CC=cc ./configure --prefix=directory_of_your_choice
    make CC=cc

For gcc I do:

    CC="gcc -fwritable-strings" ./configure \
        --prefix=directory_of_your_choice
    make CC="gcc -fwritable-strings"

Q.A11- How do I port Tcl and Tk to a Sequent?

From Andrew Swan (aswan@soda.berkeley.edu) we find:

For both Tcl and Tk, I used gcc rather than the Sequent cc which is not ansi.

For Tcl, there were a couple of problems with the math library. First, the Sequent math library doesn't include the 'fmod' function. I got the source for fmod from ftp.uu.net, put it in the compat subdirectory, and added it to the Makefile. fmod also wanted functions 'isnan' and 'finite' but I just commented those out since I don't believe tcl supports infinity and nan.

The other problem with the math library was that it has two copies of the 'tanh' function in it. This is easy to fix by using "ar" to separate the library in to object files and then reconstruct it, leaving one of the copies of tanh out.

With those changes, Tcl compiled cleanly and passed all the tests except the scanning tests. Apparently, the *scanf functions are broken in Dynix. The problem is with recognizing the end of octal numbers, and I just let this problem go. Fixing it would probably involve finding source to the *scanf functions and including it.

To compile Tk, I had to make a new version of stddef.h including things like wchar_t. I just copied it in to another include directory and put that directory first and then tweaked the copy. Tk also had the math library problem (tanh). Other than those, however, everything compiled cleanly and passed all the tests.

Q.A12- How do I get around the symbol table full msg in A/UX 3.0?

After getting things compiled on A/UX, you have to be sure to do the links with the -A {factor} arguments which expand the default table allocations. {factor} is the amount by which the compiler multiplies the default allocation. Try -A 2. Contact Walter B. Kulecz, PhD. (wkulecz@medics.jsc.nasa.gov) for more details of his port.

Q.A13- How do I compile Tcl on MS-DOS, MacOS, or other non-UNIX system?

Refer to Larry Virden's FAQ (see tcl-faq/part1) or (see tcl-faq/part4) for details concerning tools, finished ports, or mailing lists relating to this topic.

Q.A14- How do I get Tcl to compile on my QNX system?

Steve Furr (furr@qnx.com) indicates:

For the record, to get TCL to work under QNX, I had to:


Send comments regarding this page to Joe Moss (joe@morton.rain.com)