1 RRDBUILD(1) rrdtool RRDBUILD(1)
6 rrdbuild - Instructions for building RRDtool
9 If you downloaded the source of rrdtool you have to compile it. This
10 document will give some information on how this is done.
12 RRDtool relies on services of third part libraries. Some of these
13 libraries may already be installed on your system. You have to compile
14 copies of the other ones before you can build RRDtool.
16 This document will tell you about all the necessary steps to get going.
20 pilation or if you know what you are doing just replace the export bits
21 with setenv.
23 We further assume that your copies of t\bta\bar\br and m\bma\bak\bke\be are actually G\bGN\bNU\bU t\bta\bar\br
24 and G\bGN\bNU\bU m\bma\bak\bke\be respectively. It could be that they are installed as g\bgt\bta\bar\br
28 Before you start to build RRDtool, you have to decide two things:
30 1. In which directory you want to build the software.
32 2. Where you want to install the software.
34 Once you have decided. Save the two locations into environment vari-
35 ables.
37 BUILD_DIR=/tmp/rrdbuild
38 INSTALL_DIR=/usr/local/rrdtool-1.3.7
41 you have to choose a different directory!
43 Now make sure the BUILD_DIR exists and go there:
45 mkdir -p $BUILD_DIR
46 cd $BUILD_DIR
48 Lets first assume you already have all the necessary libraries
49 pre-installed.
51 wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.3.7.tar.gz
52 gunzip -c rrdtool-1.3.7.tar.gz | tar xf -
53 cd rrdtool-1.3.7
54 ./configure --prefix=$INSTALL_DIR && make && make install
56 Ok, this was very optimistic. This try will probably have ended with
60 If your OS lets you install additional packages from a software reposi-
61 tory, you may get away with installing the missing packages. When the
62 packages are installed, run configure again and try to compile again.
63 Below you find some hints on getting your OS ready for the rrdtool com-
64 pilation.
66 Additions to this list are welcome. In general rrdtool should work with
67 the latest versions of the libraries. The versions listed here are just
68 what was current when I tested this.
72 Just add a compiler and the gnome development package:
74 pkg install sunstudioexpress
75 pkg install SUNWgnome-common-devel
78 der is required for compilation with cairo. This is not true and also
79 bad since OpenSolaris does not include an _\bx_\br_\be_\bn_\bd_\be_\br_\b._\bp_\bc file. Use Perl to
80 fix this:
82 perl -i~ -p -e 's/(Requires.*?)\s*xrender.*/$1/' /usr/lib/pkgconfig/cairo.pc
84 Make sure rrdtool finds your new compiler
86 export PATH=/opt/SunStudioExpress/bin
88 Since there does not seem to be a viable msgfmt tool on OpenSolaris
89 (short of installing it yourself). You have to call configure with the
91 --disable-libintl
93 option.
97 Use apt-get to make sure you have all that is required. A number of
98 packages will get added through dependencies.
100 apt-get install libpango1.0-dev libxml2-dev
106 system. The only thing you should care about are USE flags, which allow
107 you fine tune features rrdtool will be built with. Currently the fol-
108 lowing USE flags are available:
110 doc - install .html and .txt documentation
111 into /usr/share/doc/rrdtool-1.x.xx/
112 perl - build and install perl language bindings
113 python - build and install python language bindings
114 ruby - build and install ruby language bindings
115 tcl - build and install tcl language bindings
116 rrdcgi - build and install rrdcgi
118 After you've decided which USE flags you need, set them either in
119 _\bm_\ba_\bk_\be_\b._\bc_\bo_\bn_\bf or _\b/_\be_\bt_\bc_\b/_\bp_\bo_\br_\bt_\ba_\bg_\be_\b/_\bp_\ba_\bc_\bk_\ba_\bg_\be_\b._\bu_\bs_\be and finally run:
121 # emerge -va rrdtool
123 Take a look at Gentoo handbook for further details on how to manage USE
124 flags: http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2
127 But again this may have been too optimistic still, and you actually
128 have to compile your own copies of some of the required libraries.
129 Things like libpng and zlib are pretty standard so you will probably
130 have them on your system anyway. Freetype, Fontinst, Cairo, Pango may
131 be installed, but it is possible that they are pretty old and thus
132 don't live up to our expectations, so you may want to compile their
133 latest versions.
137 If you are working with AIX, you may find the -\b--\b-d\bdi\bis\bsa\bab\bbl\ble\be-\b-s\bsh\bha\bar\bre\bed\bd option
138 will cause things to break for you. In that case you may have to
139 install the shared libraries into the rrdtool PREFIX and work with
142 Another hint to get rrdtool working on AIX is to use the IBM XL C Com-
143 piler:
145 export CC=/usr/vac/bin/cc
146 export PERLCC=$CC
148 (Better instructions for AIX welcome!)
152 Some libraries want to know where other libraries are. For this to
153 work, set the following environment variable
155 export PKG_CONFIG_PATH=${INSTALL_DIR}/lib/pkgconfig
156 export PATH=$INSTALL_DIR/bin:$PATH
159 find instructions on how to compile pkgconfig.
161 Since we are compiling libraries dynamically, they must know where to
162 find each other. This is done by setting an appropriate LDFLAGS. Unfor-
163 tunately, the syntax again differs from system to system:
165 Solaris
166 export LDFLAGS=-R${INSTALL_DIR}/lib
168 if you are using the Sun Studio/Forte compiler, you may also want
169 to set
171 export CFLAGS="-xO3 -xcode=pic13" (SPARC)
172 export CFLAGS="-xO3 -Kpic" (x86)
174 Linux
175 export CFLAGS="-O3 -fPIC"
176 export LDFLAGS="-Wl,--rpath -Wl,${INSTALL_DIR}/lib"
178 HPUX
179 export LDFLAGS="+b${INSTALL_DIR}/lib"
181 AIX
182 export LDFLAGS="-Wl,-blibpath:${INSTALL_DIR}/lib"
184 If you have GNU make installed and it is not called 'make', then do
186 export MAKE=gmake
187 export GNUMAKE=gmake
189 otherwise just do
191 export MAKE=make
195 As mentioned above, without pkgconfig the whole build process will be
196 lots of pain and suffering, so make sure you have a copy on your sys-
197 tem. If it is not available natively, here is how to compile it.
199 wget http://pkgconfig.freedesktop.org/releases/pkg-config-0.23.tar.gz
200 gunzip -c pkg-config-0.23.tar.gz | tar xf -
201 cd pkg-config-0.23
202 ./configure --prefix=$INSTALL_DIR
203 $MAKE
204 $MAKE install
206 After installing pkgconfig in a custom directory, setting up the corre-
207 sponding environment variable will be helpful.
209 export PKG_CONFIG=$INSTALL_DIR/bin/pkg-config
213 Chances are very high that you already have that on your system ...
215 cd $BUILD_DIR
216 wget http://oss.oetiker.ch/rrdtool/pub/libs/zlib-1.2.3.tar.gz
217 gunzip -c zlib-1.2.3.tar.gz | tar xf -
218 cd zlib-1.2.3
219 ./configure --prefix=$INSTALL_DIR --shared
220 $MAKE
221 $MAKE install
225 Libpng itself requires zlib to build, so we need to help a bit. If you
226 already have a copy of zlib on your system (which is very likely) you
227 can drop the settings of LDFLAGS and CPPFLAGS. Note that the backslash
228 (\) at the end of line 4 means that line 4 and line 5 are on one line.
230 cd $BUILD_DIR
231 wget http://oss.oetiker.ch/rrdtool/pub/libs/libpng-1.2.18.tar.gz
232 gunzip -c libpng-1.2.18.tar.gz | tar xf -
233 cd libpng-1.2.18
234 ./configure --prefix=$INSTALL_DIR
235 $MAKE
236 $MAKE install
240 cd $BUILD_DIR
241 wget http://oss.oetiker.ch/rrdtool/pub/libs/freetype-2.3.5.tar.gz
242 gunzip -c freetype-2.3.5.tar.gz | tar xf -
243 cd freetype-2.3.5
244 ./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC"
245 $MAKE
246 $MAKE install
248 If you run into problems building freetype on Solaris, you may want to
249 try to add the following at the start the configure line:
251 env EGREP=egrep
255 cd $BUILD_DIR
256 wget http://oss.oetiker.ch/rrdtool/pub/libs/libxml2-2.6.32.tar.gz
257 gunzip -c libxml2-2.6.32.tar.gz | tar xf -
258 cd libxml2-2.6.32
259 ./configure --prefix=$INSTALL_DIR
260 $MAKE
261 $MAKE install
265 Note that fontconfig has a run time configuration file in
266 INSTALL_DIR/etc you may want to adjust that so that fontconfig finds
267 the fonts on your system. Run the fc-cache program to build the font-
268 config cache after changing the config file.
270 cd $BUILD_DIR
271 wget http://oss.oetiker.ch/rrdtool/pub/libs/fontconfig-2.4.2.tar.gz
272 gunzip -c fontconfig-2.4.2.tar.gz | tar xf -
273 cd fontconfig-2.4.2
274 ./configure --prefix=$INSTALL_DIR --with-freetype-config=$INSTALL_DIR/bin/freetype-config
275 $MAKE
276 $MAKE install
280 cd $BUILD_DIR
281 wget http://oss.oetiker.ch/rrdtool/pub/libs/pixman-0.10.0.tar.gz
282 gunzip -c pixman-0.10.0.tar.gz | tar xf -
283 cd pixman-0.10.0
284 ./configure --prefix=$INSTALL_DIR
285 $MAKE
286 $MAKE install
290 cd $BUILD_DIR
291 wget http://oss.oetiker.ch/rrdtool/pub/libs/cairo-1.6.4.tar.gz
292 gunzip -c cairo-1.6.4.tar.gz | tar xf -
293 cd cairo-1.6.4
294 ./configure --prefix=$INSTALL_DIR \
295 --enable-xlib=no \
296 --enable-xlib-render=no \
297 --enable-win32=no
298 $MAKE
299 $MAKE install
303 cd $BUILD_DIR
304 wget http://oss.oetiker.ch/rrdtool/pub/libs/glib-2.15.4.tar.gz
305 gunzip -c glib-2.15.4.tar.gz | tar xf -
306 cd glib-2.15.4
307 ./configure --prefix=$INSTALL_DIR
308 $MAKE
309 $MAKE install
313 cd $BUILD_DIR
314 wget http://oss.oetiker.ch/rrdtool/pub/libs/pango-1.21.1.tar.bz2
315 bunzip2 -c pango-1.21.1.tar.bz2 | tar xf -
316 cd pango-1.21.1
317 ./configure --prefix=$INSTALL_DIR --without-x
318 $MAKE
319 $MAKE install
321 B\bBu\bui\bil\bld\bdi\bin\bng\bg r\brr\brd\bdt\bto\boo\bol\bl (\b(s\bse\bec\bco\bon\bnd\bd t\btr\bry\by)\b)
323 Now all the dependent libraries are built and you can try again. This
324 time you tell configure where it should be looking for libraries and
325 include files. This is done via environment variables. Depending on the
326 shell you are running, the syntax for setting environment variables is
327 different.
329 And finally try building again. We disable the python and tcl bindings
330 because it seems that a fair number of people have ill configured
331 python and tcl setups that would prevent rrdtool from building if they
332 are included in their current state.
334 cd $BUILD_DIR/rrdtool-1.3.7
335 ./configure --prefix=$INSTALL_DIR --disable-tcl --disable-python
336 $MAKE clean
337 $MAKE
338 $MAKE install
340 SOLARIS HINT: if you want to build the Perl module for the native Perl
341 (the one shipping with Solaris) you will need the Sun Forte compiler
342 installed on your box or you have to hand-tune bind-
343 ings/perl-shared/Makefile while building!
345 Now go to _\b$_\bI_\bN_\bS_\bT_\bA_\bL_\bL_\b__\bD_\bI_\bR/\b/s\bsh\bha\bar\bre\be/\b/r\brr\brd\bdt\bto\boo\bol\bl/\b/e\bex\bxa\bam\bmp\bpl\ble\bes\bs/\b/ and run them to see if
346 your build has been successful.
349 Tobias Oetiker <tobi@oetiker.ch>
353 1.3.7 2009-04-07 RRDBUILD(1)