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 Lets first assume you already have all the necessary libraries
21 per-installed. Note that these instructions assume that your copies of
22 B<tar> and B<make> are actually B<GNU tar> and B<GNU make> respectively. It
23 could be that they are installed as B<gtar> and B<gmake> on your system.
25 wget http://people.ee.ethz.ch/oetiker/webtools/rrdtool/pub/rrdtool-1.2.6
26 tar zxf rrdtool-1.2.6
27 cd rrdtool-1.2.6
28 ./configure --prefix=/path/to/installation && make && make install
30 Ok, this was very optimistic. This try will probably have ended with
31 B<configure> complaining about several missing libraries. If you are on a
32 Linux or *bsd system you may want to just install the missing bits from your
33 software repository. When you do that, make sure you also get the B<-dev>
34 package for each library you install. Once you have the missing bits on
35 board, just re-run the last line of the instructions above.
37 But again this may have been too optimistic, and you actually have to
38 compile your own copies of the required libraries. Here is how:
40 =over
42 =item Building cgilib
44 wget http://people.ee.ethz.ch/oetiker/webtools/rrdtool/pub/libs/cgilib-0.5.tar.gz
45 tar zxf cgilib-0.5.tar.gz
46 cd cgilib-0.5
47 make CC=gcc CFLAGS="-O3 -fPIC -I."
48 mkdir -p ../lb/include
49 cp *.h ../lb/include
50 mkdir -p ../lb/lib
51 cp libcgi* ../lb/lib
52 cd ..
54 =item Building zlib
56 wget http://people.ee.ethz.ch/oetiker/webtools/rrdtool/pub/libs/zlib-1.2.2.tar.gz
57 tar zxf zlib-1.2.2.tar.gz
58 cd zlib-1.2.2
59 env CFLAGS="-O3 -fPIC" ./configure --prefix=`pwd`/../lb
60 make
61 make install
62 cd ..
64 =item Building libpng
66 Libpng itself requires zlib to build, so we need to help a bit. If you
67 already have a copy of zlib on your system (which is very likley) you can
68 drop the settings of LDFLAGS and CPPFLAGS. Note that the backslash (\) at
69 the end of line 4 means that line 4 and line 5 are on one line.
71 wget http://people.ee.ethz.ch/oetiker/webtools/rrdtool/pub/libs/libpng-1.2.8-config.tar.gz
72 tar zxvf libpng-1.2.8-config.tar.gz
73 cd libpng-1.2.8-config
74 env CPPFLAGS="-I../lb/include" LDFLAGS="-L../lb/lib" CFLAGS="-O3 -fPIC" \
75 ./configure --disable-shared --prefix=`pwd`/../lb
76 make
77 make install
78 cd ..
80 =item Building freetype
82 wget http://people.ee.ethz.ch/oetiker/webtools/rrdtool/pub/libs/freetype-2.1.9.tar.gz
83 tar zxvf freetype-2.1.9.tar.gz
84 cd freetype-2.1.9
85 env CPPFLAGS="-I../lb/include" LDFLAGS="-L../lb/lib" CFLAGS="-O3 -fPIC" \
86 ./configure --disable-shared --prefix=`pwd`/../lb
87 make install
88 cd ..
90 =item Building libart_lgpl
92 wget http://people.ee.ethz.ch/oetiker/webtools/rrdtool/pub/libs/libart_lgpl-2.3.17.tar.gz
93 cd libart_lgpl-2.3.17
94 env CFLAGS="-O3 -fPIC" ./configure --disable-shared --prefix=`pwd`/../lb
95 make install
96 cd ..
98 =back
100 Now all the dependent libraries are built and you can try again. This time
101 you tell configure where it should be looking for libraries and include
102 files. This is done via environment variables. Depending on the shellyou are running, the syntax for setting
103 environment variables is different. Under csh/tcsh you use:
105 set IR=-I`pwd`/lb/include
106 setenv CPPFLAGS "$IR $IR/libart-2.0 $IR/freetype2 $IR/libpng"
107 setenv LDFLAGS -L`pwd`/lb/lib
108 setenv CFLAGS -O3
110 If you are running bash/sh/ash/ksh/zsh use this:
112 IR=-I`pwd`/lb/include
113 CPPFLAGS="$IR $IR/libart-2.0 $IR/freetype2 $IR/libpng"
114 LDFLAGS="-L`pwd`/lb/lib"
115 CFLAGS=-O3
116 export CPPFLAGS LDFLAGS CFLAGS
118 And finally try building again:
120 ./configure --prefix=/path/to/installation && make && make install
122 Now go to I</path/to/installation>B</examples> and run them to see if your
123 build has been successful.
125 =head1 AUTHOR
127 Tobias Oetiker E<lt>oetiker@ee.ethz.chE<gt>