1RRDBUILD(1) rrdtool RRDBUILD(1)
2
3
4
6 rrdbuild - Instructions for building RRDtool
7
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.
11
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.
15
16 This document will tell you about all the necessary steps to get going.
17
18 These instructions assume you are using a bash shell. If you use
19 csh/tcsh, then you can either type bash to switch to bash for the
20 compilation or if you know what you are doing just replace the export
21 bits with setenv.
22
23 We further assume that your copies of tar and make are actually GNU tar
24 and GNU make respectively. It could be that they are installed as gtar
25 and gmake on your system.
26
28 Before you start to build RRDtool, you have to decide two things:
29
30 1. In which directory you want to build the software.
31
32 2. Where you want to install the software.
33
34 Once you have decided. Save the two locations into environment
35 variables.
36
37 BUILD_DIR=/tmp/rrdbuild
38 INSTALL_DIR=/opt/rrdtool-1.7.0
39
40 If your /tmp is mounted with the option noexec (RHEL seems todo that)
41 you have to choose a different directory!
42
43 Now make sure the BUILD_DIR exists and go there:
44
45 mkdir -p $BUILD_DIR
46 cd $BUILD_DIR
47
48 Lets first assume you already have all the necessary libraries pre-
49 installed.
50
51 wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.7.0.tar.gz
52 gunzip -c rrdtool-1.7.0.tar.gz | tar xf -
53 cd rrdtool-1.7.0
54 ./configure --prefix=$INSTALL_DIR && make && make install
55
56 Ok, this was very optimistic. This try will probably have ended with
57 configure complaining about several missing libraries.
58
60 If your OS lets you install additional packages from a software
61 repository, you may get away with installing the missing packages. When
62 the packages are installed, run configure again and try to compile
63 again. Below you find some hints on getting your OS ready for compiling
64 RRDtool.
65
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.
69
70 OpenSolaris 2008.05
71 Just add a compiler and the gnome development package:
72
73 pkg install sunstudioexpress
74 pkg install SUNWgnome-common-devel
75
76 There is a problem with cairo.pc on OpenSolaris. It suggests that
77 xrender is required for compilation with cairo. This is not true and
78 also bad since OpenSolaris does not include an xrender.pc file. Use
79 Perl to fix this:
80
81 perl -i~ -p -e 's/(Requires.*?)\s*xrender.*/$1/' /usr/lib/pkgconfig/cairo.pc
82
83 Make sure the RRDtool build system finds your new compiler
84
85 export PATH=/opt/SunStudioExpress/bin
86
87 Debian / Ubuntu
88 Use apt-get to make sure you have all that is required. A number of
89 packages will get added through dependencies.
90
91 apt-get install libpango1.0-dev libxml2-dev
92
93 Gentoo
94 In Gentoo installing RRDtool is really simple you just need to emerge
95 rrdtool. All dependencies will be handled automatically by the portage
96 system. The only thing you should care about are USE flags, which allow
97 you fine tune features RRDtool will be built with. Currently the
98 following USE flags are available:
99
100 doc - install .html and .txt documentation
101 into /usr/share/doc/rrdtool-1.x.xx/
102 perl - build and install perl language bindings
103 python - build and install python language bindings
104 ruby - build and install ruby language bindings
105 tcl - build and install tcl language bindings
106 rrdcgi - build and install rrdcgi
107
108 After you've decided which USE flags you need, set them either in
109 make.conf or /etc/portage/package.use and finally run:
110
111 # emerge -va rrdtool
112
113 Take a look at Gentoo handbook for further details on how to manage USE
114 flags: http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2
115
117 But again this may have been too optimistic still, and you actually
118 have to compile your own copies of some of the required libraries.
119 Things like libpng and zlib are pretty standard so you will probably
120 have them on your system anyway. Freetype, Fontinst, Cairo, Pango may
121 be installed, but it is possible that they are pretty old and thus
122 don't live up to our expectations, so you may want to compile their
123 latest versions.
124
125 General build tips for AIX
126 If you are working with AIX, you may find the --disable-shared option
127 will cause things to break for you. In that case you may have to
128 install the shared libraries into the RRDtool PREFIX and work with
129 --disable-static instead.
130
131 Another hint to get RRDtool working on AIX is to use the IBM XL C
132 Compiler:
133
134 export CC=/usr/vac/bin/cc
135 export PERLCC=$CC
136
137 (Better instructions for AIX welcome!)
138
139 Build Instructions
140 Some libraries want to know where other libraries are. For this to
141 work, set the following environment variable
142
143 export PKG_CONFIG_PATH=${INSTALL_DIR}/lib/pkgconfig
144 export PATH=$INSTALL_DIR/bin:$PATH
145
146 The above relies on the presence of the pkgconfig program. Below you
147 find instructions on how to compile pkgconfig.
148
149 Since we are compiling libraries dynamically, they must know where to
150 find each other. This is done by setting an appropriate LDFLAGS.
151 Unfortunately, the syntax again differs from system to system:
152
153 Solaris
154 export LDFLAGS=-R${INSTALL_DIR}/lib
155
156 if you are using the Sun Studio/Forte compiler, you may also want
157 to set
158
159 CFLAGS="-xO3 -xcode=pic13" (SPARC)
160 CFLAGS="-xO3 -Kpic" (x86)
161
162 Linux
163 export LDFLAGS="-Wl,--rpath -Wl,${INSTALL_DIR}/lib"
164
165 HPUX
166 export LDFLAGS="+b${INSTALL_DIR}/lib"
167
168 AIX
169 export LDFLAGS="-Wl,-blibpath:${INSTALL_DIR}/lib"
170
171 If you have GNU make installed and it is not called 'make', then do
172
173 export MAKE=gmake
174 export GNUMAKE=gmake
175
176 otherwise just do
177
178 export MAKE=make
179
180 Building pkgconfig
181
182 As mentioned above, without pkgconfig the whole build process will be
183 lots of pain and suffering, so make sure you have a copy on your
184 system. If it is not available natively, here is how to compile it.
185
186 wget http://pkgconfig.freedesktop.org/releases/pkg-config-0.23.tar.gz
187 gunzip -c pkg-config-0.23.tar.gz | tar xf -
188 cd pkg-config-0.23
189 ./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC"
190 $MAKE
191 $MAKE install
192
193 After installing pkgconfig in a custom directory, setting up the
194 corresponding environment variable will be helpful.
195
196 export PKG_CONFIG=$INSTALL_DIR/bin/pkg-config
197
198 Building zlib
199
200 Chances are very high that you already have that on your system ...
201
202 cd $BUILD_DIR
203 wget http://oss.oetiker.ch/rrdtool/pub/libs/zlib-1.2.3.tar.gz
204 gunzip -c zlib-1.2.3.tar.gz | tar xf -
205 cd zlib-1.2.3
206 ./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC" --shared
207 $MAKE
208 $MAKE install
209
210 Building libpng
211
212 Libpng itself requires zlib to build, so we need to help a bit. If you
213 already have a copy of zlib on your system (which is very likely) you
214 can drop the settings of LDFLAGS and CPPFLAGS. Note that the backslash
215 (\) at the end of line 4 means that line 4 and line 5 are on one line.
216
217 cd $BUILD_DIR
218 wget http://oss.oetiker.ch/rrdtool/pub/libs/libpng-1.2.18.tar.gz
219 gunzip -c libpng-1.2.18.tar.gz | tar xf -
220 cd libpng-1.2.18
221 env CFLAGS="-O3 -fPIC" ./configure --prefix=$INSTALL_DIR
222 $MAKE
223 $MAKE install
224
225 Building freetype
226
227 cd $BUILD_DIR
228 wget http://oss.oetiker.ch/rrdtool/pub/libs/freetype-2.3.5.tar.gz
229 gunzip -c freetype-2.3.5.tar.gz | tar xf -
230 cd freetype-2.3.5
231 ./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC"
232 $MAKE
233 $MAKE install
234
235 If you run into problems building freetype on Solaris, you may want to
236 try to add the following at the start the configure line:
237
238 env EGREP=egrep
239
240 Building LibXML2
241
242 cd $BUILD_DIR
243 wget http://oss.oetiker.ch/rrdtool/pub/libs/libxml2-2.6.32.tar.gz
244 gunzip -c libxml2-2.6.32.tar.gz | tar xf -
245 cd libxml2-2.6.32
246 ./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC"
247 $MAKE
248 $MAKE install
249
250 Building fontconfig
251
252 Note that fontconfig has a run time configuration file in
253 INSTALL_DIR/etc you may want to adjust that so that fontconfig finds
254 the fonts on your system. Run the fc-cache program to build the
255 fontconfig cache after changing the config file.
256
257 cd $BUILD_DIR
258 wget http://oss.oetiker.ch/rrdtool/pub/libs/fontconfig-2.4.2.tar.gz
259 gunzip -c fontconfig-2.4.2.tar.gz | tar xf -
260 cd fontconfig-2.4.2
261 ./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC" --with-freetype-config=$INSTALL_DIR/bin/freetype-config
262 $MAKE
263 $MAKE install
264
265 Building Pixman
266
267 cd $BUILD_DIR
268 wget http://oss.oetiker.ch/rrdtool/pub/libs/pixman-0.10.0.tar.gz
269 gunzip -c pixman-0.10.0.tar.gz | tar xf -
270 cd pixman-0.10.0
271 ./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC"
272 $MAKE
273 $MAKE install
274
275 Building Cairo
276
277 cd $BUILD_DIR
278 wget http://oss.oetiker.ch/rrdtool/pub/libs/cairo-1.6.4.tar.gz
279 gunzip -c cairo-1.6.4.tar.gz | tar xf -
280 cd cairo-1.6.4
281 ./configure --prefix=$INSTALL_DIR \
282 --enable-xlib=no \
283 --enable-xlib-render=no \
284 --enable-win32=no \
285 CFLAGS="-O3 -fPIC"
286 $MAKE
287 $MAKE install
288
289 When building on Solaris you may want todo
290
291 ./configure --prefix=$INSTALL_DIR \
292 --enable-xlib=no \
293 --enable-xlib-render=no \
294 --enable-win32=no \
295 CFLAGS="-O3 -fPIC -D_POSIX_PTHREAD_SEMANTICS"
296
297 Building Glib
298
299 cd $BUILD_DIR
300 wget http://oss.oetiker.ch/rrdtool/pub/libs/glib-2.15.4.tar.gz
301 gunzip -c glib-2.15.4.tar.gz | tar xf -
302 cd glib-2.15.4
303 ./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC"
304 $MAKE
305 $MAKE install
306
307 Building Pango
308
309 cd $BUILD_DIR
310 wget http://oss.oetiker.ch/rrdtool/pub/libs/pango-1.21.1.tar.bz2
311 bunzip2 -c pango-1.21.1.tar.bz2 | tar xf -
312 cd pango-1.21.1
313 ./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC" --without-x
314 $MAKE
315 $MAKE install
316
317 Building rrdtool (second try)
318 Now all the dependent libraries are built and you can try again. This
319 time you tell configure where it should be looking for libraries and
320 include files. This is done via environment variables. Depending on the
321 shell you are running, the syntax for setting environment variables is
322 different.
323
324 And finally try building again. We disable the python and tcl bindings
325 because it seems that a fair number of people have ill configured
326 python and tcl setups that would prevent RRDtool from building if they
327 are included in their current state.
328
329 cd $BUILD_DIR/rrdtool-1.7.0
330 ./configure --prefix=$INSTALL_DIR --disable-tcl --disable-python
331 $MAKE clean
332 $MAKE
333 $MAKE install
334
335 SOLARIS HINT: if you want to build the Perl module for the native Perl
336 (the one shipping with Solaris) you will need the Sun Forte compiler
337 installed on your box or you have to hand-tune
338 bindings/perl-shared/Makefile while building!
339
340 Now go to $INSTALL_DIR/share/rrdtool/examples/ and run them to see if
341 your build has been successful.
342
344 Tobias Oetiker <tobi@oetiker.ch>
345
346
347
3481.7.0 2017-05-16 RRDBUILD(1)