Code

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