Code

Imported upstream version 1.3rc9.
[pkg-rrdtool.git] / doc / rrdbuild.txt
1 RRDBUILD(1)                         rrdtool                        RRDBUILD(1)
5 N\bNA\bAM\bME\bE
6        rrdbuild - Instructions for building RRDtool
8 O\bOV\bVE\bER\bRV\bVI\bIE\bEW\bW
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.
18        These instructions assume you are using a b\bba\bas\bsh\bh shell. If you use
19        csh/tcsh, then you can either type _\bb_\ba_\bs_\bh to switch to bash for the com-
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
25        and g\bgm\bma\bak\bke\be on your system.
27 O\bOP\bPT\bTI\bIM\bMI\bIS\bST\bTI\bIC\bC B\bBU\bUI\bIL\bLD\bD
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.3rc9
40        If your _\b/_\bt_\bm_\bp is mounted with the option noexec (RHEL seems todo that)
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.3rc9.tar.gz
52         gunzip -c rrdtool-1.3rc9.tar.gz | tar xf -
53         cd rrdtool-1.3rc9
54         ./configure --prefix=$INSTALL_DIR && make && make install
56        Ok, this was very optimistic. This try will probably have ended with
57        c\bco\bon\bnf\bfi\big\bgu\bur\bre\be complaining about several missing libraries.
59 I\bIN\bNS\bST\bTA\bAL\bLL\bLI\bIN\bNG\bG D\bDE\bEP\bPE\bEN\bND\bDE\bEN\bNC\bCI\bIE\bES\bS
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.
68        O\bOp\bpe\ben\bnS\bSo\bol\bla\bar\bri\bis\bs 2\b20\b00\b08\b8.\b.0\b05\b5
70        Just add a compiler and the gnome development package:
72         pkg install sunstudioexpress
73         pkg install SUNWgnome-common-devel
75        There is a problem with _\bc_\ba_\bi_\br_\bo_\b._\bp_\bc on opensolaris. It suggests that xren-
76        der is required for compilation with cairo. This is not true and also
77        bad since opensolaris does not include an _\bx_\br_\be_\bn_\bd_\be_\br_\b._\bp_\bc file. Use perl to
78        fix this:
80         perl -i~ -p -e 's/(Requires.*?)\s*xrender.*/$1/' /usr/lib/pkgconfig/cairo.pc
82        D\bDe\beb\bbi\bia\ban\bn /\b/ U\bUb\bbu\bun\bnt\btu\bu
84        Use apt-get to make sure you have all that is required. A number of
85        packages will get added through dependencies.
87         apt-get install libpango1.0-dev libxml2-dev
89        G\bGe\ben\bnt\bto\boo\bo
91        In Gentoo installing rrdtool is really simple you just need to e\bem\bme\ber\brg\bge\be
92        r\brr\brd\bdt\bto\boo\bol\bl. All dependencies will be handled automatically by the portage
93        system. The only thing you should care about are USE flags, which allow
94        you fine tune features rrdtool will be built with. Currently the fol-
95        lowing USE flags are available:
97         doc    - install .html and .txt documentation
98                  into /usr/share/doc/rrdtool-1.x.xx/
99         perl   - build and install perl language bindings
100         python - build and install python language bindings
101         ruby   - build and install ruby language bindings
102         tcl    - build and install tcl language bindings
103         rrdcgi - build and install rrdcgi
105        After you've decided which USE flags you need, set them either in
106        _\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:
108         # emerge -va rrdtool
110        Take a look at Gentoo handbook for further details on how to manage USE
111        flags: http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=2
113 B\bBU\bUI\bIL\bLD\bDI\bIN\bNG\bG D\bDE\bEP\bPE\bEN\bND\bDE\bEN\bNC\bCI\bIE\bES\bS
114        But again this may have been too optimistic still, and you actually
115        have to compile your own copies of some of the required libraries.
116        Things like libpng and zlib are pretty standard so you will probably
117        have them on your system anyway. Freetype, Fontinst, Cairo, Pango may
118        be installed, but it is possible that they are pretty old and thus
119        don't live up to our expectations, so you may want to compile their
120        latest versions.
122        _\bB_\bu_\bi_\bl_\bd _\bT_\bi_\bp_\bs _\bf_\bo_\br _\bA_\bI_\bX
124        If you are working with AIX, you may find the the -\b--\b-d\bdi\bis\bsa\bab\bbl\ble\be-\b-s\bsh\bha\bar\bre\bed\bd
125        option will cause things to break for you. In that case you may have to
126        install the shared libraries into the rrdtool PREFIX and work with
127        -\b--\b-d\bdi\bis\bsa\bab\bbl\ble\be-\b-s\bst\bta\bat\bti\bic\bc instead.
129        Another hint to get rrdtool working on AIX is to use the IBM XL C Com-
130        piler:
132         export CC=/usr/vac/bin/cc
133         export PERLCC=$CC
135        (Better instructions for AIX welcome!)
137        B\bBu\bui\bil\bld\bdi\bin\bng\bg L\bLi\bib\bbr\bra\bar\bri\bie\bes\bs
139        In order to build the libraries you need a compiler on your system.
140        Unfortunately compilers are not all alike. This has an effect on the
141        CFLAGS you want to set. The examples below are for the popular GCC com-
142        piler suite.  If you have an other compilers here are some ides:
144        Sun Forte
145             CFLAGS="-xO3 -kPIC"
147            Some libraries want to know where other libraries are. For this to
148            work, set the following environment variable
150             export PKG_CONFIG_PATH=${INSTALL_DIR}/lib/pkgconfig
151             export PATH=$INSTALL_DIR/bin:$PATH
153            This relies on the presence of the _\bp_\bk_\bg_\bc_\bo_\bn_\bf_\bi_\bg program. Below you
154            find instructions on how to compile pkgconfig as well.
156            Since we are compiling libraries dynamically, they must know where
157            to find each other. This is done by setting an appropriate LDFLAGS.
158            Unfortunately, the syntax again differs from system to system:
160            Solaris
161                 export LDFLAGS=-R${INSTALL_DIR}/lib
163            Linux
164                 export LDFLAGS="-Wl,--rpath -Wl,${INSTALL_DIR}/lib"
166            HPUX
167                 export LDFLAGS="+b${INSTALL_DIR}/lib"
169            AIX
170                 export LDFLAGS="-Wl,-blibpath:${INSTALL_DIR}/lib"
172            If you have GNUmake installed and it is not called 'make', then do
174             export MAKE=gmake
175             export GNUMAKE=gmake
177            otherwise just do
179             export MAKE=make
181        Building pkgconfig
182            As mentioned above, without pkgconfig the whole build process will
183            be 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.
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
193        Building zlib
194            Chances are very high that you already have that on your system ...
196             cd $BUILD_DIR
197             wget http://oss.oetiker.ch/rrdtool/pub/libs/zlib-1.2.3.tar.gz
198             gunzip -c zlib-1.2.3.tar.gz | tar xf -
199             cd zlib-1.2.3
200             ./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC" --shared
201             $MAKE
202             $MAKE install
204        Building libpng
205            Libpng itself requires zlib to build, so we need to help a bit. If
206            you already have a copy of zlib on your system (which is very
207            likely) you can drop the settings of LDFLAGS and CPPFLAGS. Note
208            that the backslash (\) at the end of line 4 means that line 4 and
209            line 5 are on one line.
211             cd $BUILD_DIR
212             wget http://oss.oetiker.ch/rrdtool/pub/libs/libpng-1.2.18.tar.gz
213             gunzip -c libpng-1.2.18.tar.gz | tar xf -
214             cd libpng-1.2.10
215             env CFLAGS="-O3 -fPIC" ./configure --prefix=$INSTALL_DIR
216             $MAKE
217             $MAKE install
219        Building freetype
220             cd $BUILD_DIR
221             wget http://oss.oetiker.ch/rrdtool/pub/libs/freetype-2.3.5.tar.gz
222             gunzip -c freetype-2.3.5.tar.gz | tar xf -
223             cd freetype-2.3.5
224             ./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC"
225             $MAKE
226             $MAKE install
228            If you run into problems building freetype on Solaris, you may want
229            to try to add the following at the start the configure line:
231             env EGREP=egrep
233        Building LibXML2
234             cd $BUILD_DIR
235             wget http://oss.oetiker.ch/rrdtool/pub/libs/libxml2-sources-2.6.31.tar.gz
236             gunzip -c libxml2-sources-2.6.32.tar.gz | tar xf -
237             cd libxml2-sources-2.6.32
238             ./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC"
239             $MAKE
240             $MAKE install
242        Building fontconfig
243            Note that fontconfig has a run time configuration file in
244            INSTALL_DIR/etc you may want to adjust that so that fontconfig
245            finds the fonts on your system.  Run the fc-cache program to build
246            the fontconfig cache after changing the config file.
248             cd $BUILD_DIR
249             wget http://oss.oetiker.ch/rrdtool/pub/libs/fontconfig-2.4.2.tar.gz
250             gunzip -c fontconfig-2.4.2.tar.gz   | tar xf -
251             cd fontconfig-2.4.2
252             ./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC"
253             $MAKE
254             $MAKE install
256        Building Pixman
257             cd $BUILD_DIR
258             wget http://oss.oetiker.ch/rrdtool/pub/libs/pixman-0.10.0.tar.gz
259             gunzip -c pixman-0.10.0.tar.gz  | tar xf -
260             cd pixman-0.10.0
261             ./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC"
262             $MAKE
263             $MAKE install
265        Building Cairo
266             cd $BUILD_DIR
267             wget http://oss.oetiker.ch/rrdtool/pub/libs/cairo-1.6.4.tar.gz
268             gunzip -c cairo-1.4.10.tar.gz   | tar xf -
269             cd cairo-1.4.10
270             ./configure --prefix=$INSTALL_DIR \
271                --enable-xlib=no \
272                --enable-xlib-render=no \
273                --enable-win32=no \
274                CFLAGS="-O3 -fPIC"
275             $MAKE
276             $MAKE install
278        Building Glib
279             cd $BUILD_DIR
280             wget http://oss.oetiker.ch/rrdtool/pub/libs/glib-2.15.4.tar.gz
281             gunzip -c glib-2.12.13.tar.gz  | tar xf -
282             cd glib-2.12.13
283             ./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC"
284             $MAKE
285             $MAKE install
287        Building Pango
288             cd $BUILD_DIR
289             wget http://oss.oetiker.ch/rrdtool/pub/libs/pango-1.21.1.tar.gz
290             gunzip -c pango-1.21.1.tar.gz  | tar xf -
291             cd pango-1.21.1
292             ./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC" --without-x
293             $MAKE
294             $MAKE install
296        Now all the dependent libraries are built and you can try again. This
297        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.
302        And finally try building again. We disable the python and tcl bindings
303        because it seems that a fair number of people have ill configured
304        python and tcl setups that would prevent rrdtool from building if they
305        are included in their current state.
307         cd $BUILD_DIR/rrdtool-1.3rc9
308         ./configure --prefix=$INSTALL_DIR --disable-tcl --disable-python
309         $MAKE clean
310         $MAKE
311         $MAKE install
313        SOLARIS HINT: if you want to build  the perl module for the native perl
314        (the one shipping with Solaris) you will need the sun forte compiler
315        installed on your box or you have to hand-tune bind-
316        ings/perl-shared/Makefile while building!
318        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
319        your build has been successful.
321 A\bAU\bUT\bTH\bHO\bOR\bR
322        Tobias Oetiker <tobi@oetiker.ch>
326 1.3rc9                            2008-06-08                       RRDBUILD(1)