Professional Documents
Culture Documents
System:
Red Hat Enterprise Linux ES release 4 (Nahant Update 4)
Dual-Core AMD Opteron(tm) Processor 2210 HE
3 GB memory
Software :
aolserver-4.0.10-src.tar.gz or aolserver-4.5.0-src.tar.gz
Google perftools 0.8
tcl8.4.14-src.tar.gz
Installation :
# mkdir ~/software
# cd ~/software
# wget http://google-perftools.googlecode.com/files/google-perftools-0.8.tar.gz
# tar xzf .tar.gz
# cd google-perftools-0.8
# ./configure --prefix/home/atif/googlelib
# make
it gave an error
after that
# make clean
# make
# mkdir /home/atif/googlelib
# make install
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/atif/googlelib/lib
# ldconfig
TCL installation:
# mkdir ~/tcl
# cd ~/software
# wget http://surfnet.dl.sourceforge.net/sourceforge/tcl/
# tar xzf tcl8.4.14-src.tar.gz
# cd tcl8.4.14/unix
# ./configure --prefix=/home/atif/tcl --enable-threads
export the tcl library location in your LD_LIBRARY_PATH put this line in bash_profile if
using bash.
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/atif/tcl/lib
We want tcl to use google tcmalloc() for thread allocation so we will enable thread support
but disable thread allocation from tcl. create a simple bash script named disablealloc.sh
cd ./unix && \
cat Makefile | sed -e 's/-DUSE_THREAD_ALLOC=1//' > Makefile.new && \
cat tclConfig.sh | sed -e 's/-DUSE_THREAD_ALLOC=1//' > tclConfig.sh.new&& \
cp Makefile.new Makefile && \
cp tclConfig.sh.new tclConfig.sh
All this does is to change two files and removes -DUSE_THREAD_ALLOC=1 from each
file . Save this script in ~/tcl
#cd /home/atif/tcl
# sh disablealloc.sh
after that
# make
# make install
Aolserver installation :
Aolserver 4.0.10:
# mkdir ~/aol40
# cd ~/software/
# wget http://ovh.dl.sourceforge.net/sourceforge/aolserver/aolserver-4.0.10-src.tar.gz
# tar xzf aolserver-4.0.10-src.tar.gz
# cd aolserver-4.0.10
-- if you are compiling on redhat enterprise 3 on a 64 bit platform like amd opteron change
the nsd/tclobj.c and comment out following lines , line 88
(On redhat enterprise 4 this is not needed)
after that :
Aolserver 4.5.0 :
# mkdir ~/aol45
# cd ~/software/
# wget http://ovh.dl.sourceforge.net/sourceforge/aolserver/aolserver-4.5.0-src.tar.gz
# tar xzf aolserver-4.5.0-src.tar.gz
# cd aolserver-4.5.0
# ./configure --prefix=/home/atif/aol45 --with-tcl=/home/atif/tcl/lib --enable-threads --
enable-64bit
# /home/atif/tcl/bin/tclsh8.4 ./nsconfig.tcl -install /home/atif/aol45
# make
It should work fine on almost all platforms except redhat enterprise 3 update 4 with 64 bit
linxu x86_64
If you get this error on make
Index: include/nsattributes.h
===================================================================
RCS file: /cvsroot/aolserver/aolserver/include/nsattributes.h,v
retrieving revision 1.3
diff -u -r1.3 nsattributes.h
--- include/nsattributes.h 25 Aug 2005 15:46:11 -0000 1.3
+++ include/nsattributes.h 27 Jul 2006 11:48:59 -0000
@@ -38,8 +38,6 @@
#ifndef NSATTRS_H
#define NSATTRS_H
-#ifndef __GNUC__
-
# define _nsmalloc
# define _nspure
# define _nsconst
@@ -56,8 +54,6 @@
# define _nswarnunused
# define _nsmayalias
-#else
-
#ifdef __GNUC_MINOR__
#ifdef __GNUC_PREREQ
#undef __GNUC_PREREQ
@@ -120,8 +116,6 @@
#endif /* __GNUC__PREREQ */
-#endif /* __GNUC__ */
-
#define NS_RCSID(string) static const char *RCSID _nsunused = string \
", compiled: " __DATE__ " " __TIME__
save above text as a file called nsattribute.h.patch and put it on the root of aolserver
source and run this command
after that
# make clean
# make
# make install
Start Alserver :
To start aolserver in a way that tcl uses tcmalloc() start it like this
cd /home/atif/aol40
LD_PRELOAD=/home/atif/googlelib/lib/libtcmalloc.so ./bin/nsd -t sampleconfig.tcl
cd /home/atif/aol45
LD_PRELOAD=/home/atif/googlelib/lib/libtcmalloc.so ./bin/nsd -t sampleconfig.tcl