Code

Imported upstream version 1.3rc4.
[pkg-rrdtool.git] / doc / rrdbuild.html
1 <?xml version="1.0" ?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
4 <head>
5 <title>rrdbuild</title>
6 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
7 <link rev="made" href="mailto:root@localhost" />
8 </head>
10 <body style="background-color: white">
12 <p><a name="__index__"></a></p>
13 <!-- INDEX BEGIN -->
14 <!--
16 <ul>
18         <li><a href="#name">NAME</a></li>
19         <li><a href="#overview">OVERVIEW</a></li>
20         <li><a href="#optimistic_build">OPTIMISTIC BUILD</a></li>
21         <li><a href="#installing_dependencies">INSTALLING DEPENDENCIES</a></li>
22         <ul>
24                 <li><a href="#opensolaris_2008_05">OpenSolaris 2008.05</a></li>
25                 <li><a href="#debian___ubuntu">Debian / Ubuntu</a></li>
26         </ul>
28         <li><a href="#building_dependencies">BUILDING DEPENDENCIES</a></li>
29         <ul>
31                 <ul>
33                         <li><a href="#build_tipps_for_aix">Build Tipps for AIX</a></li>
34                 </ul>
36                 <li><a href="#building_libraries">Building Libraries</a></li>
37         </ul>
39         <li><a href="#author">AUTHOR</a></li>
40 </ul>
41 -->
42 <!-- INDEX END -->
44 <p>
45 </p>
46 <h1><a name="name">NAME</a></h1>
47 <p>rrdbuild - Instructions for building RRDtool</p>
48 <p>
49 </p>
50 <hr />
51 <h1><a name="overview">OVERVIEW</a></h1>
52 <p>If you downloaded the source of rrdtool you have to compile it. This
53 document will give some information on how this is done.</p>
54 <p>RRDtool relies on services of thrid part libraries. Some of these libraries
55 may already be installed on your system. You have to compile copies of the other
56 ones before you can build RRDtool.</p>
57 <p>This document will tell you about all the necessary steps to get going.</p>
58 <p>These instructions assume you are using a <strong>bash</strong> shell. If you use csh/tcsh,
59 then you can either type <em>bash</em> to switch to bash for the compilation or if
60 you know what you are doing just replace the export bits with
61 setenv.</p>
62 <p>We further assume that your copies of <strong>tar</strong> and <strong>make</strong> are actually <strong>GNU
63 tar</strong> and <strong>GNU make</strong> respectively. It could be that they are installed as
64 <strong>gtar</strong> and <strong>gmake</strong> on your system.</p>
65 <p>
66 </p>
67 <hr />
68 <h1><a name="optimistic_build">OPTIMISTIC BUILD</a></h1>
69 <p>Before you start to build RRDtool, you have to decide two things:</p>
70 <ol>
71 <li>
72 <p>In which directory you want to build the software.</p>
73 </li>
74 <li>
75 <p>Where you want to install the software.</p>
76 </li>
77 </ol>
78 <p>Once you have decided. Save the two locations into environment variables.</p>
79 <pre>
80  BUILD_DIR=/tmp/rrdbuild
81  INSTALL_DIR=/usr/local/rrdtool-1.3rc4</pre>
82 <p>If your <em>/tmp</em> is mounted with the option noexec (RHEL seems todo that) you have to choose
83 a different directory!</p>
84 <p>Now make sure the BUILD_DIR exists and go there:</p>
85 <pre>
86  mkdir -p $BUILD_DIR
87  cd $BUILD_DIR</pre>
88 <p>Lets first assume you already have all the necessary libraries
89 pre-installed.</p>
90 <pre>
91  wget <a href="http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.3rc4.tar.gz">http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.3rc4.tar.gz</a>
92  gunzip -c rrdtool-1.3rc4.tar.gz | tar xf -
93  cd rrdtool-1.3rc4
94  ./configure --prefix=$INSTALL_DIR &amp;&amp; make &amp;&amp; make install</pre>
95 <p>Ok, this was very optimistic. This try will probably have ended with
96 <strong>configure</strong> complaining about several missing libraries.</p>
97 <p>
98 </p>
99 <hr />
100 <h1><a name="installing_dependencies">INSTALLING DEPENDENCIES</a></h1>
101 <p>If your OS lets you install additional packages from a software repository,
102 you may get away with installing the missing packages. When the packages are
103 installed, run configure again and try to compile again. Below you find some
104 hints on getting your OS ready for the rrdtool compilation. Additions to
105 this list are welcome.</p>
106 <p>
107 </p>
108 <h2><a name="opensolaris_2008_05">OpenSolaris 2008.05</a></h2>
109 <p>Just add a compiler and the gnome development package:</p>
110 <pre>
111  pkg install sunstudioexpress
112  pkg install SUNWgnome-common-devel</pre>
113 <p>There is a a problem with <em>cairo.pc</em> on opensolaris. It suggests that
114 xrender is required for compilation with cairo. This is not true and also
115 bad since opensolaris does not include an <em>xrender.pc</em> file. Use perl to
116 fix this:</p>
117 <pre>
118  perl -i~ -p -e 's/(Requires.*?)\s*xrender.*/$1/' /usr/lib/pkgconfig/cairo.pc</pre>
119 <p>
120 </p>
121 <h2><a name="debian___ubuntu">Debian / Ubuntu</a></h2>
122 <p>Use apt-get to make sure you have all that is required. A number
123 of packages will get added through dependencies.</p>
124 <pre>
125  apt-get install libpango1.0-dev libxml2-dev</pre>
126 <p>
127 </p>
128 <hr />
129 <h1><a name="building_dependencies">BUILDING DEPENDENCIES</a></h1>
130 <p>But again this may have been too optimistic still, and you actually have to
131 compile your own copies of some of the required libraries. Things like
132 libpng and zlib are pretty standard so you will probably have them on your
133 system anyway. Freetype, Fontinst, Cairo, Pango may be installed, but it is
134 possible that they are pretty old and thus don't live up to the
135 expectations, so you may want to compile their latest versions.</p>
136 <p>
137 </p>
138 <h3><a name="build_tipps_for_aix">Build Tipps for AIX</a></h3>
139 <p>If you are woking with AIX, you may find the the <strong>--disable-shared</strong> option
140 will cause things to break for you. In that case you may have to install the
141 shared libraries into the rrdtool PREFIX and work with <strong>--disable-static</strong>
142 instead.</p>
143 <p>Another hint to get rrdtool working on AIX is to use the IBM XL C Compiler:</p>
144 <pre>
145  export CC=/usr/vac/bin/cc
146  export PERLCC=$CC</pre>
147 <p>(Better instructions for AIX welcome!)</p>
148 <p>
149 </p>
150 <h2><a name="building_libraries">Building Libraries</a></h2>
151 <p>In order to build the libraries you need a compiler on your system.
152 Unfortunately compilers are not all alike. This has an effect on the CFLAGS
153 you want to set. The examples below are for the popular GCC compiler suite.
154 If you have an other compile you have to use the following settings:</p>
155 <dl>
156 <dt><strong><a name="item_sun_forte">Sun Forte</a></strong>
158 <dd>
159 <pre>
160  CFLAGS=&quot;-xO3 -kPIC&quot;</pre>
161 </dd>
162 </dl>
163 <p>Some libraries want to know where other libraries are. For this to work,
164 set the following environamen variable</p>
165 <pre>
166  export PKG_CONFIG_PATH=${INSTALL_DIR}/lib/pkgconfig
167  export PATH=$INSTALL_DIR/bin:$PATH</pre>
168 <p>Since we are compiling libraries dynamically, you they must further know
169 where to find each other. This is done by setting an appropriate LDFLAG.
170 Unfortunatly the syntax differs from system to system:</p>
171 <dl>
172 <dt><strong><a name="item_solaris">Solaris</a></strong>
174 <dd>
175 <pre>
176  export LDFLAGS=-R${INSTALL_DIR}/lib</pre>
177 </dd>
178 <dt><strong><a name="item_linux">Linux</a></strong>
180 <dd>
181 <pre>
182  export LDFLAGS=&quot;-Wl,--rpath -Wl,${INSTALL_DIR}/lib&quot;</pre>
183 </dd>
184 <dd>
185 <p>If you are on a 64bit platform, but would like to continue to use the rrd files created
186 on your old 32bit linux, you may be able</p>
187 </dd>
188 <dt><strong><a name="item_hpux">HPUX</a></strong>
190 <dd>
191 <pre>
193  export LDFLAGS=&quot;+b${INSTALL_DIR}/lib&quot;</pre>
194 </dd>
195 <dt><strong><a name="item_aix">AIX</a></strong>
197 <dd>
198 <pre>
199  export LDFLAGS=&quot;-Wl,-blibpath:${INSTALL_DIR}/lib&quot;</pre>
200 </dd>
201 <p>If you have GNUmake installed and it is not called 'make',
202 then do</p>
203 <pre>
204  export MAKE=gmake
205  export GNUMAKE=gmake</pre>
206 <p>otherwhise just do</p>
207 <pre>
208  export MAKE=make</pre>
209 <dl>
210 <dt><strong><a name="item_building_zlib">Building zlib</a></strong>
212 <dd>
213 <p>Chances are very high that you already have that on your system ...</p>
214 </dd>
215 <dd>
216 <pre>
217  cd $BUILD_DIR
218  wget <a href="http://oss.oetiker.ch/rrdtool/pub/libs/zlib-1.2.3.tar.gz">http://oss.oetiker.ch/rrdtool/pub/libs/zlib-1.2.3.tar.gz</a>
219  gunzip -c zlib-1.2.3.tar.gz | tar xf -
220  cd zlib-1.2.3
221  ./configure --prefix=$INSTALL_DIR CFLAGS=&quot;-O3 -fPIC&quot; --shared
222  $MAKE
223  $MAKE install</pre>
224 </dd>
225 </li>
226 <dt><strong><a name="item_building_libpng">Building libpng</a></strong>
228 <dd>
229 <p>Libpng itself requires zlib to build, so we need to help a bit. If you
230 already have a copy of zlib on your system (which is very likley) you can
231 drop the settings of LDFLAGS and CPPFLAGS. Note that the backslash (\) at
232 the end of line 4 means that line 4 and line 5 are on one line.</p>
233 </dd>
234 <dd>
235 <pre>
236  cd $BUILD_DIR
237  wget <a href="http://oss.oetiker.ch/rrdtool/pub/libs/libpng-1.2.18.tar.gz">http://oss.oetiker.ch/rrdtool/pub/libs/libpng-1.2.18.tar.gz</a>
238  gunzip -c libpng-1.2.18.tar.gz | tar xf -
239  cd libpng-1.2.10
240  env CFLAGS=&quot;-O3 -fPIC&quot; ./configure --prefix=$INSTALL_DIR
241  $MAKE
242  $MAKE install</pre>
243 </dd>
244 </li>
245 <dt><strong><a name="item_building_freetype">Building freetype</a></strong>
247 <dd>
248 <pre>
249  cd $BUILD_DIR
250  wget <a href="http://oss.oetiker.ch/rrdtool/pub/libs/freetype-2.3.5.tar.gz">http://oss.oetiker.ch/rrdtool/pub/libs/freetype-2.3.5.tar.gz</a>
251  gunzip -c freetype-2.3.5.tar.gz | tar xf -
252  cd freetype-2.3.5
253  ./configure --prefix=$INSTALL_DIR CFLAGS=&quot;-O3 -fPIC&quot;
254  $MAKE
255  $MAKE install</pre>
256 </dd>
257 <dd>
258 <p>If you run into problems building freetype on Solaris, you may want to try to
259 add the following at the start the configure line:</p>
260 </dd>
261 <dd>
262 <pre>
263  env EGREP=egrep</pre>
264 </dd>
265 <dt><strong><a name="item_building_libxml2">Building LibXML2</a></strong>
267 <dd>
268 <pre>
269  cd $BUILD_DIR
270  wget <a href="http://oss.oetiker.ch/rrdtool/pub/libs/libxml2-sources-2.6.31.tar.gz">http://oss.oetiker.ch/rrdtool/pub/libs/libxml2-sources-2.6.31.tar.gz</a>
271  gunzip -c libxml2-sources-2.6.32.tar.gz | tar xf -
272  cd libxml2-sources-2.6.32
273  ./configure --prefix=$INSTALL_DIR CFLAGS=&quot;-O3 -fPIC&quot;
274  $MAKE
275  $MAKE install</pre>
276 </dd>
277 <dt><strong><a name="item_building_fontconfig">Building fontconfig</a></strong>
279 <dd>
280 <p>Note that fontconfig has a runtime configuration file in INSTALL_DIR/etc you
281 may want to adjust that so that fontconfig finds the fonts on your system.
282 Run the fc-cache program to build the fontconfig cache after changeing the
283 config file.</p>
284 </dd>
285 <dd>
286 <pre>
287  cd $BUILD_DIR
288  wget <a href="http://oss.oetiker.ch/rrdtool/pub/libs/fontconfig-2.4.2.tar.gz">http://oss.oetiker.ch/rrdtool/pub/libs/fontconfig-2.4.2.tar.gz</a>
289  gunzip -c fontconfig-2.4.2.tar.gz   | tar xf -
290  cd fontconfig-2.4.2
291  ./configure --prefix=$INSTALL_DIR CFLAGS=&quot;-O3 -fPIC&quot;
292  $MAKE
293  $MAKE install</pre>
294 </dd>
295 </li>
296 <dt><strong><a name="item_building_pixman">Building Pixman</a></strong>
298 <dd>
299 <pre>
300  cd $BUILD_DIR
301  wget <a href="http://oss.oetiker.ch/rrdtool/pub/libs/pixman-0.10.0.tar.gz">http://oss.oetiker.ch/rrdtool/pub/libs/pixman-0.10.0.tar.gz</a>
302  gunzip -c pixman-0.10.0.tar.gz  | tar xf -
303  cd fontconfig-2.4.2
304  ./configure --prefix=$INSTALL_DIR CFLAGS=&quot;-O3 -fPIC&quot;
305  $MAKE
306  $MAKE install</pre>
307 </dd>
308 <dt><strong><a name="item_building_cairo">Building Cairo</a></strong>
310 <dd>
311 <pre>
312  cd $BUILD_DIR
313  wget <a href="http://oss.oetiker.ch/rrdtool/pub/libs/cairo-1.6.4.tar.gz">http://oss.oetiker.ch/rrdtool/pub/libs/cairo-1.6.4.tar.gz</a>
314  gunzip -c cairo-1.4.10.tar.gz   | tar xf -
315  cd cairo-1.4.10
316  ./configure --prefix=$INSTALL_DIR \
317     --enable-xlib=no \
318     --enable-xlib-render=no \
319     --enable-win32=no \
320     CFLAGS=&quot;-O3 -fPIC&quot;
321  $MAKE
322  $MAKE install</pre>
323 </dd>
324 <dt><strong><a name="item_building_glib">Building Glib</a></strong>
326 <dd>
327 <pre>
328  cd $BUILD_DIR
329  wget <a href="http://oss.oetiker.ch/rrdtool/pub/libs/glib-2.15.4.tar.gz">http://oss.oetiker.ch/rrdtool/pub/libs/glib-2.15.4.tar.gz</a>
330  gunzip -c glib-2.12.13.tar.gz  | tar xf -
331  cd glib-2.12.13
332  ./configure --prefix=$INSTALL_DIR CFLAGS=&quot;-O3 -fPIC&quot;
333  $MAKE
334  $MAKE install</pre>
335 </dd>
336 <dt><strong><a name="item_building_pango">Building Pango</a></strong>
338 <dd>
339 <pre>
340  cd $BUILD_DIR
341  wget <a href="http://oss.oetiker.ch/rrdtool/pub/libs/pango-1.21.1.tar.gz">http://oss.oetiker.ch/rrdtool/pub/libs/pango-1.21.1.tar.gz</a>
342  gunzip -c pango-1.21.1.tar.gz  | tar xf -
343  cd pango-1.21.1
344  ./configure --prefix=$INSTALL_DIR CFLAGS=&quot;-O3 -fPIC&quot; --without-x
345  $MAKE
346  $MAKE install</pre>
347 </dd>
348 </dl>
349 <p>Now all the dependent libraries are built and you can try again. This time
350 you tell configure where it should be looking for libraries and include
351 files. This is done via environment variables. Depending on the shell you
352 are running, the syntax for setting environment variables is different.</p>
353 <p>And finally try building again. We disable the python and tcl bindings
354 because it seems that a fair number of people have ill configured python and
355 tcl setups that would prevent rrdtool from building if they are included in
356 their current state.</p>
357 <pre>
358  cd $BUILD_DIR/rrdtool-1.3rc4
359  ./configure --prefix=$INSTALL_DIR --disable-tcl --disable-python
360  $MAKE clean
361  $MAKE
362  $MAKE install</pre>
363 <p>SOLARIS HINT: if you want to build  the perl module for the native perl (the
364 one shipping with solaris) you will need the sun forte compiler installed on
365 your box or you have to hand-tune bindings/perl-shared/Makefile while
366 building!</p>
367 <p>Now go to <em>$INSTALL_DIR</em><strong>/share/rrdtool/examples/</strong> and run them to see if
368 your build has been successful.</p>
369 <p>
370 </p>
371 <hr />
372 <h1><a name="author">AUTHOR</a></h1>
373 <p>Tobias Oetiker &lt;<a href="mailto:tobi@oetiker.ch">tobi@oetiker.ch</a>&gt;
375 </p>
377 </body>
379 </html>