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="#description">DESCRIPTION</a></li>
20 <ul>
22 <li><a href="#overview">Overview</a></li>
23 <li><a href="#building">Building</a></li>
24 <ul>
26 <li><a href="#build_tipps_for_aix">Build Tipps for AIX</a></li>
27 </ul>
29 <li><a href="#building_libraries">Building Libraries</a></li>
30 </ul>
32 <li><a href="#author">AUTHOR</a></li>
33 </ul>
34 -->
35 <!-- INDEX END -->
37 <p>
38 </p>
39 <h1><a name="name">NAME</a></h1>
40 <p>rrdbuild - Instructions for building RRDtool</p>
41 <p>
42 </p>
43 <hr />
44 <h1><a name="description">DESCRIPTION</a></h1>
45 <p>
46 </p>
47 <h2><a name="overview">Overview</a></h2>
48 <p>If you downloaded the source of rrdtool you have to compile it. This
49 document will give some information on how this is done.</p>
50 <p>RRDtool relies on services of thrid part libraries. Some of these libraries
51 may already be installed on your system. You have to compile copies of the other
52 ones before you can build RRDtool.</p>
53 <p>This document will tell you about all the necessary steps to get going.</p>
54 <p>
55 </p>
56 <h2><a name="building">Building</a></h2>
57 <p>Before you start to build RRDtool, you have to decide two things:</p>
58 <ol>
59 <li>
60 <p>In which directory you want to build the software.</p>
61 </li>
62 <li>
63 <p>Where you want to install the software.</p>
64 </li>
65 </ol>
66 <p>Once you have decided. Save the two locations into environment variables.
67 Depending on the shell you are using, you can do either (bash,zsh):</p>
68 <pre>
69 BUILD_DIR=/tmp/rrdbuild
70 INSTALL_DIR=/usr/local/rrdtool-1.2.26</pre>
71 <p>Or if you run tcsh:</p>
72 <pre>
73 set BUILD_DIR=/tmp/rrdbuild
74 set INSTALL_DIR=/usr/local/rrdtool-1.2.26</pre>
75 <p>If your <em>/tmp</em> is mounted with the option noexec (RHEL seems todo that) you have to choose
76 a different directory!</p>
77 <p>Now make sure the BUILD_DIR exists and go there:</p>
78 <pre>
79 mkdir -p $BUILD_DIR
80 cd $BUILD_DIR</pre>
81 <p>Lets first assume you already have all the necessary libraries
82 pre-installed. Note that these instructions assume that your copies of
83 <strong>tar</strong> and <strong>make</strong> are actually <strong>GNU tar</strong> and <strong>GNU make</strong> respectively. It
84 could be that they are installed as <strong>gtar</strong> and <strong>gmake</strong> on your system.</p>
85 <pre>
86 wget <a href="http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.2.26.tar.gz">http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.2.26.tar.gz</a>
87 tar zxf rrdtool-1.2.26.tar.gz
88 cd rrdtool-1.2.26
89 ./configure --prefix=$INSTALL_DIR && make && make install</pre>
90 <p>Ok, this was very optimistic. This try will probably have ended with
91 <strong>configure</strong> complaining about several missing libraries. If you are on a
92 Linux or *bsd system you may want to just install the missing bits from your
93 software repository. When you do that, make sure you also get the <strong>-dev</strong>
94 package for each library you install. Once you have the missing bits on
95 board, just re-run the last line of the instructions above.</p>
96 <p>But again this may have been too optimistic, and you actually have to
97 compile your own copies of the required libraries.</p>
98 <p>
99 </p>
100 <h3><a name="build_tipps_for_aix">Build Tipps for AIX</a></h3>
101 <p>If you are woking with AIX, you may find the the <strong>--disable-shared</strong> option
102 will cause things to break for you. In that case you may have to install the
103 shared libraries into the rrdtool PREFIX and work with <strong>--disable-static</strong>
104 instead.</p>
105 <p>Another hint to get rrdtool working on AIX is to use the IBM XL C Compiler:</p>
106 <pre>
107 export CC=/usr/vac/bin/cc
108 export PERLCC=$CC</pre>
109 <p>(Better instructions for AIX welcome!)</p>
110 <p>
111 </p>
112 <h2><a name="building_libraries">Building Libraries</a></h2>
113 <p>In order to build the libraries you need a compiler on your system.
114 Unfortunately compilers are not all alike. This has an effect on the CFLAGS
115 you want to set. The examples below are for the popular GCC compiler suite.
116 If you have an other compile you have to use the following settings:</p>
117 <dl>
118 <dt><strong><a name="item_sun_forte">Sun Forte</a></strong>
120 <dd>
121 <pre>
122 CFLAGS="-xO3 -kPIC"</pre>
123 </dd>
124 </dl>
125 <dl>
126 <dt><strong><a name="item_building_zlib">Building zlib</a></strong>
128 <dd>
129 <pre>
130 cd $BUILD_DIR
131 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>
132 tar zxf zlib-1.2.3.tar.gz
133 cd zlib-1.2.3
134 env CFLAGS="-O3 -fPIC" ./configure --prefix=$BUILD_DIR/lb
135 make
136 make install</pre>
137 </dd>
138 <dt><strong><a name="item_building_libpng">Building libpng</a></strong>
140 <dd>
141 <p>Libpng itself requires zlib to build, so we need to help a bit. If you
142 already have a copy of zlib on your system (which is very likley) you can
143 drop the settings of LDFLAGS and CPPFLAGS. Note that the backslash (\) at
144 the end of line 4 means that line 4 and line 5 are on one line.</p>
145 </dd>
146 <dd>
147 <pre>
148 cd $BUILD_DIR
149 wget <a href="http://oss.oetiker.ch/rrdtool/pub/libs/libpng-1.2.10.tar.gz">http://oss.oetiker.ch/rrdtool/pub/libs/libpng-1.2.10.tar.gz</a>
150 tar zxvf libpng-1.2.10.tar.gz
151 cd libpng-1.2.10
152 env CPPFLAGS="-I$BUILD_DIR/lb/include" LDFLAGS="-L$BUILD_DIR/lb/lib" CFLAGS="-O3 -fPIC" \
153 ./configure --disable-shared --prefix=$BUILD_DIR/lb
154 make
155 make install</pre>
156 </dd>
157 </li>
158 <dt><strong><a name="item_building_freetype">Building freetype</a></strong>
160 <dd>
161 <pre>
162 cd $BUILD_DIR
163 wget <a href="http://oss.oetiker.ch/rrdtool/pub/libs/freetype-2.1.10.tar.bz2">http://oss.oetiker.ch/rrdtool/pub/libs/freetype-2.1.10.tar.bz2</a>
164 tar jxvf freetype-2.1.10.tar.bz2
165 cd freetype-2.1.10
166 env CPPFLAGS="-I$BUILD_DIR/lb/include" LDFLAGS="-L$BUILD_DIR/lb/lib" CFLAGS="-O3 -fPIC" \
167 ./configure --disable-shared --prefix=$BUILD_DIR/lb
168 make
169 make install</pre>
170 </dd>
171 <dd>
172 <p>If you run into problems building freetype on Solaris, you may want to try to
173 add the following at the end of the configure line:</p>
174 </dd>
175 <dd>
176 <pre>
177 GNUMAKE=gmake EGREP=egrep</pre>
178 </dd>
179 <dt><strong><a name="item_building_libart_lgpl">Building libart_lgpl</a></strong>
181 <dd>
182 <pre>
183 cd $BUILD_DIR
184 wget <a href="http://oss.oetiker.ch/rrdtool/pub/libs/libart_lgpl-2.3.17.tar.gz">http://oss.oetiker.ch/rrdtool/pub/libs/libart_lgpl-2.3.17.tar.gz</a>
185 tar zxvf libart_lgpl-2.3.17.tar.gz
186 cd libart_lgpl-2.3.17
187 env CFLAGS="-O3 -fPIC" ./configure --disable-shared --prefix=$BUILD_DIR/lb
188 make
189 make install</pre>
190 </dd>
191 </dl>
192 <p>Now all the dependent libraries are built and you can try again. Since these
193 are static libraries, you may have to use <em>ranlib</em> to make them accessible.
194 Especially BSD systems like Mac OS X may require this, Linux and Solaris
195 will do just fine without since their <em>ar</em> command does ranlibs job as well.</p>
196 <pre>
197 ranlib $BUILD_DIR/lb/lib/*.a</pre>
198 <p>This time you tell configure where it should be looking for libraries and
199 include files. This is done via environment variables. Depending on the
200 shell you are running, the syntax for setting environment variables is
201 different. Under csh/tcsh you use:</p>
202 <pre>
203 set IR=-I$BUILD_DIR/lb/include
204 setenv CPPFLAGS "$IR $IR/libart-2.0 $IR/freetype2 $IR/libpng"
205 setenv LDFLAGS -L$BUILD_DIR/lb/lib
206 setenv CFLAGS -O3</pre>
207 <p>If you are running bash/sh/ash/ksh/zsh use this:</p>
208 <pre>
209 IR=-I$BUILD_DIR/lb/include
210 CPPFLAGS="$IR $IR/libart-2.0 $IR/freetype2 $IR/libpng"
211 LDFLAGS="-L$BUILD_DIR/lb/lib"
212 CFLAGS=-O3
213 export CPPFLAGS LDFLAGS CFLAGS</pre>
214 <p>And finally try building again. We disable the python and tcl bindings
215 because it seems that a fair number of people have ill configured python and
216 tcl setups that would prevent rrdtool from building if they are included in
217 their current state.</p>
218 <pre>
219 cd $BUILD_DIR/rrdtool-1.2.26
220 ./configure --prefix=$INSTALL_DIR --disable-python --disable-tcl
221 make clean
222 make
223 make install</pre>
224 <p>SOLARIS HINT: if you want to build the perl module for the native perl (the
225 one shipping with solaris) you will need the sun forte compiler
226 installed on your box or you have to hand-tune bindings/perl-shared/Makefile
227 while building!</p>
228 <p>Now go to <em>$INSTALL_DIR</em><strong>/share/rrdtool/examples/</strong> and run them to see if your
229 build has been successful.</p>
230 <p>
231 </p>
232 <hr />
233 <h1><a name="author">AUTHOR</a></h1>
234 <p>Tobias Oetiker <<a href="mailto:tobi@oetiker.ch">tobi@oetiker.ch</a>></p>
236 </body>
238 </html>