Code

Imported upstream version 1.3rc6.
[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-05-26" "1.3rc6" "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 thrid 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.3rc6
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.3rc6.tar.gz
184 \& gunzip \-c rrdtool\-1.3rc6.tar.gz | tar xf \-
185 \& cd rrdtool\-1.3rc6
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. Additions to
197 this list are welcome.
198 .Sh "OpenSolaris 2008.05"
199 .IX Subsection "OpenSolaris 2008.05"
200 Just add a compiler and the gnome development package:
201 .PP
202 .Vb 2
203 \& pkg install sunstudioexpress
204 \& pkg install SUNWgnome\-common\-devel
205 .Ve
206 .PP
207 There is a a problem with \fIcairo.pc\fR on opensolaris. It suggests that
208 xrender is required for compilation with cairo. This is not true and also
209 bad since opensolaris does not include an \fIxrender.pc\fR file. Use perl to
210 fix this:
211 .PP
212 .Vb 1
213 \& perl \-i~ \-p \-e 's/(Requires.*?)\es*xrender.*/$1/' /usr/lib/pkgconfig/cairo.pc
214 .Ve
215 .Sh "Debian / Ubuntu"
216 .IX Subsection "Debian / Ubuntu"
217 Use apt-get to make sure you have all that is required. A number
218 of packages will get added through dependencies.
219 .PP
220 .Vb 1
221 \& apt\-get install libpango1.0\-dev libxml2\-dev
222 .Ve
223 .SH "BUILDING DEPENDENCIES"
224 .IX Header "BUILDING DEPENDENCIES"
225 But again this may have been too optimistic still, and you actually have to
226 compile your own copies of some of the required libraries. Things like
227 libpng and zlib are pretty standard so you will probably have them on your
228 system anyway. Freetype, Fontinst, Cairo, Pango may be installed, but it is
229 possible that they are pretty old and thus don't live up to the
230 expectations, so you may want to compile their latest versions.
231 .PP
232 \fIBuild Tipps for \s-1AIX\s0\fR
233 .IX Subsection "Build Tipps for AIX"
234 .PP
235 If you are woking with \s-1AIX\s0, you may find the the \fB\-\-disable\-shared\fR option
236 will cause things to break for you. In that case you may have to install the
237 shared libraries into the rrdtool \s-1PREFIX\s0 and work with \fB\-\-disable\-static\fR
238 instead.
239 .PP
240 Another hint to get rrdtool working on \s-1AIX\s0 is to use the \s-1IBM\s0 \s-1XL\s0 C Compiler:
241 .PP
242 .Vb 2
243 \& export CC=/usr/vac/bin/cc
244 \& export PERLCC=$CC
245 .Ve
246 .PP
247 (Better instructions for \s-1AIX\s0 welcome!)
248 .Sh "Building Libraries"
249 .IX Subsection "Building Libraries"
250 In order to build the libraries you need a compiler on your system.
251 Unfortunately compilers are not all alike. This has an effect on the \s-1CFLAGS\s0
252 you want to set. The examples below are for the popular \s-1GCC\s0 compiler suite.
253 If you have an other compile you have to use the following settings:
254 .IP "Sun Forte" 4
255 .IX Item "Sun Forte"
256 .Vb 1
257 \& CFLAGS="\-xO3 \-kPIC"
258 .Ve
259 .Sp
260 .RS 4
261 Some libraries want to know where other libraries are. For this to work,
262 set the following environamen variable
263 .Sp
264 .Vb 2
265 \& export PKG_CONFIG_PATH=${INSTALL_DIR}/lib/pkgconfig
266 \& export PATH=$INSTALL_DIR/bin:$PATH
267 .Ve
268 .Sp
269 Since we are compiling libraries dynamically, you they must further know
270 where to find each other. This is done by setting an appropriate \s-1LDFLAG\s0.
271 Unfortunatly the syntax differs from system to system:
272 .IP "Solaris" 4
273 .IX Item "Solaris"
274 .Vb 1
275 \& export LDFLAGS=\-R${INSTALL_DIR}/lib
276 .Ve
277 .IP "Linux" 4
278 .IX Item "Linux"
279 .Vb 1
280 \& export LDFLAGS="\-Wl,\-\-rpath \-Wl,${INSTALL_DIR}/lib"
281 .Ve
282 .Sp
283 If you are on a 64bit platform, but would like to continue to use the rrd files created
284 on your old 32bit linux, you may be able 
285 .IP "\s-1HPUX\s0" 4
286 .IX Item "HPUX"
287 .Vb 1
288 \& export LDFLAGS="+b${INSTALL_DIR}/lib"
289 .Ve
290 .IP "\s-1AIX\s0" 4
291 .IX Item "AIX"
292 .Vb 1
293 \& export LDFLAGS="\-Wl,\-blibpath:${INSTALL_DIR}/lib"
294 .Ve
295 .RE
296 .RS 4
297 .Sp
298 If you have GNUmake installed and it is not called 'make',
299 then do
300 .Sp
301 .Vb 2
302 \& export MAKE=gmake
303 \& export GNUMAKE=gmake
304 .Ve
305 .Sp
306 otherwhise just do
307 .Sp
308 .Vb 1
309 \& export MAKE=make
310 .Ve
311 .RE
312 .IP "Building zlib" 4
313 .IX Item "Building zlib"
314 Chances are very high that you already have that on your system ... 
315 .Sp
316 .Vb 7
317 \& cd $BUILD_DIR
318 \& wget http://oss.oetiker.ch/rrdtool/pub/libs/zlib\-1.2.3.tar.gz
319 \& gunzip \-c zlib\-1.2.3.tar.gz | tar xf \-
320 \& cd zlib\-1.2.3
321 \& ./configure \-\-prefix=$INSTALL_DIR CFLAGS="\-O3 \-fPIC" \-\-shared
322 \& $MAKE
323 \& $MAKE install
324 .Ve
325 .IP "Building libpng" 4
326 .IX Item "Building libpng"
327 Libpng itself requires zlib to build, so we need to help a bit. If you
328 already have a copy of zlib on your system (which is very likley) you can
329 drop the settings of \s-1LDFLAGS\s0 and \s-1CPPFLAGS\s0. Note that the backslash (\e) at
330 the end of line 4 means that line 4 and line 5 are on one line.
331 .Sp
332 .Vb 7
333 \& cd $BUILD_DIR
334 \& wget http://oss.oetiker.ch/rrdtool/pub/libs/libpng\-1.2.18.tar.gz
335 \& gunzip \-c libpng\-1.2.18.tar.gz | tar xf \-
336 \& cd libpng\-1.2.10
337 \& env CFLAGS="\-O3 \-fPIC" ./configure \-\-prefix=$INSTALL_DIR
338 \& $MAKE
339 \& $MAKE install
340 .Ve
341 .IP "Building freetype" 4
342 .IX Item "Building freetype"
343 .Vb 7
344 \& cd $BUILD_DIR
345 \& wget http://oss.oetiker.ch/rrdtool/pub/libs/freetype\-2.3.5.tar.gz
346 \& gunzip \-c freetype\-2.3.5.tar.gz | tar xf \-
347 \& cd freetype\-2.3.5
348 \& ./configure \-\-prefix=$INSTALL_DIR CFLAGS="\-O3 \-fPIC"
349 \& $MAKE
350 \& $MAKE install
351 .Ve
352 .Sp
353 If you run into problems building freetype on Solaris, you may want to try to
354 add the following at the start the configure line:
355 .Sp
356 .Vb 1
357 \& env EGREP=egrep
358 .Ve
359 .IP "Building LibXML2" 4
360 .IX Item "Building LibXML2"
361 .Vb 7
362 \& cd $BUILD_DIR
363 \& wget http://oss.oetiker.ch/rrdtool/pub/libs/libxml2\-sources\-2.6.31.tar.gz
364 \& gunzip \-c libxml2\-sources\-2.6.32.tar.gz | tar xf \-
365 \& cd libxml2\-sources\-2.6.32
366 \& ./configure \-\-prefix=$INSTALL_DIR CFLAGS="\-O3 \-fPIC"
367 \& $MAKE
368 \& $MAKE install
369 .Ve
370 .IP "Building fontconfig" 4
371 .IX Item "Building fontconfig"
372 Note that fontconfig has a runtime configuration file in INSTALL_DIR/etc you
373 may want to adjust that so that fontconfig finds the fonts on your system.
374 Run the fc-cache program to build the fontconfig cache after changeing the
375 config file.
376 .Sp
377 .Vb 7
378 \& cd $BUILD_DIR
379 \& wget http://oss.oetiker.ch/rrdtool/pub/libs/fontconfig\-2.4.2.tar.gz
380 \& gunzip \-c fontconfig\-2.4.2.tar.gz   | tar xf \-
381 \& cd fontconfig\-2.4.2
382 \& ./configure \-\-prefix=$INSTALL_DIR CFLAGS="\-O3 \-fPIC"
383 \& $MAKE
384 \& $MAKE install
385 .Ve
386 .IP "Building Pixman" 4
387 .IX Item "Building Pixman"
388 .Vb 7
389 \& cd $BUILD_DIR
390 \& wget http://oss.oetiker.ch/rrdtool/pub/libs/pixman\-0.10.0.tar.gz
391 \& gunzip \-c pixman\-0.10.0.tar.gz  | tar xf \-
392 \& cd fontconfig\-2.4.2
393 \& ./configure \-\-prefix=$INSTALL_DIR CFLAGS="\-O3 \-fPIC"
394 \& $MAKE
395 \& $MAKE install
396 .Ve
397 .IP "Building Cairo" 4
398 .IX Item "Building Cairo"
399 .Vb 11
400 \& cd $BUILD_DIR
401 \& wget http://oss.oetiker.ch/rrdtool/pub/libs/cairo\-1.6.4.tar.gz
402 \& gunzip \-c cairo\-1.4.10.tar.gz   | tar xf \-
403 \& cd cairo\-1.4.10
404 \& ./configure \-\-prefix=$INSTALL_DIR \e
405 \&    \-\-enable\-xlib=no \e
406 \&    \-\-enable\-xlib\-render=no \e
407 \&    \-\-enable\-win32=no \e
408 \&    CFLAGS="\-O3 \-fPIC"
409 \& $MAKE
410 \& $MAKE install
411 .Ve
412 .IP "Building Glib" 4
413 .IX Item "Building Glib"
414 .Vb 7
415 \& cd $BUILD_DIR
416 \& wget http://oss.oetiker.ch/rrdtool/pub/libs/glib\-2.15.4.tar.gz
417 \& gunzip \-c glib\-2.12.13.tar.gz  | tar xf \-
418 \& cd glib\-2.12.13
419 \& ./configure \-\-prefix=$INSTALL_DIR CFLAGS="\-O3 \-fPIC"
420 \& $MAKE
421 \& $MAKE install
422 .Ve
423 .IP "Building Pango" 4
424 .IX Item "Building Pango"
425 .Vb 7
426 \& cd $BUILD_DIR
427 \& wget http://oss.oetiker.ch/rrdtool/pub/libs/pango\-1.21.1.tar.gz
428 \& gunzip \-c pango\-1.21.1.tar.gz  | tar xf \-
429 \& cd pango\-1.21.1
430 \& ./configure \-\-prefix=$INSTALL_DIR CFLAGS="\-O3 \-fPIC" \-\-without\-x
431 \& $MAKE
432 \& $MAKE install
433 .Ve
434 .PP
435 Now all the dependent libraries are built and you can try again. This time
436 you tell configure where it should be looking for libraries and include
437 files. This is done via environment variables. Depending on the shell you
438 are running, the syntax for setting environment variables is different.
439 .PP
440 And finally try building again. We disable the python and tcl bindings
441 because it seems that a fair number of people have ill configured python and
442 tcl setups that would prevent rrdtool from building if they are included in
443 their current state.
444 .PP
445 .Vb 5
446 \& cd $BUILD_DIR/rrdtool\-1.3rc6
447 \& ./configure \-\-prefix=$INSTALL_DIR \-\-disable\-tcl \-\-disable\-python
448 \& $MAKE clean
449 \& $MAKE
450 \& $MAKE install
451 .Ve
452 .PP
453 \&\s-1SOLARIS\s0 \s-1HINT:\s0 if you want to build  the perl module for the native perl (the
454 one shipping with solaris) you will need the sun forte compiler installed on
455 your box or you have to hand-tune bindings/perl\-shared/Makefile while
456 building!
457 .PP
458 Now go to \fI$INSTALL_DIR\fR\fB/share/rrdtool/examples/\fR and run them to see if
459 your build has been successful.
460 .SH "AUTHOR"
461 .IX Header "AUTHOR"
462 Tobias Oetiker <tobi@oetiker.ch>