1RRDBUILD(1) rrdtool RRDBUILD(1)
2
3
4
6 rrdbuild - Instructions for building RRDtool
7
9 Overview
10
11 If you downloaded the source of rrdtool you have to compile it. This
12 document will give some information on how this is done.
13
14 RRDtool relies on services of thrid part libraries. Some of these
15 libraries may already be installed on your system. You have to compile
16 copies of the other ones before you can build RRDtool.
17
18 This document will tell you about all the necessary steps to get going.
19
20 Building
21
22 Before you start to build RRDtool, you have to decide two things:
23
24 1. In which directory you want to build the software.
25
26 2. Where you want to install the software.
27
28 Once you have decided. Save the two locations into environment vari‐
29 ables. Depending on the shell you are using, you can do either
30 (bash,zsh):
31
32 BUILD_DIR=/tmp/rrdbuild
33 INSTALL_DIR=/usr/local/rrdtool-1.2.27
34
35 Or if you run tcsh:
36
37 set BUILD_DIR=/tmp/rrdbuild
38 set INSTALL_DIR=/usr/local/rrdtool-1.2.27
39
40 If your /tmp is mounted with the option noexec (RHEL seems todo that)
41 you have to choose a different directory!
42
43 Now make sure the BUILD_DIR exists and go there:
44
45 mkdir -p $BUILD_DIR
46 cd $BUILD_DIR
47
48 Lets first assume you already have all the necessary libraries
49 pre-installed. Note that these instructions assume that your copies of
50 tar and make are actually GNU tar and GNU make respectively. It could
51 be that they are installed as gtar and gmake on your system.
52
53 wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.2.27.tar.gz
54 tar zxf rrdtool-1.2.27.tar.gz
55 cd rrdtool-1.2.27
56 ./configure --prefix=$INSTALL_DIR && make && make install
57
58 Ok, this was very optimistic. This try will probably have ended with
59 configure complaining about several missing libraries. If you are on a
60 Linux or *bsd system you may want to just install the missing bits from
61 your software repository. When you do that, make sure you also get the
62 -dev package for each library you install. Once you have the missing
63 bits on board, just re-run the last line of the instructions above.
64
65 But again this may have been too optimistic, and you actually have to
66 compile your own copies of the required libraries.
67
68 Build Tipps for AIX
69
70 If you are woking with AIX, you may find the the --disable-shared
71 option will cause things to break for you. In that case you may have to
72 install the shared libraries into the rrdtool PREFIX and work with
73 --disable-static instead.
74
75 Another hint to get rrdtool working on AIX is to use the IBM XL C Com‐
76 piler:
77
78 export CC=/usr/vac/bin/cc
79 export PERLCC=$CC
80
81 (Better instructions for AIX welcome!)
82
83 Building Libraries
84
85 In order to build the libraries you need a compiler on your system.
86 Unfortunately compilers are not all alike. This has an effect on the
87 CFLAGS you want to set. The examples below are for the popular GCC com‐
88 piler suite. If you have an other compile you have to use the follow‐
89 ing settings:
90
91 Sun Forte
92 CFLAGS="-xO3 -kPIC"
93
94 Building zlib
95 cd $BUILD_DIR
96 wget http://oss.oetiker.ch/rrdtool/pub/libs/zlib-1.2.3.tar.gz
97 tar zxf zlib-1.2.3.tar.gz
98 cd zlib-1.2.3
99 env CFLAGS="-O3 -fPIC" ./configure --prefix=$BUILD_DIR/lb
100 make
101 make install
102
103 Building libpng
104 Libpng itself requires zlib to build, so we need to help a bit. If
105 you already have a copy of zlib on your system (which is very lik‐
106 ley) you can drop the settings of LDFLAGS and CPPFLAGS. Note that
107 the backslash (\) at the end of line 4 means that line 4 and line 5
108 are on one line.
109
110 cd $BUILD_DIR
111 wget http://oss.oetiker.ch/rrdtool/pub/libs/libpng-1.2.10.tar.gz
112 tar zxvf libpng-1.2.10.tar.gz
113 cd libpng-1.2.10
114 env CPPFLAGS="-I$BUILD_DIR/lb/include" LDFLAGS="-L$BUILD_DIR/lb/lib" CFLAGS="-O3 -fPIC" \
115 ./configure --disable-shared --prefix=$BUILD_DIR/lb
116 make
117 make install
118
119 Building freetype
120 cd $BUILD_DIR
121 wget http://oss.oetiker.ch/rrdtool/pub/libs/freetype-2.1.10.tar.bz2
122 tar jxvf freetype-2.1.10.tar.bz2
123 cd freetype-2.1.10
124 env CPPFLAGS="-I$BUILD_DIR/lb/include" LDFLAGS="-L$BUILD_DIR/lb/lib" CFLAGS="-O3 -fPIC" \
125 ./configure --disable-shared --prefix=$BUILD_DIR/lb
126 make
127 make install
128
129 If you run into problems building freetype on Solaris, you may want
130 to try to add the following at the end of the configure line:
131
132 GNUMAKE=gmake EGREP=egrep
133
134 Building libart_lgpl
135 cd $BUILD_DIR
136 wget http://oss.oetiker.ch/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
140 make
141 make install
142
143 Now all the dependent libraries are built and you can try again. Since
144 these are static libraries, you may have to use ranlib to make them
145 accessible. Especially BSD systems like Mac OS X may require this,
146 Linux and Solaris will do just fine without since their ar command does
147 ranlibs job as well.
148
149 ranlib $BUILD_DIR/lb/lib/*.a
150
151 This time you tell configure where it should be looking for libraries
152 and include files. This is done via environment variables. Depending on
153 the shell you are running, the syntax for setting environment variables
154 is different. Under csh/tcsh you use:
155
156 set IR=-I$BUILD_DIR/lb/include
157 setenv CPPFLAGS "$IR $IR/libart-2.0 $IR/freetype2 $IR/libpng"
158 setenv LDFLAGS -L$BUILD_DIR/lb/lib
159 setenv CFLAGS -O3
160
161 If you are running bash/sh/ash/ksh/zsh use this:
162
163 IR=-I$BUILD_DIR/lb/include
164 CPPFLAGS="$IR $IR/libart-2.0 $IR/freetype2 $IR/libpng"
165 LDFLAGS="-L$BUILD_DIR/lb/lib"
166 CFLAGS=-O3
167 export CPPFLAGS LDFLAGS CFLAGS
168
169 And finally try building again. We disable the python and tcl bindings
170 because it seems that a fair number of people have ill configured
171 python and tcl setups that would prevent rrdtool from building if they
172 are included in their current state.
173
174 cd $BUILD_DIR/rrdtool-1.2.27
175 ./configure --prefix=$INSTALL_DIR --disable-python --disable-tcl
176 make clean
177 make
178 make install
179
180 SOLARIS HINT: if you want to build the perl module for the native perl
181 (the one shipping with solaris) you will need the sun forte compiler
182 installed on your box or you have to hand-tune bind‐
183 ings/perl-shared/Makefile while building!
184
185 Now go to $INSTALL_DIR/share/rrdtool/examples/ and run them to see if
186 your build has been successful.
187
189 Tobias Oetiker <tobi@oetiker.ch>
190
191
192
1931.2.27 2008-02-17 RRDBUILD(1)