Code

prepare for the release of rrdtool-1.2.30
[rrdtool.git] / doc / rrdbuild.pod
1 =head1 NAME
3 rrdbuild - Instructions for building RRDtool
5 =head1 DESCRIPTION
7 =head2 Overview
9 If you downloaded the source of rrdtool you have to compile it. This
10 document will give some information on how this is done.
12 RRDtool relies on services of thrid part libraries. Some of these libraries
13 may already be installed on your system. You have to compile copies of the other
14 ones before you can build RRDtool.
16 This document will tell you about all the necessary steps to get going.
18 =head2 Building
20 Before you start to build RRDtool, you have to decide two things:
22 =over
24 =item 1.
26 In which directory you want to build the software.
28 =item 2.
30 Where you want to install the software.
32 =back
34 Once you have decided. Save the two locations into environment variables.
35 Depending on the shell you are using, you can do either (bash,zsh):
37  BUILD_DIR=/tmp/rrdbuild
38  INSTALL_DIR=/usr/local/rrdtool-1.2.30
40 Or if you run tcsh:
42  set BUILD_DIR=/tmp/rrdbuild
43  set INSTALL_DIR=/usr/local/rrdtool-1.2.30
45 If your F</tmp> is mounted with the option noexec (RHEL seems todo that) you have to choose
46 a different directory!
48 Now make sure the BUILD_DIR exists and go there:
50  mkdir -p $BUILD_DIR
51  cd $BUILD_DIR
53 Lets first assume you already have all the necessary libraries
54 pre-installed. Note that these instructions assume that your copies of
55 B<tar> and B<make> are actually B<GNU tar> and B<GNU make> respectively. It
56 could be that they are installed as B<gtar> and B<gmake> on your system.
58  wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.2.30.tar.gz
59  tar zxf rrdtool-1.2.30.tar.gz
60  cd rrdtool-1.2.30
61  ./configure --prefix=$INSTALL_DIR && make && make install
63 Ok, this was very optimistic. This try will probably have ended with
64 B<configure> complaining about several missing libraries. If you are on a
65 Linux or *bsd system you may want to just install the missing bits from your
66 software repository. When you do that, make sure you also get the B<-dev>
67 package for each library you install. Once you have the missing bits on
68 board, just re-run the last line of the instructions above.
70 But again this may have been too optimistic, and you actually have to
71 compile your own copies of the required libraries.
73 =head3 Build Tipps for AIX
75 If you are woking with AIX, you may find the the B<--disable-shared> option
76 will cause things to break for you. In that case you may have to install the
77 shared libraries into the rrdtool PREFIX and work with B<--disable-static>
78 instead.
80 Another hint to get rrdtool working on AIX is to use the IBM XL C Compiler:
82  export CC=/usr/vac/bin/cc
83  export PERLCC=$CC
85 (Better instructions for AIX welcome!)
87 =head2 Building Libraries
89 In order to build the libraries you need a compiler on your system.
90 Unfortunately compilers are not all alike. This has an effect on the CFLAGS
91 you want to set. The examples below are for the popular GCC compiler suite.
92 If you have an other compile you have to use the following settings:
94 =over
96 =item Sun Forte on SPARC
98  CFLAGS="-xO3 -xcode=pic13"
100 =item Sun Forte on x86
102  CFLAGS="-xO3 -Kpic"
104 =back
106 =over 
108 =item Building zlib
110  cd $BUILD_DIR
111  wget http://oss.oetiker.ch/rrdtool/pub/libs/zlib-1.2.3.tar.gz
112  tar  zxf zlib-1.2.3.tar.gz
113  cd zlib-1.2.3
114  env CFLAGS="-O3 -fPIC" ./configure --prefix=$BUILD_DIR/lb
115  make
116  make install
118 =item Building libpng
120 Libpng itself requires zlib to build, so we need to help a bit. If you
121 already have a copy of zlib on your system (which is very likley) you can
122 drop the settings of LDFLAGS and CPPFLAGS. Note that the backslash (\) at
123 the end of line 4 means that line 4 and line 5 are on one line.
125  cd $BUILD_DIR
126  wget http://oss.oetiker.ch/rrdtool/pub/libs/libpng-1.2.10.tar.gz
127  tar zxvf libpng-1.2.10.tar.gz
128  cd libpng-1.2.10
129  env CPPFLAGS="-I$BUILD_DIR/lb/include" LDFLAGS="-L$BUILD_DIR/lb/lib" CFLAGS="-O3 -fPIC" \
130      ./configure --disable-shared --prefix=$BUILD_DIR/lb
131  make
132  make install
134 =item Building freetype
136  cd $BUILD_DIR
137  wget http://oss.oetiker.ch/rrdtool/pub/libs/freetype-2.1.10.tar.bz2
138  tar jxvf freetype-2.1.10.tar.bz2
139  cd freetype-2.1.10
140  env CPPFLAGS="-I$BUILD_DIR/lb/include" LDFLAGS="-L$BUILD_DIR/lb/lib" CFLAGS="-O3 -fPIC" \
141      ./configure --disable-shared --prefix=$BUILD_DIR/lb
142  make
143  make install
145 If you run into problems building freetype on Solaris, you may want to try to
146 add the following at the end of the configure line:
148  GNUMAKE=gmake EGREP=egrep
150 =item Building libart_lgpl
152  cd $BUILD_DIR
153  wget http://oss.oetiker.ch/rrdtool/pub/libs/libart_lgpl-2.3.17.tar.gz
154  tar zxvf libart_lgpl-2.3.17.tar.gz
155  cd libart_lgpl-2.3.17
156  env CFLAGS="-O3 -fPIC" ./configure --disable-shared --prefix=$BUILD_DIR/lb
157  make
158  make install
160 =back
162 Now all the dependent libraries are built and you can try again. Since these
163 are static libraries, you may have to use F<ranlib> to make them accessible.
164 Especially BSD systems like Mac OS X may require this, Linux and Solaris
165 will do just fine without since their F<ar> command does ranlibs job as well.
167  ranlib $BUILD_DIR/lb/lib/*.a
169 This time you tell configure where it should be looking for libraries and
170 include files. This is done via environment variables. Depending on the
171 shell you are running, the syntax for setting environment variables is
172 different. Under csh/tcsh you use:
174  set IR=-I$BUILD_DIR/lb/include
175  setenv CPPFLAGS "$IR $IR/libart-2.0 $IR/freetype2 $IR/libpng"
176  setenv LDFLAGS  -L$BUILD_DIR/lb/lib
177  setenv CFLAGS -O3
179 If you are running bash/sh/ash/ksh/zsh use this:
181  IR=-I$BUILD_DIR/lb/include
182  CPPFLAGS="$IR $IR/libart-2.0 $IR/freetype2 $IR/libpng"
183  LDFLAGS="-L$BUILD_DIR/lb/lib"
184  CFLAGS=-O3
185  export CPPFLAGS LDFLAGS CFLAGS
187 And finally try building again. We disable the python and tcl bindings
188 because it seems that a fair number of people have ill configured python and
189 tcl setups that would prevent rrdtool from building if they are included in
190 their current state.
192  cd $BUILD_DIR/rrdtool-1.2.30
193  ./configure --prefix=$INSTALL_DIR --disable-python --disable-tcl
194  make clean
195  make
196  make install
198 SOLARIS HINT: if you want to build  the perl module for the native perl (the
199 one shipping with solaris) you will need the sun forte compiler
200 installed on your box or you have to hand-tune bindings/perl-shared/Makefile
201 while building!
203 Now go to I<$INSTALL_DIR>B</share/rrdtool/examples/> and run them to see if your
204 build has been successful.
206 =head1 AUTHOR
208 Tobias Oetiker E<lt>tobi@oetiker.chE<gt>