Code

d63f1396ae32288cb117ceb27afbeac8f5fad306
[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 D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
9        O\bOv\bve\ber\brv\bvi\bie\bew\bw
11        If you downloaded the source of rrdtool you have to compile it. This
12        document will give some information on how this is done.
14        RRDtool relies on services of thrid part libraries. Some of these
15        libraries may already be installed on your system. You have to compile
16        copies of the other ones before you can build RRDtool.
18        This document will tell you about all the necessary steps to get going.
20        B\bBu\bui\bil\bld\bdi\bin\bng\bg
22        Before you start to build RRDtool, you have to decide two things:
24        1.  In which directory you want to build the software.
26        2.  Where you want to install the software.
28        Once you have decided. Save the two locations into environment vari-
29        ables.  Depending on the shell you are using, you can do either
30        (bash,zsh):
32         BUILD_DIR=/tmp/rrdbuild
33         INSTALL_DIR=/usr/local/rrdtool-1.2.27
35        Or if you run tcsh:
37         set BUILD_DIR=/tmp/rrdbuild
38         set INSTALL_DIR=/usr/local/rrdtool-1.2.27
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. Note that these instructions assume that your copies of
50        t\bta\bar\br and m\bma\bak\bke\be are actually G\bGN\bNU\bU t\bta\bar\br and G\bGN\bNU\bU m\bma\bak\bke\be respectively. It could
51        be that they are installed as g\bgt\bta\bar\br and g\bgm\bma\bak\bke\be on your system.
53         wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.2.27.tar.gz
54         tar zxf rrdtool-1.2.27.tar.gz
55         cd rrdtool-1.2.27
56         ./configure --prefix=$INSTALL_DIR && make && make install
58        Ok, this was very optimistic. This try will probably have ended with
59        c\bco\bon\bnf\bfi\big\bgu\bur\bre\be complaining about several missing libraries. If you are on a
60        Linux or *bsd system you may want to just install the missing bits from
61        your software repository. When you do that, make sure you also get the
62        -\b-d\bde\bev\bv package for each library you install. Once you have the missing
63        bits on board, just re-run the last line of the instructions above.
65        But again this may have been too optimistic, and you actually have to
66        compile your own copies of the required libraries.
68        _\bB_\bu_\bi_\bl_\bd _\bT_\bi_\bp_\bp_\bs _\bf_\bo_\br _\bA_\bI_\bX
70        If you are woking 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
71        option will cause things to break for you. In that case you may have to
72        install the shared libraries into the rrdtool PREFIX and work with
73        -\b--\b-d\bdi\bis\bsa\bab\bbl\ble\be-\b-s\bst\bta\bat\bti\bic\bc instead.
75        Another hint to get rrdtool working on AIX is to use the IBM XL C Com-
76        piler:
78         export CC=/usr/vac/bin/cc
79         export PERLCC=$CC
81        (Better instructions for AIX welcome!)
83        B\bBu\bui\bil\bld\bdi\bin\bng\bg L\bLi\bib\bbr\bra\bar\bri\bie\bes\bs
85        In order to build the libraries you need a compiler on your system.
86        Unfortunately compilers are not all alike. This has an effect on the
87        CFLAGS you want to set. The examples below are for the popular GCC com-
88        piler suite.  If you have an other compile you have to use the follow-
89        ing settings:
91        Sun Forte
92             CFLAGS="-xO3 -kPIC"
94        Building zlib
95             cd $BUILD_DIR
96             wget http://oss.oetiker.ch/rrdtool/pub/libs/zlib-1.2.3.tar.gz
97             tar  zxf zlib-1.2.3.tar.gz
98             cd zlib-1.2.3
99             env CFLAGS="-O3 -fPIC" ./configure --prefix=$BUILD_DIR/lb
100             make
101             make install
103        Building libpng
104            Libpng itself requires zlib to build, so we need to help a bit. If
105            you already have a copy of zlib on your system (which is very lik-
106            ley) you can drop the settings of LDFLAGS and CPPFLAGS. Note that
107            the backslash (\) at the end of line 4 means that line 4 and line 5
108            are on one line.
110             cd $BUILD_DIR
111             wget http://oss.oetiker.ch/rrdtool/pub/libs/libpng-1.2.10.tar.gz
112             tar zxvf libpng-1.2.10.tar.gz
113             cd libpng-1.2.10
114             env CPPFLAGS="-I$BUILD_DIR/lb/include" LDFLAGS="-L$BUILD_DIR/lb/lib" CFLAGS="-O3 -fPIC" \
115                 ./configure --disable-shared --prefix=$BUILD_DIR/lb
116             make
117             make install
119        Building freetype
120             cd $BUILD_DIR
121             wget http://oss.oetiker.ch/rrdtool/pub/libs/freetype-2.1.10.tar.bz2
122             tar jxvf freetype-2.1.10.tar.bz2
123             cd freetype-2.1.10
124             env CPPFLAGS="-I$BUILD_DIR/lb/include" LDFLAGS="-L$BUILD_DIR/lb/lib" CFLAGS="-O3 -fPIC" \
125                 ./configure --disable-shared --prefix=$BUILD_DIR/lb
126             make
127             make install
129            If you run into problems building freetype on Solaris, you may want
130            to try to add the following at the end of the configure line:
132             GNUMAKE=gmake EGREP=egrep
134        Building libart_lgpl
135             cd $BUILD_DIR
136             wget http://oss.oetiker.ch/rrdtool/pub/libs/libart_lgpl-2.3.17.tar.gz
137             tar zxvf libart_lgpl-2.3.17.tar.gz
138             cd libart_lgpl-2.3.17
139             env CFLAGS="-O3 -fPIC" ./configure --disable-shared --prefix=$BUILD_DIR/lb
140             make
141             make install
143        Now all the dependent libraries are built and you can try again. Since
144        these are static libraries, you may have to use _\br_\ba_\bn_\bl_\bi_\bb to make them
145        accessible.  Especially BSD systems like Mac OS X may require this,
146        Linux and Solaris will do just fine without since their _\ba_\br command does
147        ranlibs job as well.
149         ranlib $BUILD_DIR/lb/lib/*.a
151        This time you tell configure where it should be looking for libraries
152        and include files. This is done via environment variables. Depending on
153        the shell you are running, the syntax for setting environment variables
154        is different. Under csh/tcsh you use:
156         set IR=-I$BUILD_DIR/lb/include
157         setenv CPPFLAGS "$IR $IR/libart-2.0 $IR/freetype2 $IR/libpng"
158         setenv LDFLAGS  -L$BUILD_DIR/lb/lib
159         setenv CFLAGS -O3
161        If you are running bash/sh/ash/ksh/zsh use this:
163         IR=-I$BUILD_DIR/lb/include
164         CPPFLAGS="$IR $IR/libart-2.0 $IR/freetype2 $IR/libpng"
165         LDFLAGS="-L$BUILD_DIR/lb/lib"
166         CFLAGS=-O3
167         export CPPFLAGS LDFLAGS CFLAGS
169        And finally try building again. We disable the python and tcl bindings
170        because it seems that a fair number of people have ill configured
171        python and tcl setups that would prevent rrdtool from building if they
172        are included in their current state.
174         cd $BUILD_DIR/rrdtool-1.2.27
175         ./configure --prefix=$INSTALL_DIR --disable-python --disable-tcl
176         make clean
177         make
178         make install
180        SOLARIS HINT: if you want to build  the perl module for the native perl
181        (the one shipping with solaris) you will need the sun forte compiler
182        installed on your box or you have to hand-tune bind-
183        ings/perl-shared/Makefile while building!
185        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
186        your build has been successful.
188 A\bAU\bUT\bTH\bHO\bOR\bR
189        Tobias Oetiker <tobi@oetiker.ch>
193 1.2.27                            2008-02-17                       RRDBUILD(1)