Code

Imported upstream version 1.3.1.
[pkg-rrdtool.git] / doc / rrdbuild.1
1 .\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.32
2 .\"
3 .\" Standard preamble:
4 .\" ========================================================================
5 .de Sh \" Subsection heading
6 .br
7 .if t .Sp
8 .ne 5
9 .PP
10 \fB\\$1\fR
11 .PP
12 ..
13 .de Sp \" Vertical space (when we can't use .PP)
14 .if t .sp .5v
15 .if n .sp
16 ..
17 .de Vb \" Begin verbatim text
18 .ft CW
19 .nf
20 .ne \\$1
21 ..
22 .de Ve \" End verbatim text
23 .ft R
24 .fi
25 ..
26 .\" Set up some character translations and predefined strings.  \*(-- will
27 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
28 .\" double quote, and \*(R" will give a right double quote.  \*(C+ will
29 .\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
30 .\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
31 .\" nothing in troff, for use with C<>.
32 .tr \(*W-
33 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
34 .ie n \{\
35 .    ds -- \(*W-
36 .    ds PI pi
37 .    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
38 .    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
39 .    ds L" ""
40 .    ds R" ""
41 .    ds C` ""
42 .    ds C' ""
43 'br\}
44 .el\{\
45 .    ds -- \|\(em\|
46 .    ds PI \(*p
47 .    ds L" ``
48 .    ds R" ''
49 'br\}
50 .\"
51 .\" If the F register is turned on, we'll generate index entries on stderr for
52 .\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
53 .\" entries marked with X<> in POD.  Of course, you'll have to process the
54 .\" output yourself in some meaningful fashion.
55 .if \nF \{\
56 .    de IX
57 .    tm Index:\\$1\t\\n%\t"\\$2"
58 ..
59 .    nr % 0
60 .    rr F
61 .\}
62 .\"
63 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
64 .\" way too many mistakes in technical documents.
65 .hy 0
66 .if n .na
67 .\"
68 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69 .\" Fear.  Run.  Save yourself.  No user-serviceable parts.
70 .    \" fudge factors for nroff and troff
71 .if n \{\
72 .    ds #H 0
73 .    ds #V .8m
74 .    ds #F .3m
75 .    ds #[ \f1
76 .    ds #] \fP
77 .\}
78 .if t \{\
79 .    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
80 .    ds #V .6m
81 .    ds #F 0
82 .    ds #[ \&
83 .    ds #] \&
84 .\}
85 .    \" simple accents for nroff and troff
86 .if n \{\
87 .    ds ' \&
88 .    ds ` \&
89 .    ds ^ \&
90 .    ds , \&
91 .    ds ~ ~
92 .    ds /
93 .\}
94 .if t \{\
95 .    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
96 .    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
97 .    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
98 .    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
99 .    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
100 .    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
101 .\}
102 .    \" troff and (daisy-wheel) nroff accents
103 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
104 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
105 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
106 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
107 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
108 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
109 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
110 .ds ae a\h'-(\w'a'u*4/10)'e
111 .ds Ae A\h'-(\w'A'u*4/10)'E
112 .    \" corrections for vroff
113 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
114 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
115 .    \" for low resolution devices (crt and lpr)
116 .if \n(.H>23 .if \n(.V>19 \
117 \{\
118 .    ds : e
119 .    ds 8 ss
120 .    ds o a
121 .    ds d- d\h'-1'\(ga
122 .    ds D- D\h'-1'\(hy
123 .    ds th \o'bp'
124 .    ds Th \o'LP'
125 .    ds ae ae
126 .    ds Ae AE
127 .\}
128 .rm #[ #] #H #V #F C
129 .\" ========================================================================
130 .\"
131 .IX Title "RRDBUILD 1"
132 .TH RRDBUILD 1 "2008-07-23" "1.3.1" "rrdtool"
133 .SH "NAME"
134 rrdbuild \- Instructions for building RRDtool
135 .SH "OVERVIEW"
136 .IX Header "OVERVIEW"
137 If you downloaded the source of rrdtool you have to compile it. This
138 document will give some information on how this is done.
139 .PP
140 RRDtool relies on services of third part libraries. Some of these libraries
141 may already be installed on your system. You have to compile copies of the other
142 ones before you can build RRDtool.
143 .PP
144 This document will tell you about all the necessary steps to get going.
145 .PP
146 These instructions assume you are using a \fBbash\fR shell. If you use csh/tcsh,
147 then you can either type \fIbash\fR to switch to bash for the compilation or if
148 you know what you are doing just replace the export bits with
149 setenv.
150 .PP
151 We further assume that your copies of \fBtar\fR and \fBmake\fR are actually \fB\s-1GNU\s0
152 tar\fR and \fB\s-1GNU\s0 make\fR respectively. It could be that they are installed as
153 \&\fBgtar\fR and \fBgmake\fR on your system.
154 .SH "OPTIMISTIC BUILD"
155 .IX Header "OPTIMISTIC BUILD"
156 Before you start to build RRDtool, you have to decide two things:
157 .IP "1." 4
158 In which directory you want to build the software.
159 .IP "2." 4
160 Where you want to install the software.
161 .PP
162 Once you have decided. Save the two locations into environment variables.
163 .PP
164 .Vb 2
165 \& BUILD_DIR=/tmp/rrdbuild
166 \& INSTALL_DIR=/usr/local/rrdtool\-1.3.1
167 .Ve
168 .PP
169 If your \fI/tmp\fR is mounted with the option noexec (\s-1RHEL\s0 seems todo that) you have to choose
170 a different directory!
171 .PP
172 Now make sure the \s-1BUILD_DIR\s0 exists and go there:
173 .PP
174 .Vb 2
175 \& mkdir \-p $BUILD_DIR
176 \& cd $BUILD_DIR
177 .Ve
178 .PP
179 Lets first assume you already have all the necessary libraries
180 pre\-installed. 
181 .PP
182 .Vb 4
183 \& wget http://oss.oetiker.ch/rrdtool/pub/rrdtool\-1.3.1.tar.gz
184 \& gunzip \-c rrdtool\-1.3.1.tar.gz | tar xf \-
185 \& cd rrdtool\-1.3.1
186 \& ./configure \-\-prefix=$INSTALL_DIR && make && make install
187 .Ve
188 .PP
189 Ok, this was very optimistic. This try will probably have ended with
190 \&\fBconfigure\fR complaining about several missing libraries.
191 .SH "INSTALLING DEPENDENCIES"
192 .IX Header "INSTALLING DEPENDENCIES"
193 If your \s-1OS\s0 lets you install additional packages from a software repository,
194 you may get away with installing the missing packages. When the packages are
195 installed, run configure again and try to compile again. Below you find some
196 hints on getting your \s-1OS\s0 ready for the rrdtool compilation.
197 .PP
198 Additions to this list are welcome.
199 .Sh "OpenSolaris 2008.05"
200 .IX Subsection "OpenSolaris 2008.05"
201 Just add a compiler and the gnome development package:
202 .PP
203 .Vb 2
204 \& pkg install sunstudioexpress
205 \& pkg install SUNWgnome\-common\-devel
206 .Ve
207 .PP
208 There is a problem with \fIcairo.pc\fR on opensolaris. It suggests that
209 xrender is required for compilation with cairo. This is not true and also
210 bad since opensolaris does not include an \fIxrender.pc\fR file. Use perl to
211 fix this:
212 .PP
213 .Vb 1
214 \& perl \-i~ \-p \-e \(aqs/(Requires.*?)\es*xrender.*/$1/\(aq /usr/lib/pkgconfig/cairo.pc
215 .Ve
216 .Sh "Debian / Ubuntu"
217 .IX Subsection "Debian / Ubuntu"
218 Use apt-get to make sure you have all that is required. A number
219 of packages will get added through dependencies.
220 .PP
221 .Vb 1
222 \& apt\-get install libpango1.0\-dev libxml2\-dev
223 .Ve
224 .Sh "Gentoo"
225 .IX Subsection "Gentoo"
226 In Gentoo installing rrdtool is really simple you just need to \fBemerge
227 rrdtool\fR. All dependencies will be handled automatically by the portage
228 system. The only thing you should care about are \s-1USE\s0 flags, which allow you
229 fine tune features rrdtool will be built with. Currently the following \s-1USE\s0
230 flags are available:
231 .PP
232 .Vb 7
233 \& doc    \- install .html and .txt documentation
234 \&          into /usr/share/doc/rrdtool\-1.x.xx/
235 \& perl   \- build and install perl language bindings
236 \& python \- build and install python language bindings
237 \& ruby   \- build and install ruby language bindings
238 \& tcl    \- build and install tcl language bindings
239 \& rrdcgi \- build and install rrdcgi
240 .Ve
241 .PP
242 After you've decided which \s-1USE\s0 flags you need, set them either in
243 \&\fImake.conf\fR or \fI/etc/portage/package.use\fR and finally run:
244 .PP
245 .Vb 1
246 \& # emerge \-va rrdtool
247 .Ve
248 .PP
249 Take a look at Gentoo handbook for further details on how to manage \s-1USE\s0
250 flags: http://www.gentoo.org/doc/en/handbook/handbook\-x86.xml?part=2
251 .SH "BUILDING DEPENDENCIES"
252 .IX Header "BUILDING DEPENDENCIES"
253 But again this may have been too optimistic still, and you actually have to
254 compile your own copies of some of the required libraries. Things like
255 libpng and zlib are pretty standard so you will probably have them on your
256 system anyway. Freetype, Fontinst, Cairo, Pango may be installed, but it is
257 possible that they are pretty old and thus don't live up to our
258 expectations, so you may want to compile their latest versions.
259 .Sh "General build tips for \s-1AIX\s0"
260 .IX Subsection "General build tips for AIX"
261 If you are working with \s-1AIX\s0, you may find the the \fB\-\-disable\-shared\fR option
262 will cause things to break for you. In that case you may have to install the
263 shared libraries into the rrdtool \s-1PREFIX\s0 and work with \fB\-\-disable\-static\fR
264 instead.
265 .PP
266 Another hint to get rrdtool working on \s-1AIX\s0 is to use the \s-1IBM\s0 \s-1XL\s0 C Compiler:
267 .PP
268 .Vb 2
269 \& export CC=/usr/vac/bin/cc
270 \& export PERLCC=$CC
271 .Ve
272 .PP
273 (Better instructions for \s-1AIX\s0 welcome!)
274 .Sh "Build Instructions"
275 .IX Subsection "Build Instructions"
276 In order to build rrdtool need a compiler on your system. Unfortunately
277 compilers are not all alike. This has an effect on the \s-1CFLAGS\s0 you want to
278 set. The examples below are for the popular \s-1GCC\s0 compiler suite. If you have
279 an other compilers here are some ides:
280 .IP "Sun Forte" 4
281 .IX Item "Sun Forte"
282 .Vb 1
283 \& CFLAGS="\-xO3 \-kPIC"
284 .Ve
285 .PP
286 Some libraries want to know where other libraries are. For this to work,
287 set the following environment variable
288 .PP
289 .Vb 2
290 \& export PKG_CONFIG_PATH=${INSTALL_DIR}/lib/pkgconfig
291 \& export PATH=$INSTALL_DIR/bin:$PATH
292 .Ve
293 .PP
294 The above relies on the presence of the \fIpkgconfig\fR program. Below you find instructions
295 on how to compile pkgconfig.
296 .PP
297 Since we are compiling libraries dynamically, they must know where to find
298 each other. This is done by setting an appropriate \s-1LDFLAGS\s0. Unfortunately,
299 the syntax again differs from system to system:
300 .IP "Solaris" 4
301 .IX Item "Solaris"
302 .Vb 1
303 \& export LDFLAGS=\-R${INSTALL_DIR}/lib
304 .Ve
305 .IP "Linux" 4
306 .IX Item "Linux"
307 .Vb 1
308 \& export LDFLAGS="\-Wl,\-\-rpath \-Wl,${INSTALL_DIR}/lib"
309 .Ve
310 .IP "\s-1HPUX\s0" 4
311 .IX Item "HPUX"
312 .Vb 1
313 \& export LDFLAGS="+b${INSTALL_DIR}/lib"
314 .Ve
315 .IP "\s-1AIX\s0" 4
316 .IX Item "AIX"
317 .Vb 1
318 \& export LDFLAGS="\-Wl,\-blibpath:${INSTALL_DIR}/lib"
319 .Ve
320 .PP
321 If you have GNUmake installed and it is not called 'make',
322 then do
323 .PP
324 .Vb 2
325 \& export MAKE=gmake
326 \& export GNUMAKE=gmake
327 .Ve
328 .PP
329 otherwise just do
330 .PP
331 .Vb 1
332 \& export MAKE=make
333 .Ve
334 .PP
335 \fIBuilding pkgconfig\fR
336 .IX Subsection "Building pkgconfig"
337 .PP
338 As mentioned above, without pkgconfig the whole build process will be lots
339 of pain and suffering, so make sure you have a copy on your system. If it is
340 not available natively, here is how to compile it.
341 .PP
342 .Vb 6
343 \& wget http://pkgconfig.freedesktop.org/releases/pkg\-config\-0.23.tar.gz
344 \& gunzip \-c pkg\-config\-0.23.tar.gz | tar xf \-
345 \& cd pkg\-config\-0.23
346 \& ./configure \-\-prefix=$INSTALL_DIR CFLAGS="\-O3 \-fPIC"
347 \& $MAKE
348 \& $MAKE install
349 .Ve
350 .PP
351 \fIBuilding zlib\fR
352 .IX Subsection "Building zlib"
353 .PP
354 Chances are very high that you already have that on your system ... 
355 .PP
356 .Vb 7
357 \& cd $BUILD_DIR
358 \& wget http://oss.oetiker.ch/rrdtool/pub/libs/zlib\-1.2.3.tar.gz
359 \& gunzip \-c zlib\-1.2.3.tar.gz | tar xf \-
360 \& cd zlib\-1.2.3
361 \& ./configure \-\-prefix=$INSTALL_DIR CFLAGS="\-O3 \-fPIC" \-\-shared
362 \& $MAKE
363 \& $MAKE install
364 .Ve
365 .PP
366 \fIBuilding libpng\fR
367 .IX Subsection "Building libpng"
368 .PP
369 Libpng itself requires zlib to build, so we need to help a bit. If you
370 already have a copy of zlib on your system (which is very likely) you can
371 drop the settings of \s-1LDFLAGS\s0 and \s-1CPPFLAGS\s0. Note that the backslash (\e) at
372 the end of line 4 means that line 4 and line 5 are on one line.
373 .PP
374 .Vb 7
375 \& cd $BUILD_DIR
376 \& wget http://oss.oetiker.ch/rrdtool/pub/libs/libpng\-1.2.18.tar.gz
377 \& gunzip \-c libpng\-1.2.18.tar.gz | tar xf \-
378 \& cd libpng\-1.2.10
379 \& env CFLAGS="\-O3 \-fPIC" ./configure \-\-prefix=$INSTALL_DIR
380 \& $MAKE
381 \& $MAKE install
382 .Ve
383 .PP
384 \fIBuilding freetype\fR
385 .IX Subsection "Building freetype"
386 .PP
387 .Vb 7
388 \& cd $BUILD_DIR
389 \& wget http://oss.oetiker.ch/rrdtool/pub/libs/freetype\-2.3.5.tar.gz
390 \& gunzip \-c freetype\-2.3.5.tar.gz | tar xf \-
391 \& cd freetype\-2.3.5
392 \& ./configure \-\-prefix=$INSTALL_DIR CFLAGS="\-O3 \-fPIC"
393 \& $MAKE
394 \& $MAKE install
395 .Ve
396 .PP
397 If you run into problems building freetype on Solaris, you may want to try to
398 add the following at the start the configure line:
399 .PP
400 .Vb 1
401 \& env EGREP=egrep
402 .Ve
403 .PP
404 \fIBuilding LibXML2\fR
405 .IX Subsection "Building LibXML2"
406 .PP
407 .Vb 7
408 \& cd $BUILD_DIR
409 \& wget http://oss.oetiker.ch/rrdtool/pub/libs/libxml2\-sources\-2.6.31.tar.gz
410 \& gunzip \-c libxml2\-sources\-2.6.32.tar.gz | tar xf \-
411 \& cd libxml2\-sources\-2.6.32
412 \& ./configure \-\-prefix=$INSTALL_DIR CFLAGS="\-O3 \-fPIC"
413 \& $MAKE
414 \& $MAKE install
415 .Ve
416 .PP
417 \fIBuilding fontconfig\fR
418 .IX Subsection "Building fontconfig"
419 .PP
420 Note that fontconfig has a run time configuration file in INSTALL_DIR/etc you
421 may want to adjust that so that fontconfig finds the fonts on your system.
422 Run the fc-cache program to build the fontconfig cache after changing the
423 config file.
424 .PP
425 .Vb 7
426 \& cd $BUILD_DIR
427 \& wget http://oss.oetiker.ch/rrdtool/pub/libs/fontconfig\-2.4.2.tar.gz
428 \& gunzip \-c fontconfig\-2.4.2.tar.gz   | tar xf \-
429 \& cd fontconfig\-2.4.2
430 \& ./configure \-\-prefix=$INSTALL_DIR CFLAGS="\-O3 \-fPIC"
431 \& $MAKE
432 \& $MAKE install
433 .Ve
434 .PP
435 \fIBuilding Pixman\fR
436 .IX Subsection "Building Pixman"
437 .PP
438 .Vb 7
439 \& cd $BUILD_DIR
440 \& wget http://oss.oetiker.ch/rrdtool/pub/libs/pixman\-0.10.0.tar.gz
441 \& gunzip \-c pixman\-0.10.0.tar.gz  | tar xf \-
442 \& cd pixman\-0.10.0
443 \& ./configure \-\-prefix=$INSTALL_DIR CFLAGS="\-O3 \-fPIC"
444 \& $MAKE
445 \& $MAKE install
446 .Ve
447 .PP
448 \fIBuilding Cairo\fR
449 .IX Subsection "Building Cairo"
450 .PP
451 .Vb 11
452 \& cd $BUILD_DIR
453 \& wget http://oss.oetiker.ch/rrdtool/pub/libs/cairo\-1.6.4.tar.gz
454 \& gunzip \-c cairo\-1.4.10.tar.gz   | tar xf \-
455 \& cd cairo\-1.4.10
456 \& ./configure \-\-prefix=$INSTALL_DIR \e
457 \&    \-\-enable\-xlib=no \e
458 \&    \-\-enable\-xlib\-render=no \e
459 \&    \-\-enable\-win32=no \e
460 \&    CFLAGS="\-O3 \-fPIC"
461 \& $MAKE
462 \& $MAKE install
463 .Ve
464 .PP
465 \fIBuilding Glib\fR
466 .IX Subsection "Building Glib"
467 .PP
468 .Vb 7
469 \& cd $BUILD_DIR
470 \& wget http://oss.oetiker.ch/rrdtool/pub/libs/glib\-2.15.4.tar.gz
471 \& gunzip \-c glib\-2.12.13.tar.gz  | tar xf \-
472 \& cd glib\-2.12.13
473 \& ./configure \-\-prefix=$INSTALL_DIR CFLAGS="\-O3 \-fPIC"
474 \& $MAKE
475 \& $MAKE install
476 .Ve
477 .PP
478 \fIBuilding Pango\fR
479 .IX Subsection "Building Pango"
480 .PP
481 .Vb 7
482 \& cd $BUILD_DIR
483 \& wget http://oss.oetiker.ch/rrdtool/pub/libs/pango\-1.21.1.tar.gz
484 \& gunzip \-c pango\-1.21.1.tar.gz  | tar xf \-
485 \& cd pango\-1.21.1
486 \& ./configure \-\-prefix=$INSTALL_DIR CFLAGS="\-O3 \-fPIC" \-\-without\-x
487 \& $MAKE
488 \& $MAKE install
489 .Ve
490 .Sh "Building rrdtool (second try)"
491 .IX Subsection "Building rrdtool (second try)"
492 Now all the dependent libraries are built and you can try again. This time
493 you tell configure where it should be looking for libraries and include
494 files. This is done via environment variables. Depending on the shell you
495 are running, the syntax for setting environment variables is different.
496 .PP
497 And finally try building again. We disable the python and tcl bindings
498 because it seems that a fair number of people have ill configured python and
499 tcl setups that would prevent rrdtool from building if they are included in
500 their current state.
501 .PP
502 .Vb 5
503 \& cd $BUILD_DIR/rrdtool\-1.3.1
504 \& ./configure \-\-prefix=$INSTALL_DIR \-\-disable\-tcl \-\-disable\-python
505 \& $MAKE clean
506 \& $MAKE
507 \& $MAKE install
508 .Ve
509 .PP
510 \&\s-1SOLARIS\s0 \s-1HINT:\s0 if you want to build  the perl module for the native perl (the
511 one shipping with Solaris) you will need the Sun Forte compiler installed on
512 your box or you have to hand-tune bindings/perl\-shared/Makefile while
513 building!
514 .PP
515 Now go to \fI$INSTALL_DIR\fR\fB/share/rrdtool/examples/\fR and run them to see if
516 your build has been successful.
517 .SH "AUTHOR"
518 .IX Header "AUTHOR"
519 Tobias Oetiker <tobi@oetiker.ch>