addeed AIX instructions
[rrdtool.git] / doc / rrdbuild.pod
1 =head1 NAME
2
3 rrdbuild - Instructions for building RRDtool
4
5 =head1 DESCRIPTION
6
7 =head2 Overview
8
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 thrid part libraries. Some of these libraries
13 may already be installed on your system. You have to compile copies of the other
14 ones before you can build RRDtool.
15
16 This document will tell you about all the necessary steps to get going.
17
18 =head2 Building
19
20 Before you start to build RRDtool, you have to decide two things:
21
22 =over
23
24 =item 1.
25
26 In which directory you want to build the software.
27
28 =item 2.
29
30 Where you want to install the software.
31
32 =back
33
34 Once you have decided. Save the two locations into environment variables.
35 Depending on the shell you are using, you can do either (bash,zsh):
36
37  BUILD_DIR=/tmp/rrdbuild
38  INSTALL_DIR=/usr/local/rrdtool-1.2.13
39
40 Or if you run tcsh:
41
42  set BUILD_DIR=/tmp/rrdbuild
43  set INSTALL_DIR=/usr/local/rrdtool-1.2.13
44
45 Now make sure the BUILD_DIR exists and go there:
46
47  mkdir -p $BUILD_DIR
48  cd $BUILD_DIR
49
50 Lets first assume you already have all the necessary libraries
51 pre-installed. Note that these instructions assume that your copies of
52 B<tar> and B<make> are actually B<GNU tar> and B<GNU make> respectively. It
53 could be that they are installed as B<gtar> and B<gmake> on your system.
54
55  wget http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.2.13.tar.gz
56  tar zxf rrdtool-1.2.13.tar.gz
57  cd rrdtool-1.2.13
58  ./configure --prefix=$INSTALL_DIR && make && make install
59
60 Ok, this was very optimistic. This try will probably have ended with
61 B<configure> complaining about several missing libraries. If you are on a
62 Linux or *bsd system you may want to just install the missing bits from your
63 software repository. When you do that, make sure you also get the B<-dev>
64 package for each library you install. Once you have the missing bits on
65 board, just re-run the last line of the instructions above.
66
67 But again this may have been too optimistic, and you actually have to
68 compile your own copies of the required libraries.
69
70 If you are woking with AIX, you may find the the B<--disable-shared> option
71 will cause things to break for you. In that case you may have to install the
72 shared libraries into the rrdtool PREFIX and work with B<--disable-static>
73 instead. (Better instructions for AIX welcome!)
74
75 =over
76
77 =item Building zlib
78
79  cd $BUILD_DIR
80  wget http://oss.oetiker.ch/rrdtool/pub/libs/zlib-1.2.3.tar.gz
81  tar  zxf zlib-1.2.3.tar.gz
82  cd zlib-1.2.2
83  env CFLAGS="-O3 -fPIC" ./configure --prefix=$BUILD_DIR/lb
84  make
85  make install
86
87 =item Building libpng
88
89 Libpng itself requires zlib to build, so we need to help a bit. If you
90 already have a copy of zlib on your system (which is very likley) you can
91 drop the settings of LDFLAGS and CPPFLAGS. Note that the backslash (\) at
92 the end of line 4 means that line 4 and line 5 are on one line.
93
94  cd $BUILD_DIR
95  wget http://oss.oetiker.ch/rrdtool/pub/libs/libpng-1.2.8-config.tar.gz
96  tar zxvf libpng-1.2.10.tar.gz
97  cd libpng-1.2.10
98  env CPPFLAGS="-I$BUILD_DIR/lb/include" LDFLAGS="-L$BUILD_DIR/lb/lib" CFLAGS="-O3 -fPIC" \
99      ./configure --disable-shared --prefix=$BUILD_DIR/lb
100  make
101  make install
102
103 =item Building freetype
104
105  cd $BUILD_DIR
106  wget http://oss.oetiker.ch/rrdtool/pub/libs/freetype-2.1.10.tar.bz2
107  tar jxvf freetype-2.1.10.tar.bz2
108  cd freetype-2.1.10
109  env CPPFLAGS="-I$BUILD_DIR/lb/include" LDFLAGS="-L$BUILD_DIR/lb/lib" CFLAGS="-O3 -fPIC" \
110      ./configure --disable-shared --prefix=$BUILD_DIR/lb
111  make
112  make install
113
114 If you run into problems building freetype on Solaris, you may want to try to
115 add the following at the end of the configure line:
116
117  GNUMAKE=gmake EGREP=egrep
118
119 =item Building libart_lgpl
120
121  cd $BUILD_DIR
122  wget http://oss.oetiker.ch/rrdtool/pub/libs/libart_lgpl-2.3.17.tar.gz
123  tar zxvf libart_lgpl-2.3.17.tar.gz
124  cd libart_lgpl-2.3.17
125  env CFLAGS="-O3 -fPIC" ./configure --disable-shared --prefix=$BUILD_DIR/lb
126  make
127  make install
128
129 =back
130
131 Now all the dependent libraries are built and you can try again. Since these
132 are static libraries, you may have to use F<ranlib> to make them accessible.
133 Especially BSD systems like Mac OS X may require this, Linux and Solaris
134 will do just fine without since their F<ar> command does ranlibs job as well.
135
136  ranlib $BUILD_DIR/lb/lib/*.a
137
138 This time you tell configure where it should be looking for libraries and
139 include files. This is done via environment variables. Depending on the
140 shell you are running, the syntax for setting environment variables is
141 different. Under csh/tcsh you use:
142
143  set IR=-I$BUILD_DIR/lb/include
144  setenv CPPFLAGS "$IR $IR/libart-2.0 $IR/freetype2 $IR/libpng"
145  setenv LDFLAGS  -L$BUILD_DIR/lb/lib
146  setenv CFLAGS -O3
147
148 If you are running bash/sh/ash/ksh/zsh use this:
149
150  IR=-I$BUILD_DIR/lb/include
151  CPPFLAGS="$IR $IR/libart-2.0 $IR/freetype2 $IR/libpng"
152  LDFLAGS="-L$BUILD_DIR/lb/lib"
153  CFLAGS=-O3
154  export CPPFLAGS LDFLAGS CFLAGS
155
156 And finally try building again. We disable the python and tcl bindings
157 because it seems that a fair number of people have ill configured python and
158 tcl setups that would prevent rrdtool from building if they are included in
159 their current state.
160
161  cd $BUILD_DIR/rrdtool-1.2.13
162  ./configure --prefix=$INSTALL_DIR --disable-python --disable-tcl
163  make clean
164  make
165  make install
166
167 SOLARIS HINT: if you want to build  the perl module for the native perl (the
168 one shipping with solaris) you will need the sun forte compiler
169 installed on your box or you have to hand-tune bindings/perl-shared/Makefile
170 while building!
171
172 Now go to I<$INSTALL_DIR>B</share/rrdtool/examples/> and run them to see if your
173 build has been successful.
174
175 =head1 AUTHOR
176
177 Tobias Oetiker E<lt>tobi@oetiker.chE<gt>
178