3 rrdbuild - Instructions for building RRDtool
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.
20 Before you start to build RRDtool, you have to decide two things:
26 In which directory you want to build the software.
30 Where you want to install the software.
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.11
42 set BUILD_DIR=/tmp/rrdbuild
43 set INSTALL_DIR=/usr/local/rrdtool-1.2.11
45 Now make sure the BUILD_DIR exists and go there:
50 Lets first assume you already have all the necessary libraries
51 per-installed. Note that these instructions assume that your copies of
52 B<tar> and B<make> are actually B<GNU tar> and B<GNU make> respectively. It
53 could be that they are installed as B<gtar> and B<gmake> on your system.
55 wget http://people.ee.ethz.ch/oetiker/webtools/rrdtool/pub/rrdtool-1.2.11.tar.gz
56 tar zxf rrdtool-1.2.11.tar.gz
58 ./configure --prefix=$INSTALL_DIR && make && make install
60 Ok, this was very optimistic. This try will probably have ended with
61 B<configure> complaining about several missing libraries. If you are on a
62 Linux or *bsd system you may want to just install the missing bits from your
63 software repository. When you do that, make sure you also get the B<-dev>
64 package for each library you install. Once you have the missing bits on
65 board, just re-run the last line of the instructions above.
67 But again this may have been too optimistic, and you actually have to
68 compile your own copies of the required libraries. Here is how:
75 wget http://people.ee.ethz.ch/oetiker/webtools/rrdtool/pub/libs/cgilib-0.5.tar.gz
76 tar zxf cgilib-0.5.tar.gz
79 If you are on Mac OSX you want to fix a little header problem here by doing
83 and now you are ready to build
85 make CC=gcc CFLAGS="-O3 -fPIC -I."
86 mkdir -p $BUILD_DIR/lb/include
87 cp *.h $BUILD_DIR/lb/include
88 mkdir -p $BUILD_DIR/lb/lib
89 cp libcgi* $BUILD_DIR/lb/lib
94 wget http://people.ee.ethz.ch/oetiker/webtools/rrdtool/pub/libs/zlib-1.2.2.tar.gz
95 tar zxf zlib-1.2.2.tar.gz
97 env CFLAGS="-O3 -fPIC" ./configure --prefix=$BUILD_DIR/lb
101 =item Building libpng
103 Libpng itself requires zlib to build, so we need to help a bit. If you
104 already have a copy of zlib on your system (which is very likley) you can
105 drop the settings of LDFLAGS and CPPFLAGS. Note that the backslash (\) at
106 the end of line 4 means that line 4 and line 5 are on one line.
109 wget http://people.ee.ethz.ch/oetiker/webtools/rrdtool/pub/libs/libpng-1.2.8-config.tar.gz
110 tar zxvf libpng-1.2.8-config.tar.gz
111 cd libpng-1.2.8-config
112 env CPPFLAGS="-I$BUILD_DIR/lb/include" LDFLAGS="-L$BUILD_DIR/lb/lib" CFLAGS="-O3 -fPIC" \
113 ./configure --disable-shared --prefix=$BUILD_DIR/lb
117 =item Building freetype
120 wget http://people.ee.ethz.ch/oetiker/webtools/rrdtool/pub/libs/freetype-2.1.9.tar.gz
121 tar zxvf freetype-2.1.9.tar.gz
123 env CPPFLAGS="-I$BUILD_DIR/lb/include" LDFLAGS="-L$BUILD_DIR/lb/lib" CFLAGS="-O3 -fPIC" \
124 ./configure --disable-shared --prefix=$BUILD_DIR/lb
128 If you run into problems building freetype on Solaris, you may want to try to
129 add the following at the end of the configure line:
131 GNUMAKE=gmake EGREP=egrep
133 =item Building libart_lgpl
136 wget http://people.ee.ethz.ch/oetiker/webtools/rrdtool/pub/libs/libart_lgpl-2.3.17.tar.gz
137 tar zxvf libart_lgpl-2.3.17.tar.gz
138 cd libart_lgpl-2.3.17
139 env CFLAGS="-O3 -fPIC" ./configure --disable-shared --prefix=$BUILD_DIR/lb
145 Now all the dependent libraries are built and you can try again. Since these
146 are static libraries, you may have to use F<ranlib> to make them accessible.
147 Especially BSD systems like Mac OS X may require this, Linux and Solaris
148 will do just fine without since their F<ar> command does ranlibs job as well.
150 ranlib $BUILD_DIR/lb/lib/*.a
152 This time you tell configure where it should be looking for libraries and
153 include files. This is done via environment variables. Depending on the
154 shell you are running, the syntax for setting environment variables is
155 different. Under csh/tcsh you use:
157 set IR=-I$BUILD_DIR/lb/include
158 setenv CPPFLAGS "$IR $IR/libart-2.0 $IR/freetype2 $IR/libpng"
159 setenv LDFLAGS -L$BUILD_DIR/lb/lib
162 If you are running bash/sh/ash/ksh/zsh use this:
164 IR=-I$BUILD_DIR/lb/include
165 CPPFLAGS="$IR $IR/libart-2.0 $IR/freetype2 $IR/libpng"
166 LDFLAGS="-L$BUILD_DIR/lb/lib"
168 export CPPFLAGS LDFLAGS CFLAGS
170 And finally try building again. We disable the python and tcl bindings
171 because it seems that a fair number of people have ill configured python and
172 tcl setups that would prevent rrdtool from building if they are included in
175 cd $BUILD_DIR/rrdtool-1.2.11
176 ./configure --prefix=$INSTALL_DIR --disable-python --disable-tcl
181 Now go to I<$INSTALL_DIR>B</examples> and run them to see if your
182 build has been successful.
186 Tobias Oetiker E<lt>oetiker@ee.ethz.chE<gt>