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 These instructions assume you are using a bash shell. If you use csh/tcsh,
19 then you can either type 'bash' to switch to bash for the compilation or if
20 you know what you are doing just replace replace the export bits with
21 setenv.
23 We further assume that your copies of B<tar> and B<make> are actually B<GNU
24 tar> and B<GNU make> respectively. It could be that they are installed as
25 B<gtar> and B<gmake> on your system.
27 =head2 Building
29 Before you start to build RRDtool, you have to decide two things:
31 =over
33 =item 1.
35 In which directory you want to build the software.
37 =item 2.
39 Where you want to install the software.
41 =back
43 Once you have decided. Save the two locations into environment variables.
44 Depending on the shell you are using, you can do either (bash,zsh):
46 BUILD_DIR=/tmp/rrdbuild
47 INSTALL_DIR=/usr/local/rrdtool-1.2.99907080300
49 Or if you run tcsh:
51 set BUILD_DIR=/tmp/rrdbuild
52 set INSTALL_DIR=/usr/local/rrdtool-1.2.99907080300
54 If your F</tmp> is mounted with the option noexec (RHEL seems todo that) you have to choose
55 a different directory!
57 Now make sure the BUILD_DIR exists and go there:
59 mkdir -p $BUILD_DIR
60 cd $BUILD_DIR
62 Lets first assume you already have all the necessary libraries
63 pre-installed.
64 wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.2.99907080300.tar.gz
65 gunzip -c rrdtool-1.2.99907080300.tar.gz | tar xf -
66 cd rrdtool-1.2.99907080300
67 ./configure --prefix=$INSTALL_DIR && make && make install
69 Ok, this was very optimistic. This try will probably have ended with
70 B<configure> complaining about several missing libraries. If you are on a
71 Linux or *bsd system you may want to just install the missing bits from your
72 software repository. When you do that, make sure you also get the B<-dev>
73 package for each library you install. Once you have the missing bits on
74 board, just re-run the last line of the instructions above.
76 But again this may have been too optimistic, and you actually have to
77 compile your own copies of the required libraries.
79 =head3 Build Tipps for AIX
81 If you are woking with AIX, you may find the the B<--disable-shared> option
82 will cause things to break for you. In that case you may have to install the
83 shared libraries into the rrdtool PREFIX and work with B<--disable-static>
84 instead.
86 Another hint to get rrdtool working on AIX is to use the IBM XL C Compiler:
88 export CC=/usr/vac/bin/cc
89 export PERLCC=$CC
91 (Better instructions for AIX welcome!)
93 =head2 Building Libraries
95 In order to build the libraries you need a compiler on your system.
96 Unfortunately compilers are not all alike. This has an effect on the CFLAGS
97 you want to set. The examples below are for the popular GCC compiler suite.
98 If you have an other compile you have to use the following settings:
100 =over
102 =item Sun Forte
104 CFLAGS="-xO3 -kPIC"
106 =back
108 =over
110 Some libraries want to know where other libraries are. For this to work,
111 set the following environamen variable
113 export PKG_CONFIG_PATH=${INSTALL_DIR}/lib/pkgconfig
114 export PATH=$INSTALL_DIR/bin:$PATH
116 If you have GNUmake installed and it is not called 'make',
117 then do
119 export MAKE=gmake
120 export GNUMAKE=gmake
122 otherwhise just do
124 export MAKE=make
127 =item Building zlib
129 Chances are very high that you already have that on your system ...
131 cd $BUILD_DIR
132 wget http://oss.oetiker.ch/rrdtool/pub/libs/zlib-1.2.3.tar.gz
133 gunzip -c zlib-1.2.3.tar.gz | tar xf -
134 cd zlib-1.2.3
135 ./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC"
136 $MAKE
137 $MAKE install
139 =item Building libpng
141 Libpng itself requires zlib to build, so we need to help a bit. If you
142 already have a copy of zlib on your system (which is very likley) you can
143 drop the settings of LDFLAGS and CPPFLAGS. Note that the backslash (\) at
144 the end of line 4 means that line 4 and line 5 are on one line.
146 cd $BUILD_DIR
147 wget http://oss.oetiker.ch/rrdtool/pub/libs/libpng-1.2.18.tar.gz
148 gunzip -c libpng-1.2.18.tar.gz | tar xf -
149 cd libpng-1.2.10
150 env CFLAGS="-O3 -fPIC" ./configure --prefix=$INSTALL_DIR
151 $MAKE
152 $MAKE install
154 =item Building freetype
156 cd $BUILD_DIR
157 wget http://oss.oetiker.ch/rrdtool/pub/libs/freetype-2.3.5.tar.gz
158 gunzip -c freetype-2.3.5.tar.gz | tar xf -
159 cd freetype-2.3.5
160 ./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC"
161 $MAKE (or gmake)
162 $MAKE install (or gmake install)
164 If you run into problems building freetype on Solaris, you may want to try to
165 add the following at the start the configure line:
167 env GNUMAKE=gmake EGREP=egrep
169 =item Building fontconfig
171 Note that fontconfig has a runtime configuration file in INSTALL_DIR/etc you
172 may want to adjust that so that fontconfig finds the fonts on your system.
173 Run the fc-cache program to build the fontconfig cache after changeing the
174 config file.
176 cd $BUILD_DIR
177 wget http://oss.oetiker.ch/rrdtool/pub/libs/fontconfig-2.4.2.tar.gz
178 gunzip -c fontconfig-2.4.2.tar.gz | tar xf -
179 cd fontconfig-2.4.2
180 ./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC"
181 $MAKE
182 $MAKE install
184 =item Building Cairo
186 cd $BUILD_DIR
187 wget http://oss.oetiker.ch/rrdtool/pub/libs/cairo-1.4.10.tar.gz
188 gunzip -c cairo-1.4.10.tar.gz | tar xf -
189 cd cairo-1.4.10
190 ./configure --prefix=$INSTALL_DIR \
191 --enable-xlib=no \
192 --enable-xlib-render=no \
193 --enable-win32=no \
194 CFLAGS="-O3 -fPIC"
195 $MAKE
196 $MAKE install
198 =item Building Glib
200 cd $BUILD_DIR
201 wget http://oss.oetiker.ch/rrdtool/pub/libs/glib-2.12.13.tar.gz
202 gunzip -c glib-2.12.13.tar.gz | tar xf -
203 cd glib-2.12.13
204 ./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC"
205 $MAKE
206 $MAKE install
208 =item Building Pango
210 cd $BUILD_DIR
211 wget http://oss.oetiker.ch/rrdtool/pub/libs/pango-1.17.5.tar.gz
212 gunzip -c pango-1.17.5.tar.gz | tar xf -
213 cd pango-1.17.5
214 ./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC"
215 $MAKE
216 $MAKE install
218 =back
220 Now all the dependent libraries are built and you can try again. This time
221 you tell configure where it should be looking for libraries and include
222 files. This is done via environment variables. Depending on the shell you
223 are running, the syntax for setting environment variables is different.
225 CPPFLAGS=-I$INSTALL_DIR/include
226 LDFLAGS="-R$INSTALL_DIR/lib -L$INSTALL_DIR/lib"
227 CFLAGS=-O3
228 export CPPFLAGS LDFLAGS CFLAGS
230 And finally try building again. We disable the python and tcl bindings
231 because it seems that a fair number of people have ill configured python and
232 tcl setups that would prevent rrdtool from building if they are included in
233 their current state.
235 cd $BUILD_DIR/rrdtool-1.2.99907080300
236 ./configure --prefix=$INSTALL_DIR --disable-tcl --disable-python
237 $MAKE clean
238 $MAKE
239 $MAKE install
241 SOLARIS HINT: if you want to build the perl module for the native perl (the
242 one shipping with solaris) you will need the sun forte compiler installed on
243 your box or you have to hand-tune bindings/perl-shared/Makefile while
244 building!
246 Now go to I<$INSTALL_DIR>B</share/rrdtool/examples/> and run them to see if
247 your build has been successful.
249 =head1 AUTHOR
251 Tobias Oetiker E<lt>tobi@oetiker.chE<gt>