Code

Imported upstream version 1.3rc9.
[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-06-08" "1.3rc9" "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.3rc9
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.3rc9.tar.gz
184 \& gunzip \-c rrdtool\-1.3rc9.tar.gz | tar xf \-
185 \& cd rrdtool\-1.3rc9
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 .PP
260 \fIBuild Tips for \s-1AIX\s0\fR
261 .IX Subsection "Build Tips for AIX"
262 .PP
263 If you are working with \s-1AIX\s0, you may find the the \fB\-\-disable\-shared\fR option
264 will cause things to break for you. In that case you may have to install the
265 shared libraries into the rrdtool \s-1PREFIX\s0 and work with \fB\-\-disable\-static\fR
266 instead.
267 .PP
268 Another hint to get rrdtool working on \s-1AIX\s0 is to use the \s-1IBM\s0 \s-1XL\s0 C Compiler:
269 .PP
270 .Vb 2
271 \& export CC=/usr/vac/bin/cc
272 \& export PERLCC=$CC
273 .Ve
274 .PP
275 (Better instructions for \s-1AIX\s0 welcome!)
276 .Sh "Building Libraries"
277 .IX Subsection "Building Libraries"
278 In order to build the libraries you need a compiler on your system.
279 Unfortunately compilers are not all alike. This has an effect on the \s-1CFLAGS\s0
280 you want to set. The examples below are for the popular \s-1GCC\s0 compiler suite.
281 If you have an other compilers here are some ides:
282 .IP "Sun Forte" 4
283 .IX Item "Sun Forte"
284 .Vb 1
285 \& CFLAGS="\-xO3 \-kPIC"
286 .Ve
287 .Sp
288 .RS 4
289 Some libraries want to know where other libraries are. For this to work,
290 set the following environment variable
291 .Sp
292 .Vb 2
293 \& export PKG_CONFIG_PATH=${INSTALL_DIR}/lib/pkgconfig
294 \& export PATH=$INSTALL_DIR/bin:$PATH
295 .Ve
296 .Sp
297 This relies on the presence of the \fIpkgconfig\fR program. Below you find instructions
298 on how to compile pkgconfig as well.
299 .Sp
300 Since we are compiling libraries dynamically, they must know
301 where to find each other. This is done by setting an appropriate \s-1LDFLAGS\s0.
302 Unfortunately, the syntax again differs from system to system:
303 .IP "Solaris" 4
304 .IX Item "Solaris"
305 .Vb 1
306 \& export LDFLAGS=\-R${INSTALL_DIR}/lib
307 .Ve
308 .IP "Linux" 4
309 .IX Item "Linux"
310 .Vb 1
311 \& export LDFLAGS="\-Wl,\-\-rpath \-Wl,${INSTALL_DIR}/lib"
312 .Ve
313 .IP "\s-1HPUX\s0" 4
314 .IX Item "HPUX"
315 .Vb 1
316 \& export LDFLAGS="+b${INSTALL_DIR}/lib"
317 .Ve
318 .IP "\s-1AIX\s0" 4
319 .IX Item "AIX"
320 .Vb 1
321 \& export LDFLAGS="\-Wl,\-blibpath:${INSTALL_DIR}/lib"
322 .Ve
323 .RE
324 .RS 4
325 .Sp
326 If you have GNUmake installed and it is not called 'make',
327 then do
328 .Sp
329 .Vb 2
330 \& export MAKE=gmake
331 \& export GNUMAKE=gmake
332 .Ve
333 .Sp
334 otherwise just do
335 .Sp
336 .Vb 1
337 \& export MAKE=make
338 .Ve
339 .RE
340 .IP "Building pkgconfig" 4
341 .IX Item "Building pkgconfig"
342 As mentioned above, without pkgconfig the whole build process will be lots
343 of pain and suffering, so make sure you have a copy on your system. If it is
344 not available natively, here is how to compile it.
345 .Sp
346 .Vb 6
347 \& wget http://pkgconfig.freedesktop.org/releases/pkg\-config\-0.23.tar.gz
348 \& gunzip \-c pkg\-config\-0.23.tar.gz | tar xf \-
349 \& cd pkg\-config\-0.23
350 \& ./configure \-\-prefix=$INSTALL_DIR CFLAGS="\-O3 \-fPIC"
351 \& $MAKE
352 \& $MAKE install
353 .Ve
354 .IP "Building zlib" 4
355 .IX Item "Building zlib"
356 Chances are very high that you already have that on your system ... 
357 .Sp
358 .Vb 7
359 \& cd $BUILD_DIR
360 \& wget http://oss.oetiker.ch/rrdtool/pub/libs/zlib\-1.2.3.tar.gz
361 \& gunzip \-c zlib\-1.2.3.tar.gz | tar xf \-
362 \& cd zlib\-1.2.3
363 \& ./configure \-\-prefix=$INSTALL_DIR CFLAGS="\-O3 \-fPIC" \-\-shared
364 \& $MAKE
365 \& $MAKE install
366 .Ve
367 .IP "Building libpng" 4
368 .IX Item "Building libpng"
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 .Sp
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 .IP "Building freetype" 4
384 .IX Item "Building freetype"
385 .Vb 7
386 \& cd $BUILD_DIR
387 \& wget http://oss.oetiker.ch/rrdtool/pub/libs/freetype\-2.3.5.tar.gz
388 \& gunzip \-c freetype\-2.3.5.tar.gz | tar xf \-
389 \& cd freetype\-2.3.5
390 \& ./configure \-\-prefix=$INSTALL_DIR CFLAGS="\-O3 \-fPIC"
391 \& $MAKE
392 \& $MAKE install
393 .Ve
394 .Sp
395 If you run into problems building freetype on Solaris, you may want to try to
396 add the following at the start the configure line:
397 .Sp
398 .Vb 1
399 \& env EGREP=egrep
400 .Ve
401 .IP "Building LibXML2" 4
402 .IX Item "Building LibXML2"
403 .Vb 7
404 \& cd $BUILD_DIR
405 \& wget http://oss.oetiker.ch/rrdtool/pub/libs/libxml2\-sources\-2.6.31.tar.gz
406 \& gunzip \-c libxml2\-sources\-2.6.32.tar.gz | tar xf \-
407 \& cd libxml2\-sources\-2.6.32
408 \& ./configure \-\-prefix=$INSTALL_DIR CFLAGS="\-O3 \-fPIC"
409 \& $MAKE
410 \& $MAKE install
411 .Ve
412 .IP "Building fontconfig" 4
413 .IX Item "Building fontconfig"
414 Note that fontconfig has a run time configuration file in INSTALL_DIR/etc you
415 may want to adjust that so that fontconfig finds the fonts on your system.
416 Run the fc-cache program to build the fontconfig cache after changing the
417 config file.
418 .Sp
419 .Vb 7
420 \& cd $BUILD_DIR
421 \& wget http://oss.oetiker.ch/rrdtool/pub/libs/fontconfig\-2.4.2.tar.gz
422 \& gunzip \-c fontconfig\-2.4.2.tar.gz   | tar xf \-
423 \& cd fontconfig\-2.4.2
424 \& ./configure \-\-prefix=$INSTALL_DIR CFLAGS="\-O3 \-fPIC"
425 \& $MAKE
426 \& $MAKE install
427 .Ve
428 .IP "Building Pixman" 4
429 .IX Item "Building Pixman"
430 .Vb 7
431 \& cd $BUILD_DIR
432 \& wget http://oss.oetiker.ch/rrdtool/pub/libs/pixman\-0.10.0.tar.gz
433 \& gunzip \-c pixman\-0.10.0.tar.gz  | tar xf \-
434 \& cd pixman\-0.10.0
435 \& ./configure \-\-prefix=$INSTALL_DIR CFLAGS="\-O3 \-fPIC"
436 \& $MAKE
437 \& $MAKE install
438 .Ve
439 .IP "Building Cairo" 4
440 .IX Item "Building Cairo"
441 .Vb 11
442 \& cd $BUILD_DIR
443 \& wget http://oss.oetiker.ch/rrdtool/pub/libs/cairo\-1.6.4.tar.gz
444 \& gunzip \-c cairo\-1.4.10.tar.gz   | tar xf \-
445 \& cd cairo\-1.4.10
446 \& ./configure \-\-prefix=$INSTALL_DIR \e
447 \&    \-\-enable\-xlib=no \e
448 \&    \-\-enable\-xlib\-render=no \e
449 \&    \-\-enable\-win32=no \e
450 \&    CFLAGS="\-O3 \-fPIC"
451 \& $MAKE
452 \& $MAKE install
453 .Ve
454 .IP "Building Glib" 4
455 .IX Item "Building Glib"
456 .Vb 7
457 \& cd $BUILD_DIR
458 \& wget http://oss.oetiker.ch/rrdtool/pub/libs/glib\-2.15.4.tar.gz
459 \& gunzip \-c glib\-2.12.13.tar.gz  | tar xf \-
460 \& cd glib\-2.12.13
461 \& ./configure \-\-prefix=$INSTALL_DIR CFLAGS="\-O3 \-fPIC"
462 \& $MAKE
463 \& $MAKE install
464 .Ve
465 .IP "Building Pango" 4
466 .IX Item "Building Pango"
467 .Vb 7
468 \& cd $BUILD_DIR
469 \& wget http://oss.oetiker.ch/rrdtool/pub/libs/pango\-1.21.1.tar.gz
470 \& gunzip \-c pango\-1.21.1.tar.gz  | tar xf \-
471 \& cd pango\-1.21.1
472 \& ./configure \-\-prefix=$INSTALL_DIR CFLAGS="\-O3 \-fPIC" \-\-without\-x
473 \& $MAKE
474 \& $MAKE install
475 .Ve
476 .PP
477 Now all the dependent libraries are built and you can try again. This time
478 you tell configure where it should be looking for libraries and include
479 files. This is done via environment variables. Depending on the shell you
480 are running, the syntax for setting environment variables is different.
481 .PP
482 And finally try building again. We disable the python and tcl bindings
483 because it seems that a fair number of people have ill configured python and
484 tcl setups that would prevent rrdtool from building if they are included in
485 their current state.
486 .PP
487 .Vb 5
488 \& cd $BUILD_DIR/rrdtool\-1.3rc9
489 \& ./configure \-\-prefix=$INSTALL_DIR \-\-disable\-tcl \-\-disable\-python
490 \& $MAKE clean
491 \& $MAKE
492 \& $MAKE install
493 .Ve
494 .PP
495 \&\s-1SOLARIS\s0 \s-1HINT:\s0 if you want to build  the perl module for the native perl (the
496 one shipping with Solaris) you will need the sun forte compiler installed on
497 your box or you have to hand-tune bindings/perl\-shared/Makefile while
498 building!
499 .PP
500 Now go to \fI$INSTALL_DIR\fR\fB/share/rrdtool/examples/\fR and run them to see if
501 your build has been successful.
502 .SH "AUTHOR"
503 .IX Header "AUTHOR"
504 Tobias Oetiker <tobi@oetiker.ch>