Forum OpenACS Q&A: compiling problem with aolserver 4.0 on debian sarge.

Hi, I'm having problems following the install instructions on Debian Testing (aka Sarge). I cannot get Aolserver 4.0 to run on this system. I've followed the installation documentation and keep on getting errors. Tcl 8.4 was installed via apt-get install tcl8.4 so it is located in /usr/lib/tcl8.4. so, download aolserver4_r2 from CVS and i get errors:


root@dev:/usr/local/src/aolserver/aolserver# ./configure --with-tcl=/usr/lib/tcl8.4
creating cache ./config.cache
checking for Tcl configuration... found /usr/lib/tcl8.4/tclConfig.sh
checking for existence of /usr/lib/tcl8.4/tclConfig.sh... loading
checking for build with symbols... no
checking for timegm... yes
checking for fork1... no
checking for poll... yes
checking for drand48... yes
checking for random... yes
checking for _NSGetEnviron... no
checking how to run the C preprocessor... cc -E
checking for mach-o/dyld.h... no
checking for dl.h... no
checking need for dup high... no
checking msg_controllen in struct msghdr... yes
checking how to build server image... shared
updating cache ./config.cache
creating ./config.status
creating include/Makefile.global
creating include/Makefile.module
root@dev:/usr/local/src/aolserver/aolserver# make install
make[1]: Entering directory `/usr/local/src/aolserver/aolserver/nsthread'


  . . . . . more output that isn't necessary . . . . 


gcc -pipe -O -D__NO_STRING_INLINES -D__NO_MATH_INLINES -Wall -Wconversion -Wno-implicit-int -fPIC  -I../include -I/usr/include/tcl8.4 -DNO_CONST  -DHAVE_UNISTD_H=1 -DHAVE_LIMITS_H=1 -DTCL_THREADS=1 -DUSE_THREAD_ALLOC=1 -D_REENTRANT=1 -D_THREAD_SAFE=1 -DHAVE_PTHREAD_ATTR_SETSTACKSIZE=1 -DHAVE_READDIR_R=1 -D_LARGEFILE64_SOURCE=1 -DTCL_WIDE_INT_TYPE=long\ long -DHAVE_STRUCT_STAT64=1 -DHAVE_TYPE_OFF64_T=1 -DHAVE_GETCWD=1 -DHAVE_OPENDIR=1 -DHAVE_STRSTR=1 -DHAVE_STRTOL=1 -DHAVE_STRTOLL=1 -DHAVE_STRTOULL=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_TM_ZONE=1 -DHAVE_GMTIME_R=1 -DHAVE_LOCALTIME_R=1 -DHAVE_TM_GMTOFF=1 -DHAVE_TIMEZONE_VAR=1 -DHAVE_ST_BLKSIZE=1 -DSTDC_HEADERS=1 -DHAVE_SIGNED_CHAR=1 -DHAVE_LANGINFO=1 -DPEEK_XCLOSEIM=1 -DHAVE_SYS_IOCTL_H=1   -DHAVE_TIMEGM=1 -DHAVE_POLL=1 -DHAVE_DRAND48=1 -DHAVE_RANDOM=1 -DHAVE_CMMSG=1  -DNsthreadsInit=_init   -c -o pthread.o pthread.c
/bin/rm -f libnsthread.so
gcc -pipe -shared -nostartfiles -L../nsthread -L../nsd -o libnsthread.so error.o master.o memory.o mutex.o cslock.o rwlock.o reentrant.o sema.o thread.o tls.o signal.o compat.o time.o fork.o pthread.o  -L/usr/lib -ltcl8.4 -ldl  -lpthread -lieee -lm /usr/local/aolserver/lib /usr/lib
gcc: /usr/local/aolserver/lib: No such file or directory
make[1]: *** [libnsthread.so] Error 1
make[1]: Leaving directory `/usr/local/src/aolserver/aolserver/nsthread'
make: *** [all] Error 1

So, I did a search on google and came up with this result. In which they tell me to edit include/Makefile.global (after doing the config), and change:

CCRFLAG         =
LDRFLAG         =
CCRPATH         += $(CCRFLAG)$(INSTLIB) $(CCRFLAG)$(TCL_EXEC_PREFIX)/lib
LDRPATH         += $(LDRFLAG)$(INSTLIB) $(LDRFLAG)$(TCL_EXEC_PREFIX)/lib
CC              = $(PURIFY) gcc -pipe
CFLAGS_DEBUG    = -g

to

CCRFLAG         =
LDRFLAG         =
CCRPATH         += $(CCRFLAG)$(INSTLIB) $(CCRFLAG)$(TCL_EXEC_PREFIX)/lib
LDRPATH         += $(LDRFLAG)$(INSTLIB) $(LDRFLAG)$(TCL_EXEC_PREFIX)/lib
CC              = $(PURIFY) gcc -pipe
CFLAGS_DEBUG    = -g

If i do this it compiles fine without error, but when i go to /usr/local/aolserver and run the sample config this is what i get:

root@dev:/usr/local/aolserver# cd /usr/local/aolserver; ls -l
total 44
drwxr-sr-x    2 root     staff        4096 Feb  5 17:02 bin
drwxr-sr-x    2 root     staff        4096 Feb  5 17:02 include
drwxr-sr-x    2 root     staff        4096 Feb  5 17:02 lib
drwxrwsr-x    2 root     web          4096 Feb  5 17:02 log
drwxr-sr-x    5 root     staff        4096 Feb  5 17:02 man
drwxr-sr-x    3 root     staff        4096 Feb  5 17:02 modules
-rw-r--r--    1 root     staff       14805 Feb  5 17:02 sample-config.tcl
drwxrwsr-x    3 root     web          4096 Feb  5 17:02 servers
root@dev:/usr/local/aolserver# ./bin/nsd -t sample-config.tcl -u nobody -g -web
./bin/nsd: error while loading shared libraries: libnsd.so: cannot open shared object file: No such file or directory

I'm kind of stuck, does anybody have any suggestions? Or do you need me to provide more info?

Thanks for the help.

that second Makefile.global entry should have been:
CCRFLAG         =
LDRFLAG         =
CCRPATH         +=
LDRPATH         +=
CC              = $(PURIFY) gcc -pipe
CFLAGS_DEBUG    = -g
Collapse
Posted by Jade Rubick on
I think you might be able to fix this with symlinks.

ln -s ...

Collapse
Posted by Vinod Kurup on
nsd can't find libnsd.so (a new shared library in aolserver 4). You need to add /usr/local/aolserver/lib to your LD_LIBRARY_PATH.
root@dev:/usr/local/aolserver# export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/aolserver/lib
root@dev:/usr/local/aolserver# ./bin/nsd -t sample-config.tcl -u nobody -g -web
Is the current Debian Testing Tcl 8.4.x compiled with --enable-threads (aka, thread-safe)? You must use a Tcl compiled with --enable-threads, which for reasons unknown to me, is not usually the default.

Also, you should probably make sure you are using the most recent Tcl 8.4.x release. As of early January, Tcl 8.4.4+ had some memory leaks, mostly with the file-related commands (file, glob, etc.), but Zoran Vasiljevic just reported today on the AOLserver list that the Tcl core-8-4-branch CVS branch now has those fixed. Based on its release date, my guess is those were not yet fixed in Tcl 8.4.5, but then since AFAIK they're "just" memory leaks they shouldn't cause nearly as much trouble as using a non-thread-safe Tcl.

Collapse
Posted by Kevin Esteb on
According to the changelog on the debian site, yes it was compiled to be thread safe specifically for AOLserver.