Forum OpenACS Q&A: Missing tclsh on Solaris - how to fix?

I haven't worked much on Solaris lately and the sys admin is on vacation, so I'm on my own....

I need to compile tDOM, but that is asking for tclsh.  I was able to download tcl 8.3.5, which is close to the expected 8.3.2, but the binaries were no longer available.  So I'm trying to build it, but it's failing with

bash-2.05$ make
cc -c -O  -KPIC -I./../generic -I. -DHAVE_UNISTD_H=1 -DHAVE_LIMITS_H=1 -DUSEGETWD=1 -DNO_STRERROR=1 -DNO_GETWD=1 -DNO_WAIT3=1 -DNO_UNAME=1 -DNO_REALPATH=1 -DNO_DIRENT_H=1 -DNO_STDLIB_H=1 -DNO_STRING_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_PARAM_H=1 -DNO_FD_SET=1 -DTM_IN_SYS_TIME=1 -DHAVE_SYS_TIME_H=1 -DNO_FSTATFS=1 -DNO_MEMMOVE=1 -DNO_STRING_H=1 -Dmode_t=int -Dpid_t=int -Dsize_t=unsigned -Duid_t=int -Dgid_t=int -DUSE_DIRENT2_H=1 -DNO_UNION_WAIT=1 -DNO_GETTOD=1 -DGETTOD_NOT_DECLARED=1 -DHAVE_NET_ERRNO_H=1 -D_REENTRANT=1 -D_POSIX_PTHREAD_SEMANTICS=1 -DHAVE_SYS_IOCTL_H=1 -DHAVE_SYS_FILIO_H=1        -DTCL_SHLIB_EXT=\".so\" ./../generic/regcomp.c
/usr/ucb/cc:  language optional software package not installed
make: *** [regcomp.o] Error 1

This is an error I've never seen before!

Can I use the latest version of tclsh, 8.4.5, which would allow me to install the binaries, or do I need to figure out how to fix this?

Thanks in advance!

Collapse
Posted by Andrew Piskorski on
You're using "cc", but what compiler is that on your machine? Sun cc or gcc? You might be using the wrong one, or using the options intended for the other compiler, or something like that.

I never tried building tdom on Solaris but I think your compile error above is for Tcl anyway, not tdom. Whenever I've built Tcl from source on Solaris it Just Worked. I last did it like this:

$ cd checkouts/tcl/tcl-842/unix/
$ ./configure --enable-gcc --enable-shared --enable-threads
# env CC=gcc gmake
$ gmake
$ #gmake test
  # Files with failing tests: http.test httpold.test safe.test
$ sudo gmake install 
$ sudo chmod 755 /usr/local/bin/tclsh8.4
I'm not sure why I had that "env CC=gcc gmake" commented out in my notes above, but you might need or want to use that rather than the just plain "gmake" that I suspect worked ok for me.

If you're using AOLserver 3.3+ad13 and it's Tcl 8.3.x, I've no idea whether a tdom compiled with Tcl 8.4.x would work there or not. But wait a minute, for use in AOLserver 3.3, you have to compile tdom specially as an AOLserver module anyway, and AOLserver 3.3 ships with its own customized copy of Tcl 8.3.x, so isn't that what you should be using for building your tdom?

Collapse
Posted by Dave Hwang on
It's looking for /usr/ucb/cc, but apparently you don't have the developer packages installed on that box. You could try forcing the make to use gcc instead (assuming you have gcc installed) and see if that lets it build.

On the other hand , you can find binaries (solaris packages, actually) for useful free software at http://www.sunfreeware.com. That site can be slow, so I usually use a mirror like http://sunfreeware.secsup.org/

If you look in the ftp archive, you can find older versions. Just go to the appropriate directory (Sparc|Intel/solaris-version) and grab the package you want.

Once you get a package, the steps for installation (assuming you have root access) are:

  • gunzip package_name.gz
  • pkgadd -d package_name
Collapse
Posted by Janine Ohmer on
The error I get when building tDOM is

checking for tclsh... configure: error: No tclsh found in PATH:  /usr/local/src/aolserver-3.3+ad13/aolserver/tcl8.3.2/unix /usr/local/src/aolserver-3.3+ad13/aolserver/tcl8.3.2/unix/../bin /usr/local/bin /usr/local/bin /oracle/u00/app/oracle/product/8.1.7/bin /oracle/u00/app/oracle/product/8.1.7/ctx/lib /bin /usr/bin /usr/ucb /usr/bin/X11 /usr/local/bin /usr/local/bin /usr/ccs/bin

Which is absolutely true.  The AOLserver build doesn't create tclsh.  I tried going into /usr/local/src/aolserver-3.3+ad13/aolserver/tcl8.3.2/unix and typing make there, but I got lots of errors like this:

Undefined                      first referenced
symbol                            in file
ns_calloc                          /usr/local/src/aolserver-3.3+ad13/aolserver/tcl8.3.2/unix/libtcl8.3g.a(nsthreads.o)
Ns_TlsSet                          /usr/local/src/aolserver-3.3+ad13/aolserver/tcl8.3.2/unix/libtcl8.3g.a(nsthreads.o)
ns_free                            /usr/local/src/aolserver-3.3+ad13/aolserver/tcl8.3.2/unix/libtcl8.3g.a(nsthreads.o)

Setting CC to gcc did fix the problem compiling the 8.3.5 version of tclsh, once I reran configure, but I still wasn't able to build:

gcc -pipe -c -O -Wall -Wconversion -Wno-implicit-int -fPIC -I./../generic -I. -DHAVE_UNISTD_H=1 -DHAVE_LIMITS_H=1 -DUSEGETWD=1 -DNO_STRERROR=1 -DNO_GETWD=1 -DNO_WAIT3=1 -DNO_UNAME=1 -DNO_REALPATH=1 -DNO_STDLIB_H=1 -DNO_STRING_H=1 -DHAVE_UNISTD_H=1 -DHAVE_SYS_PARAM_H=1 -DUSE_TERMIOS=1 -DTM_IN_SYS_TIME=1 -DHAVE_SYS_TIME_H=1 -DHAVE_TIMEZONE_VAR=1 -DNO_FSTATFS=1 -DNO_MEMMOVE=1 -DNO_STRING_H=1 -Dmode_t=int -Dpid_t=int -Dsize_t=unsigned -Duid_t=int -Dgid_t=int -DUSE_DIRENT2_H=1 -DNO_UNION_WAIT=1 -DNEED_MATHERR=1 -DNO_GETTOD=1 -DGETTOD_NOT_DECLARED=1 -DHAVE_SIGNED_CHAR=1 -DHAVE_NET_ERRNO_H=1 -D_REENTRANT=1 -D_POSIX_PTHREAD_SEMANTICS=1 -DHAVE_SYS_IOCTL_H=1 -DHAVE_SYS_FILIO_H=1        -DTCL_SHLIB_EXT=\".so\" -DUSE_TCLALLOC=0 ./../generic/tclAlloc.c
In file included from ../generic/tclPort.h:27,
                from ../generic/tclAlloc.c:22:
../unix/tclUnixPort.h:42:26: net/errno.h: No such file or directory
In file included from ../generic/tclPort.h:27,
                from ../generic/tclAlloc.c:22:
../unix/tclUnixPort.h:255: error: conflicting types for `gettimeofday'
/usr/include/sys/time.h:397: error: previous declaration of `gettimeofday'
make: *** [tclAlloc.o] Error 1

So I decided to punt and I installed the 8.4.1 binaries from sunfreeware.
This enabled me to run CONFIG for tDOM without incident.

Unfortunately, now tDOM won't build:

bash-2.05$ make
gcc -pipe -DHAVE_UNISTD_H=1 -DHAVE_LIMITS_H=1 -DTCL_THREADS=1
-DHAVE_GETCWD=1 -DHAVE_OPENDIR=1 -DHAVE_STRSTR=1 -DHAVE_STRTOL=1
-DHAVE_TMPNAM=1 -DHAVE_WAITPID=1 -DHAVE_UNISTD_H=1
-DHAVE_SYS_PARAM_H=1 -DUSE_TERMIOS=1 -DHAVE_SYS_TIME_H=1
-DTIME_WITH_SYS_TIME=1 -DHAVE_TZNAME=1 -DHAVE_TIMEZONE_VAR=1
-DHAVE_ST_BLKSIZE=1 -DSTDC_HEADERS=1 -DNO_UNION_WAIT=1
-DNEED_MATHERR=1 -DHAVE_SIGNED_CHAR=1 -DHAVE_SYS_IOCTL_H=1
-DHAVE_SYS_FILIO_H=1 -DSTATIC_BUILD=1 -DHAVE_MEMMOVE=1
-DHAVE_BCOPY=1 -DTCL_WIDE_INT_TYPE=long\ long -DHAVE_STRUCT_DIRENT64=1
-DHAVE_STRUCT_STAT64=1 -DHAVE_TYPE_OFF64_T=1 -DHAVE_UNISTD_H=1
-DHAVE_SYS_PARAM_H=1 -DVERSION=\"0.7.8\" -DUSE_THREAD_ALLOC=1
-D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1
-DHAVE_READDIR_R=1 -DTCL_THREADS=1 -D_REENTRANT=1
-D_POSIX_PTHREAD_SEMANTICS=1 -DUSE_TCL_STUBS=1 -DNS_AOLSERVER=1
-DUSE_NORMAL_ALLOCATOR=1 -DXML_DTD=1 -DXML_NS=1
-DTDOM_NO_UNKNOWN_CMD=1 -DUSE_NORMAL_ALLOCATOR=1
-DWORDS_BIGENDIAN=1 -DBYTEORDER=4321 -I../generic -I../expat -I"/usr/local/
include" -I/usr/local/src/aolserver-3.3+ad13/aolserver/include -O -fPIC -O
-fPIC
-c `echo ../generic/xmlsimple.c` -o xmlsimple.o
In file included from ../generic/xmlsimple.c:69:
../generic/dom.h:487: error: parse error before "Tcl_Obj"
../generic/dom.h:487: warning: no semicolon at end of struct or union
../generic/dom.h:495: error: parse error before '}' token

etc, etc

I looked at dom.h and it looked ok to me. Which makes sense, since if there was a real error it wouldn't build for anyone and would have been reported long before now.  I've seen similar errors posted for previous versions, always on Solaris, so apparently there is something extra-picky about this build environment.  In the past Rolf has fixed these errors, so this must be a new one.

I've posted this to the tDOM yahoo group, but no response yet.  Slackers, taking weekends off! :)

Collapse
Posted by Janine Ohmer on
Still no response on the tDOM group.  I tried an experiment of moving the files to a Solaris 8 system and they build just fine there.  So what does this indicate, a problem with gcc 3.3.2?
Collapse
Posted by Janine Ohmer on
Got a reply from Zoran - he says he's had this sort of trouble compiling most things on Solaris 9, but that it seems to work fine to compile on an earlier version and move the finished result over.  I did this with tDOM and so far it seems to be working fine.