1RRDBUILD(1)                         rrdtool                        RRDBUILD(1)
2
3
4

NAME

6       rrdbuild - Instructions for building RRDtool
7

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.
11
12       RRDtool relies on services of third part libraries. Some of these
13       libraries may already be installed on your system. You have to compile
14       copies of the other ones before you can build RRDtool.
15
16       This document will tell you about all the necessary steps to get going.
17
18       These instructions assume you are using a bash shell. If you use
19       csh/tcsh, then you can either type bash to switch to bash for the
20       compilation or if you know what you are doing just replace the export
21       bits with setenv.
22
23       We further assume that your copies of tar and make are actually GNU tar
24       and GNU make respectively. It could be that they are installed as gtar
25       and gmake on your system.
26

OPTIMISTIC BUILD

28       Before you start to build RRDtool, you have to decide two things:
29
30       1.  In which directory you want to build the software.
31
32       2.  Where you want to install the software.
33
34       Once you have decided. Save the two locations into environment
35       variables.
36
37        BUILD_DIR=/tmp/rrdbuild
38        INSTALL_DIR=/usr/local/rrdtool-1.3.8
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 pre-
49       installed.
50
51        wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.3.8.tar.gz
52        gunzip -c rrdtool-1.3.8.tar.gz | tar xf -
53        cd rrdtool-1.3.8
54        ./configure --prefix=$INSTALL_DIR && make && make install
55
56       Ok, this was very optimistic. This try will probably have ended with
57       configure complaining about several missing libraries.
58

INSTALLING DEPENDENCIES

60       If your OS lets you install additional packages from a software
61       repository, you may get away with installing the missing packages. When
62       the packages are installed, run configure again and try to compile
63       again. Below you find some hints on getting your OS ready for the
64       rrdtool compilation.
65
66       Additions to this list are welcome. In general rrdtool should work with
67       the latest versions of the libraries. The versions listed here are just
68       what was current when I tested this.
69
70   OpenSolaris 2008.05
71       Just add a compiler and the gnome development package:
72
73        pkg install sunstudioexpress
74        pkg install SUNWgnome-common-devel
75
76       There is a problem with cairo.pc on OpenSolaris. It suggests that
77       xrender is required for compilation with cairo. This is not true and
78       also bad since OpenSolaris does not include an xrender.pc file. Use
79       Perl to fix this:
80
81        perl -i~ -p -e 's/(Requires.*?)\s*xrender.*/$1/' /usr/lib/pkgconfig/cairo.pc
82
83       Make sure rrdtool finds your new compiler
84
85        export PATH=/opt/SunStudioExpress/bin
86
87       Since there does not seem to be a viable msgfmt tool on OpenSolaris
88       (short of installing it yourself). You have to call configure with the
89
90        --disable-libintl
91
92       option.
93
94   Debian / Ubuntu
95       Use apt-get to make sure you have all that is required. A number of
96       packages will get added through dependencies.
97
98        apt-get install libpango1.0-dev libxml2-dev
99
100   Gentoo
101       In Gentoo installing rrdtool is really simple you just need to emerge
102       rrdtool. All dependencies will be handled automatically by the portage
103       system. The only thing you should care about are USE flags, which allow
104       you fine tune features rrdtool will be built with. Currently the
105       following USE flags are available:
106
107        doc    - install .html and .txt documentation
108                 into /usr/share/doc/rrdtool-1.x.xx/
109        perl   - build and install perl language bindings
110        python - build and install python language bindings
111        ruby   - build and install ruby language bindings
112        tcl    - build and install tcl language bindings
113        rrdcgi - build and install rrdcgi
114
115       After you've decided which USE flags you need, set them either in
116       make.conf or /etc/portage/package.use and finally run:
117
118        # emerge -va rrdtool
119
120       Take a look at Gentoo handbook for further details on how to manage USE
121       flags: http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2
122

BUILDING DEPENDENCIES

124       But again this may have been too optimistic still, and you actually
125       have to compile your own copies of some of the required libraries.
126       Things like libpng and zlib are pretty standard so you will probably
127       have them on your system anyway. Freetype, Fontinst, Cairo, Pango may
128       be installed, but it is possible that they are pretty old and thus
129       don't live up to our expectations, so you may want to compile their
130       latest versions.
131
132   General build tips for AIX
133       If you are working with AIX, you may find the --disable-shared option
134       will cause things to break for you. In that case you may have to
135       install the shared libraries into the rrdtool PREFIX and work with
136       --disable-static instead.
137
138       Another hint to get rrdtool working on AIX is to use the IBM XL C
139       Compiler:
140
141        export CC=/usr/vac/bin/cc
142        export PERLCC=$CC
143
144       (Better instructions for AIX welcome!)
145
146   Build Instructions
147       Some libraries want to know where other libraries are. For this to
148       work, set the following environment variable
149
150        export PKG_CONFIG_PATH=${INSTALL_DIR}/lib/pkgconfig
151        export PATH=$INSTALL_DIR/bin:$PATH
152
153       The above relies on the presence of the pkgconfig program. Below you
154       find instructions on how to compile pkgconfig.
155
156       Since we are compiling libraries dynamically, they must know where to
157       find each other. This is done by setting an appropriate LDFLAGS.
158       Unfortunately, the syntax again differs from system to system:
159
160       Solaris
161            export LDFLAGS=-R${INSTALL_DIR}/lib
162
163           if you are using the Sun Studio/Forte compiler, you may also want
164           to set
165
166            export CFLAGS="-xO3 -xcode=pic13"   (SPARC)
167            export CFLAGS="-xO3 -Kpic"          (x86)
168
169       Linux
170            export CFLAGS="-O3 -fPIC"
171            export LDFLAGS="-Wl,--rpath -Wl,${INSTALL_DIR}/lib"
172
173       HPUX
174            export LDFLAGS="+b${INSTALL_DIR}/lib"
175
176       AIX
177            export LDFLAGS="-Wl,-blibpath:${INSTALL_DIR}/lib"
178
179       If you have GNU make installed and it is not called 'make', then do
180
181        export MAKE=gmake
182        export GNUMAKE=gmake
183
184       otherwise just do
185
186        export MAKE=make
187
188       Building pkgconfig
189
190       As mentioned above, without pkgconfig the whole build process will be
191       lots of pain and suffering, so make sure you have a copy on your
192       system. If it is not available natively, here is how to compile it.
193
194        wget http://pkgconfig.freedesktop.org/releases/pkg-config-0.23.tar.gz
195        gunzip -c pkg-config-0.23.tar.gz | tar xf -
196        cd pkg-config-0.23
197        ./configure --prefix=$INSTALL_DIR
198        $MAKE
199        $MAKE install
200
201       After installing pkgconfig in a custom directory, setting up the
202       corresponding environment variable will be helpful.
203
204        export PKG_CONFIG=$INSTALL_DIR/bin/pkg-config
205
206       Building zlib
207
208       Chances are very high that you already have that on your system ...
209
210        cd $BUILD_DIR
211        wget http://oss.oetiker.ch/rrdtool/pub/libs/zlib-1.2.3.tar.gz
212        gunzip -c zlib-1.2.3.tar.gz | tar xf -
213        cd zlib-1.2.3
214        ./configure --prefix=$INSTALL_DIR --shared
215        $MAKE
216        $MAKE install
217
218       Building libpng
219
220       Libpng itself requires zlib to build, so we need to help a bit. If you
221       already have a copy of zlib on your system (which is very likely) you
222       can drop the settings of LDFLAGS and CPPFLAGS. Note that the backslash
223       (\) at the end of line 4 means that line 4 and line 5 are on one line.
224
225        cd $BUILD_DIR
226        wget http://oss.oetiker.ch/rrdtool/pub/libs/libpng-1.2.18.tar.gz
227        gunzip -c libpng-1.2.18.tar.gz | tar xf -
228        cd libpng-1.2.18
229        ./configure --prefix=$INSTALL_DIR
230        $MAKE
231        $MAKE install
232
233       Building freetype
234
235        cd $BUILD_DIR
236        wget http://oss.oetiker.ch/rrdtool/pub/libs/freetype-2.3.5.tar.gz
237        gunzip -c freetype-2.3.5.tar.gz | tar xf -
238        cd freetype-2.3.5
239        ./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC"
240        $MAKE
241        $MAKE install
242
243       If you run into problems building freetype on Solaris, you may want to
244       try to add the following at the start the configure line:
245
246        env EGREP=egrep
247
248       Building LibXML2
249
250        cd $BUILD_DIR
251        wget http://oss.oetiker.ch/rrdtool/pub/libs/libxml2-2.6.32.tar.gz
252        gunzip -c libxml2-2.6.32.tar.gz | tar xf -
253        cd libxml2-2.6.32
254        ./configure --prefix=$INSTALL_DIR
255        $MAKE
256        $MAKE install
257
258       Building fontconfig
259
260       Note that fontconfig has a run time configuration file in
261       INSTALL_DIR/etc you may want to adjust that so that fontconfig finds
262       the fonts on your system.  Run the fc-cache program to build the
263       fontconfig cache after changing the config file.
264
265        cd $BUILD_DIR
266        wget http://oss.oetiker.ch/rrdtool/pub/libs/fontconfig-2.4.2.tar.gz
267        gunzip -c fontconfig-2.4.2.tar.gz   | tar xf -
268        cd fontconfig-2.4.2
269        ./configure --prefix=$INSTALL_DIR --with-freetype-config=$INSTALL_DIR/bin/freetype-config
270        $MAKE
271        $MAKE install
272
273       Building Pixman
274
275        cd $BUILD_DIR
276        wget http://oss.oetiker.ch/rrdtool/pub/libs/pixman-0.10.0.tar.gz
277        gunzip -c pixman-0.10.0.tar.gz  | tar xf -
278        cd pixman-0.10.0
279        ./configure --prefix=$INSTALL_DIR
280        $MAKE
281        $MAKE install
282
283       Building Cairo
284
285        cd $BUILD_DIR
286        wget http://oss.oetiker.ch/rrdtool/pub/libs/cairo-1.6.4.tar.gz
287        gunzip -c cairo-1.6.4.tar.gz   | tar xf -
288        cd cairo-1.6.4
289        ./configure --prefix=$INSTALL_DIR \
290           --enable-xlib=no \
291           --enable-xlib-render=no \
292           --enable-win32=no
293        $MAKE
294        $MAKE install
295
296       Building Glib
297
298        cd $BUILD_DIR
299        wget http://oss.oetiker.ch/rrdtool/pub/libs/glib-2.15.4.tar.gz
300        gunzip -c glib-2.15.4.tar.gz  | tar xf -
301        cd glib-2.15.4
302        ./configure --prefix=$INSTALL_DIR
303        $MAKE
304        $MAKE install
305
306       Building Pango
307
308        cd $BUILD_DIR
309        wget http://oss.oetiker.ch/rrdtool/pub/libs/pango-1.21.1.tar.bz2
310        bunzip2 -c pango-1.21.1.tar.bz2 | tar xf -
311        cd pango-1.21.1
312        ./configure --prefix=$INSTALL_DIR --without-x
313        $MAKE
314        $MAKE install
315
316   Building rrdtool (second try)
317       Now all the dependent libraries are built and you can try again. This
318       time you tell configure where it should be looking for libraries and
319       include files. This is done via environment variables. Depending on the
320       shell you are running, the syntax for setting environment variables is
321       different.
322
323       And finally try building again. We disable the python and tcl bindings
324       because it seems that a fair number of people have ill configured
325       python and tcl setups that would prevent rrdtool from building if they
326       are included in their current state.
327
328        cd $BUILD_DIR/rrdtool-1.3.8
329        ./configure --prefix=$INSTALL_DIR --disable-tcl --disable-python
330        $MAKE clean
331        $MAKE
332        $MAKE install
333
334       SOLARIS HINT: if you want to build  the Perl module for the native Perl
335       (the one shipping with Solaris) you will need the Sun Forte compiler
336       installed on your box or you have to hand-tune
337       bindings/perl-shared/Makefile while building!
338
339       Now go to $INSTALL_DIR/share/rrdtool/examples/ and run them to see if
340       your build has been successful.
341

AUTHOR

343       Tobias Oetiker <tobi@oetiker.ch>
344
345
346
3471.3.8                             2009-05-19                       RRDBUILD(1)
Impressum