Code

Imported upstream version 1.3.7.
[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 "2009-04-07" "1.3.7" "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.7
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.7.tar.gz
184 \& gunzip \-c rrdtool\-1.3.7.tar.gz | tar xf \-
185 \& cd rrdtool\-1.3.7
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. In general rrdtool should work with the
199 latest versions of the libraries. The versions listed here are just what was
200 current when I tested this.
201 .Sh "OpenSolaris 2008.05"
202 .IX Subsection "OpenSolaris 2008.05"
203 Just add a compiler and the gnome development package:
204 .PP
205 .Vb 2
206 \& pkg install sunstudioexpress
207 \& pkg install SUNWgnome\-common\-devel
208 .Ve
209 .PP
210 There is a problem with \fIcairo.pc\fR on OpenSolaris. It suggests that
211 xrender is required for compilation with cairo. This is not true and also
212 bad since OpenSolaris does not include an \fIxrender.pc\fR file. Use Perl to
213 fix this:
214 .PP
215 .Vb 1
216 \& perl \-i~ \-p \-e \(aqs/(Requires.*?)\es*xrender.*/$1/\(aq /usr/lib/pkgconfig/cairo.pc
217 .Ve
218 .PP
219 Make sure rrdtool finds your new compiler
220 .PP
221 .Vb 1
222 \& export PATH=/opt/SunStudioExpress/bin
223 .Ve
224 .PP
225 Since there does not seem to be a viable msgfmt tool on OpenSolaris (short
226 of installing it yourself). You have to call configure with the
227 .PP
228 .Vb 1
229 \& \-\-disable\-libintl
230 .Ve
231 .PP
232 option.
233 .Sh "Debian / Ubuntu"
234 .IX Subsection "Debian / Ubuntu"
235 Use apt-get to make sure you have all that is required. A number
236 of packages will get added through dependencies.
237 .PP
238 .Vb 1
239 \& apt\-get install libpango1.0\-dev libxml2\-dev
240 .Ve
241 .Sh "Gentoo"
242 .IX Subsection "Gentoo"
243 In Gentoo installing rrdtool is really simple you just need to \fBemerge
244 rrdtool\fR. All dependencies will be handled automatically by the portage
245 system. The only thing you should care about are \s-1USE\s0 flags, which allow you
246 fine tune features rrdtool will be built with. Currently the following \s-1USE\s0
247 flags are available:
248 .PP
249 .Vb 7
250 \& doc    \- install .html and .txt documentation
251 \&          into /usr/share/doc/rrdtool\-1.x.xx/
252 \& perl   \- build and install perl language bindings
253 \& python \- build and install python language bindings
254 \& ruby   \- build and install ruby language bindings
255 \& tcl    \- build and install tcl language bindings
256 \& rrdcgi \- build and install rrdcgi
257 .Ve
258 .PP
259 After you've decided which \s-1USE\s0 flags you need, set them either in
260 \&\fImake.conf\fR or \fI/etc/portage/package.use\fR and finally run:
261 .PP
262 .Vb 1
263 \& # emerge \-va rrdtool
264 .Ve
265 .PP
266 Take a look at Gentoo handbook for further details on how to manage \s-1USE\s0
267 flags: http://www.gentoo.org/doc/en/handbook/handbook\-x86.xml?part=2
268 .SH "BUILDING DEPENDENCIES"
269 .IX Header "BUILDING DEPENDENCIES"
270 But again this may have been too optimistic still, and you actually have to
271 compile your own copies of some of the required libraries. Things like
272 libpng and zlib are pretty standard so you will probably have them on your
273 system anyway. Freetype, Fontinst, Cairo, Pango may be installed, but it is
274 possible that they are pretty old and thus don't live up to our
275 expectations, so you may want to compile their latest versions.
276 .Sh "General build tips for \s-1AIX\s0"
277 .IX Subsection "General build tips for AIX"
278 If you are working with \s-1AIX\s0, you may find the \fB\-\-disable\-shared\fR option
279 will cause things to break for you. In that case you may have to install the
280 shared libraries into the rrdtool \s-1PREFIX\s0 and work with \fB\-\-disable\-static\fR
281 instead.
282 .PP
283 Another hint to get rrdtool working on \s-1AIX\s0 is to use the \s-1IBM\s0 \s-1XL\s0 C Compiler:
284 .PP
285 .Vb 2
286 \& export CC=/usr/vac/bin/cc
287 \& export PERLCC=$CC
288 .Ve
289 .PP
290 (Better instructions for \s-1AIX\s0 welcome!)
291 .Sh "Build Instructions"
292 .IX Subsection "Build Instructions"
293 Some libraries want to know where other libraries are. For this to work,
294 set the following environment variable
295 .PP
296 .Vb 2
297 \& export PKG_CONFIG_PATH=${INSTALL_DIR}/lib/pkgconfig
298 \& export PATH=$INSTALL_DIR/bin:$PATH
299 .Ve
300 .PP
301 The above relies on the presence of the \fIpkgconfig\fR program. Below you find instructions
302 on how to compile pkgconfig.
303 .PP
304 Since we are compiling libraries dynamically, they must know where to find
305 each other. This is done by setting an appropriate \s-1LDFLAGS\s0. Unfortunately,
306 the syntax again differs from system to system:
307 .IP "Solaris" 4
308 .IX Item "Solaris"
309 .Vb 1
310 \& export LDFLAGS=\-R${INSTALL_DIR}/lib
311 .Ve
312 .Sp
313 if you are using the Sun Studio/Forte compiler, you may also want to set
314 .Sp
315 .Vb 2
316 \& export CFLAGS="\-xO3 \-xcode=pic13"   (SPARC)
317 \& export CFLAGS="\-xO3 \-Kpic"          (x86)
318 .Ve
319 .IP "Linux" 4
320 .IX Item "Linux"
321 .Vb 2
322 \& export CFLAGS="\-O3 \-fPIC"
323 \& export LDFLAGS="\-Wl,\-\-rpath \-Wl,${INSTALL_DIR}/lib"
324 .Ve
325 .IP "\s-1HPUX\s0" 4
326 .IX Item "HPUX"
327 .Vb 1
328 \& export LDFLAGS="+b${INSTALL_DIR}/lib"
329 .Ve
330 .IP "\s-1AIX\s0" 4
331 .IX Item "AIX"
332 .Vb 1
333 \& export LDFLAGS="\-Wl,\-blibpath:${INSTALL_DIR}/lib"
334 .Ve
335 .PP
336 If you have \s-1GNU\s0 make installed and it is not called 'make',
337 then do
338 .PP
339 .Vb 2
340 \& export MAKE=gmake
341 \& export GNUMAKE=gmake
342 .Ve
343 .PP
344 otherwise just do
345 .PP
346 .Vb 1
347 \& export MAKE=make
348 .Ve
349 .PP
350 \fIBuilding pkgconfig\fR
351 .IX Subsection "Building pkgconfig"
352 .PP
353 As mentioned above, without pkgconfig the whole build process will be lots
354 of pain and suffering, so make sure you have a copy on your system. If it is
355 not available natively, here is how to compile it.
356 .PP
357 .Vb 6
358 \& wget http://pkgconfig.freedesktop.org/releases/pkg\-config\-0.23.tar.gz
359 \& gunzip \-c pkg\-config\-0.23.tar.gz | tar xf \-
360 \& cd pkg\-config\-0.23
361 \& ./configure \-\-prefix=$INSTALL_DIR
362 \& $MAKE
363 \& $MAKE install
364 .Ve
365 .PP
366 After installing pkgconfig in a custom directory, setting up the corresponding
367 environment variable will be helpful.
368 .PP
369 .Vb 1
370 \& export PKG_CONFIG=$INSTALL_DIR/bin/pkg\-config
371 .Ve
372 .PP
373 \fIBuilding zlib\fR
374 .IX Subsection "Building zlib"
375 .PP
376 Chances are very high that you already have that on your system ... 
377 .PP
378 .Vb 7
379 \& cd $BUILD_DIR
380 \& wget http://oss.oetiker.ch/rrdtool/pub/libs/zlib\-1.2.3.tar.gz
381 \& gunzip \-c zlib\-1.2.3.tar.gz | tar xf \-
382 \& cd zlib\-1.2.3
383 \& ./configure \-\-prefix=$INSTALL_DIR \-\-shared
384 \& $MAKE
385 \& $MAKE install
386 .Ve
387 .PP
388 \fIBuilding libpng\fR
389 .IX Subsection "Building libpng"
390 .PP
391 Libpng itself requires zlib to build, so we need to help a bit. If you
392 already have a copy of zlib on your system (which is very likely) you can
393 drop the settings of \s-1LDFLAGS\s0 and \s-1CPPFLAGS\s0. Note that the backslash (\e) at
394 the end of line 4 means that line 4 and line 5 are on one line.
395 .PP
396 .Vb 7
397 \& cd $BUILD_DIR
398 \& wget http://oss.oetiker.ch/rrdtool/pub/libs/libpng\-1.2.18.tar.gz
399 \& gunzip \-c libpng\-1.2.18.tar.gz | tar xf \-
400 \& cd libpng\-1.2.18
401 \& ./configure \-\-prefix=$INSTALL_DIR
402 \& $MAKE
403 \& $MAKE install
404 .Ve
405 .PP
406 \fIBuilding freetype\fR
407 .IX Subsection "Building freetype"
408 .PP
409 .Vb 7
410 \& cd $BUILD_DIR
411 \& wget http://oss.oetiker.ch/rrdtool/pub/libs/freetype\-2.3.5.tar.gz
412 \& gunzip \-c freetype\-2.3.5.tar.gz | tar xf \-
413 \& cd freetype\-2.3.5
414 \& ./configure \-\-prefix=$INSTALL_DIR CFLAGS="\-O3 \-fPIC"
415 \& $MAKE
416 \& $MAKE install
417 .Ve
418 .PP
419 If you run into problems building freetype on Solaris, you may want to try to
420 add the following at the start the configure line:
421 .PP
422 .Vb 1
423 \& env EGREP=egrep
424 .Ve
425 .PP
426 \fIBuilding LibXML2\fR
427 .IX Subsection "Building LibXML2"
428 .PP
429 .Vb 7
430 \& cd $BUILD_DIR
431 \& wget http://oss.oetiker.ch/rrdtool/pub/libs/libxml2\-2.6.32.tar.gz
432 \& gunzip \-c libxml2\-2.6.32.tar.gz | tar xf \-
433 \& cd libxml2\-2.6.32
434 \& ./configure \-\-prefix=$INSTALL_DIR
435 \& $MAKE
436 \& $MAKE install
437 .Ve
438 .PP
439 \fIBuilding fontconfig\fR
440 .IX Subsection "Building fontconfig"
441 .PP
442 Note that fontconfig has a run time configuration file in INSTALL_DIR/etc you
443 may want to adjust that so that fontconfig finds the fonts on your system.
444 Run the fc-cache program to build the fontconfig cache after changing the
445 config file.
446 .PP
447 .Vb 7
448 \& cd $BUILD_DIR
449 \& wget http://oss.oetiker.ch/rrdtool/pub/libs/fontconfig\-2.4.2.tar.gz
450 \& gunzip \-c fontconfig\-2.4.2.tar.gz   | tar xf \-
451 \& cd fontconfig\-2.4.2
452 \& ./configure \-\-prefix=$INSTALL_DIR \-\-with\-freetype\-config=$INSTALL_DIR/bin/freetype\-config
453 \& $MAKE
454 \& $MAKE install
455 .Ve
456 .PP
457 \fIBuilding Pixman\fR
458 .IX Subsection "Building Pixman"
459 .PP
460 .Vb 7
461 \& cd $BUILD_DIR
462 \& wget http://oss.oetiker.ch/rrdtool/pub/libs/pixman\-0.10.0.tar.gz
463 \& gunzip \-c pixman\-0.10.0.tar.gz  | tar xf \-
464 \& cd pixman\-0.10.0
465 \& ./configure \-\-prefix=$INSTALL_DIR
466 \& $MAKE
467 \& $MAKE install
468 .Ve
469 .PP
470 \fIBuilding Cairo\fR
471 .IX Subsection "Building Cairo"
472 .PP
473 .Vb 10
474 \& cd $BUILD_DIR
475 \& wget http://oss.oetiker.ch/rrdtool/pub/libs/cairo\-1.6.4.tar.gz
476 \& gunzip \-c cairo\-1.6.4.tar.gz   | tar xf \-
477 \& cd cairo\-1.6.4
478 \& ./configure \-\-prefix=$INSTALL_DIR \e
479 \&    \-\-enable\-xlib=no \e
480 \&    \-\-enable\-xlib\-render=no \e
481 \&    \-\-enable\-win32=no
482 \& $MAKE
483 \& $MAKE install
484 .Ve
485 .PP
486 \fIBuilding Glib\fR
487 .IX Subsection "Building Glib"
488 .PP
489 .Vb 7
490 \& cd $BUILD_DIR
491 \& wget http://oss.oetiker.ch/rrdtool/pub/libs/glib\-2.15.4.tar.gz
492 \& gunzip \-c glib\-2.15.4.tar.gz  | tar xf \-
493 \& cd glib\-2.15.4
494 \& ./configure \-\-prefix=$INSTALL_DIR
495 \& $MAKE
496 \& $MAKE install
497 .Ve
498 .PP
499 \fIBuilding Pango\fR
500 .IX Subsection "Building Pango"
501 .PP
502 .Vb 7
503 \& cd $BUILD_DIR
504 \& wget http://oss.oetiker.ch/rrdtool/pub/libs/pango\-1.21.1.tar.bz2
505 \& bunzip2 \-c pango\-1.21.1.tar.bz2 | tar xf \-
506 \& cd pango\-1.21.1
507 \& ./configure \-\-prefix=$INSTALL_DIR \-\-without\-x
508 \& $MAKE
509 \& $MAKE install
510 .Ve
511 .Sh "Building rrdtool (second try)"
512 .IX Subsection "Building rrdtool (second try)"
513 Now all the dependent libraries are built and you can try again. This time
514 you tell configure where it should be looking for libraries and include
515 files. This is done via environment variables. Depending on the shell you
516 are running, the syntax for setting environment variables is different.
517 .PP
518 And finally try building again. We disable the python and tcl bindings
519 because it seems that a fair number of people have ill configured python and
520 tcl setups that would prevent rrdtool from building if they are included in
521 their current state.
522 .PP
523 .Vb 5
524 \& cd $BUILD_DIR/rrdtool\-1.3.7
525 \& ./configure \-\-prefix=$INSTALL_DIR \-\-disable\-tcl \-\-disable\-python
526 \& $MAKE clean
527 \& $MAKE
528 \& $MAKE install
529 .Ve
530 .PP
531 \&\s-1SOLARIS\s0 \s-1HINT:\s0 if you want to build  the Perl module for the native Perl (the
532 one shipping with Solaris) you will need the Sun Forte compiler installed on
533 your box or you have to hand-tune bindings/perl\-shared/Makefile while
534 building!
535 .PP
536 Now go to \fI$INSTALL_DIR\fR\fB/share/rrdtool/examples/\fR and run them to see if
537 your build has been successful.
538 .SH "AUTHOR"
539 .IX Header "AUTHOR"
540 Tobias Oetiker <tobi@oetiker.ch>