Code

Imported upstream version 1.2.26
[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 "2007-11-20" "1.2.26" "rrdtool"
133 .SH "NAME"
134 rrdbuild \- Instructions for building RRDtool
135 .SH "DESCRIPTION"
136 .IX Header "DESCRIPTION"
137 .Sh "Overview"
138 .IX Subsection "Overview"
139 If you downloaded the source of rrdtool you have to compile it. This
140 document will give some information on how this is done.
141 .PP
142 RRDtool relies on services of thrid part libraries. Some of these libraries
143 may already be installed on your system. You have to compile copies of the other
144 ones before you can build RRDtool.
145 .PP
146 This document will tell you about all the necessary steps to get going.
147 .Sh "Building"
148 .IX Subsection "Building"
149 Before you start to build RRDtool, you have to decide two things:
150 .IP "1." 4
151 In which directory you want to build the software.
152 .IP "2." 4
153 Where you want to install the software.
154 .PP
155 Once you have decided. Save the two locations into environment variables.
156 Depending on the shell you are using, you can do either (bash,zsh):
157 .PP
158 .Vb 2
159 \& BUILD_DIR=/tmp/rrdbuild
160 \& INSTALL_DIR=/usr/local/rrdtool\-1.2.26
161 .Ve
162 .PP
163 Or if you run tcsh:
164 .PP
165 .Vb 2
166 \& set BUILD_DIR=/tmp/rrdbuild
167 \& set INSTALL_DIR=/usr/local/rrdtool\-1.2.26
168 .Ve
169 .PP
170 If your \fI/tmp\fR is mounted with the option noexec (\s-1RHEL\s0 seems todo that) you have to choose
171 a different directory!
172 .PP
173 Now make sure the \s-1BUILD_DIR\s0 exists and go there:
174 .PP
175 .Vb 2
176 \& mkdir \-p $BUILD_DIR
177 \& cd $BUILD_DIR
178 .Ve
179 .PP
180 Lets first assume you already have all the necessary libraries
181 pre\-installed. Note that these instructions assume that your copies of
182 \&\fBtar\fR and \fBmake\fR are actually \fB\s-1GNU\s0 tar\fR and \fB\s-1GNU\s0 make\fR respectively. It
183 could be that they are installed as \fBgtar\fR and \fBgmake\fR on your system.
184 .PP
185 .Vb 4
186 \& wget http://oss.oetiker.ch/rrdtool/pub/rrdtool\-1.2.26.tar.gz
187 \& tar zxf rrdtool\-1.2.26.tar.gz
188 \& cd rrdtool\-1.2.26
189 \& ./configure \-\-prefix=$INSTALL_DIR && make && make install
190 .Ve
191 .PP
192 Ok, this was very optimistic. This try will probably have ended with
193 \&\fBconfigure\fR complaining about several missing libraries. If you are on a
194 Linux or *bsd system you may want to just install the missing bits from your
195 software repository. When you do that, make sure you also get the \fB\-dev\fR
196 package for each library you install. Once you have the missing bits on
197 board, just re-run the last line of the instructions above.
198 .PP
199 But again this may have been too optimistic, and you actually have to
200 compile your own copies of the required libraries.
201 .PP
202 \fIBuild Tipps for \s-1AIX\s0\fR
203 .IX Subsection "Build Tipps for AIX"
204 .PP
205 If you are woking with \s-1AIX\s0, you may find the the \fB\-\-disable\-shared\fR option
206 will cause things to break for you. In that case you may have to install the
207 shared libraries into the rrdtool \s-1PREFIX\s0 and work with \fB\-\-disable\-static\fR
208 instead.
209 .PP
210 Another hint to get rrdtool working on \s-1AIX\s0 is to use the \s-1IBM\s0 \s-1XL\s0 C Compiler:
211 .PP
212 .Vb 2
213 \& export CC=/usr/vac/bin/cc
214 \& export PERLCC=$CC
215 .Ve
216 .PP
217 (Better instructions for \s-1AIX\s0 welcome!)
218 .Sh "Building Libraries"
219 .IX Subsection "Building Libraries"
220 In order to build the libraries you need a compiler on your system.
221 Unfortunately compilers are not all alike. This has an effect on the \s-1CFLAGS\s0
222 you want to set. The examples below are for the popular \s-1GCC\s0 compiler suite.
223 If you have an other compile you have to use the following settings:
224 .IP "Sun Forte" 4
225 .IX Item "Sun Forte"
226 .Vb 1
227 \& CFLAGS="\-xO3 \-kPIC"
228 .Ve
229 .IP "Building zlib" 4
230 .IX Item "Building zlib"
231 .Vb 7
232 \& cd $BUILD_DIR
233 \& wget http://oss.oetiker.ch/rrdtool/pub/libs/zlib\-1.2.3.tar.gz
234 \& tar  zxf zlib\-1.2.3.tar.gz
235 \& cd zlib\-1.2.3
236 \& env CFLAGS="\-O3 \-fPIC" ./configure \-\-prefix=$BUILD_DIR/lb
237 \& make
238 \& make install
239 .Ve
240 .IP "Building libpng" 4
241 .IX Item "Building libpng"
242 Libpng itself requires zlib to build, so we need to help a bit. If you
243 already have a copy of zlib on your system (which is very likley) you can
244 drop the settings of \s-1LDFLAGS\s0 and \s-1CPPFLAGS\s0. Note that the backslash (\e) at
245 the end of line 4 means that line 4 and line 5 are on one line.
246 .Sp
247 .Vb 8
248 \& cd $BUILD_DIR
249 \& wget http://oss.oetiker.ch/rrdtool/pub/libs/libpng\-1.2.10.tar.gz
250 \& tar zxvf libpng\-1.2.10.tar.gz
251 \& cd libpng\-1.2.10
252 \& env CPPFLAGS="\-I$BUILD_DIR/lb/include" LDFLAGS="\-L$BUILD_DIR/lb/lib" CFLAGS="\-O3 \-fPIC" \e
253 \&     ./configure \-\-disable\-shared \-\-prefix=$BUILD_DIR/lb
254 \& make
255 \& make install
256 .Ve
257 .IP "Building freetype" 4
258 .IX Item "Building freetype"
259 .Vb 8
260 \& cd $BUILD_DIR
261 \& wget http://oss.oetiker.ch/rrdtool/pub/libs/freetype\-2.1.10.tar.bz2
262 \& tar jxvf freetype\-2.1.10.tar.bz2
263 \& cd freetype\-2.1.10
264 \& env CPPFLAGS="\-I$BUILD_DIR/lb/include" LDFLAGS="\-L$BUILD_DIR/lb/lib" CFLAGS="\-O3 \-fPIC" \e
265 \&     ./configure \-\-disable\-shared \-\-prefix=$BUILD_DIR/lb
266 \& make
267 \& make install
268 .Ve
269 .Sp
270 If you run into problems building freetype on Solaris, you may want to try to
271 add the following at the end of the configure line:
272 .Sp
273 .Vb 1
274 \& GNUMAKE=gmake EGREP=egrep
275 .Ve
276 .IP "Building libart_lgpl" 4
277 .IX Item "Building libart_lgpl"
278 .Vb 7
279 \& cd $BUILD_DIR
280 \& wget http://oss.oetiker.ch/rrdtool/pub/libs/libart_lgpl\-2.3.17.tar.gz
281 \& tar zxvf libart_lgpl\-2.3.17.tar.gz
282 \& cd libart_lgpl\-2.3.17
283 \& env CFLAGS="\-O3 \-fPIC" ./configure \-\-disable\-shared \-\-prefix=$BUILD_DIR/lb
284 \& make
285 \& make install
286 .Ve
287 .PP
288 Now all the dependent libraries are built and you can try again. Since these
289 are static libraries, you may have to use \fIranlib\fR to make them accessible.
290 Especially \s-1BSD\s0 systems like Mac \s-1OS\s0 X may require this, Linux and Solaris
291 will do just fine without since their \fIar\fR command does ranlibs job as well.
292 .PP
293 .Vb 1
294 \& ranlib $BUILD_DIR/lb/lib/*.a
295 .Ve
296 .PP
297 This time you tell configure where it should be looking for libraries and
298 include files. This is done via environment variables. Depending on the
299 shell you are running, the syntax for setting environment variables is
300 different. Under csh/tcsh you use:
301 .PP
302 .Vb 4
303 \& set IR=\-I$BUILD_DIR/lb/include
304 \& setenv CPPFLAGS "$IR $IR/libart\-2.0 $IR/freetype2 $IR/libpng"
305 \& setenv LDFLAGS  \-L$BUILD_DIR/lb/lib
306 \& setenv CFLAGS \-O3
307 .Ve
308 .PP
309 If you are running bash/sh/ash/ksh/zsh use this:
310 .PP
311 .Vb 5
312 \& IR=\-I$BUILD_DIR/lb/include
313 \& CPPFLAGS="$IR $IR/libart\-2.0 $IR/freetype2 $IR/libpng"
314 \& LDFLAGS="\-L$BUILD_DIR/lb/lib"
315 \& CFLAGS=\-O3
316 \& export CPPFLAGS LDFLAGS CFLAGS
317 .Ve
318 .PP
319 And finally try building again. We disable the python and tcl bindings
320 because it seems that a fair number of people have ill configured python and
321 tcl setups that would prevent rrdtool from building if they are included in
322 their current state.
323 .PP
324 .Vb 5
325 \& cd $BUILD_DIR/rrdtool\-1.2.26
326 \& ./configure \-\-prefix=$INSTALL_DIR \-\-disable\-python \-\-disable\-tcl
327 \& make clean
328 \& make
329 \& make install
330 .Ve
331 .PP
332 \&\s-1SOLARIS\s0 \s-1HINT:\s0 if you want to build  the perl module for the native perl (the
333 one shipping with solaris) you will need the sun forte compiler
334 installed on your box or you have to hand-tune bindings/perl\-shared/Makefile
335 while building!
336 .PP
337 Now go to \fI$INSTALL_DIR\fR\fB/share/rrdtool/examples/\fR and run them to see if your
338 build has been successful.
339 .SH "AUTHOR"
340 .IX Header "AUTHOR"
341 Tobias Oetiker <tobi@oetiker.ch>