Code

Imported upstream version 1.3rc4.
[pkg-rrdtool.git] / doc / rrdbuild.html
index 455b85d4403496481d8e1d5c145a74cac197997a..e91a572fb7e3ec344eb599c208f345946f961c96 100644 (file)
 <ul>
 
        <li><a href="#name">NAME</a></li>
-       <li><a href="#description">DESCRIPTION</a></li>
+       <li><a href="#overview">OVERVIEW</a></li>
+       <li><a href="#optimistic_build">OPTIMISTIC BUILD</a></li>
+       <li><a href="#installing_dependencies">INSTALLING DEPENDENCIES</a></li>
+       <ul>
+
+               <li><a href="#opensolaris_2008_05">OpenSolaris 2008.05</a></li>
+               <li><a href="#debian___ubuntu">Debian / Ubuntu</a></li>
+       </ul>
+
+       <li><a href="#building_dependencies">BUILDING DEPENDENCIES</a></li>
        <ul>
 
-               <li><a href="#overview">Overview</a></li>
-               <li><a href="#building">Building</a></li>
                <ul>
 
                        <li><a href="#build_tipps_for_aix">Build Tipps for AIX</a></li>
 <p>
 </p>
 <hr />
-<h1><a name="description">DESCRIPTION</a></h1>
-<p>
-</p>
-<h2><a name="overview">Overview</a></h2>
+<h1><a name="overview">OVERVIEW</a></h1>
 <p>If you downloaded the source of rrdtool you have to compile it. This
 document will give some information on how this is done.</p>
 <p>RRDtool relies on services of thrid part libraries. Some of these libraries
 may already be installed on your system. You have to compile copies of the other
 ones before you can build RRDtool.</p>
 <p>This document will tell you about all the necessary steps to get going.</p>
+<p>These instructions assume you are using a <strong>bash</strong> shell. If you use csh/tcsh,
+then you can either type <em>bash</em> to switch to bash for the compilation or if
+you know what you are doing just replace the export bits with
+setenv.</p>
+<p>We further assume that your copies of <strong>tar</strong> and <strong>make</strong> are actually <strong>GNU
+tar</strong> and <strong>GNU make</strong> respectively. It could be that they are installed as
+<strong>gtar</strong> and <strong>gmake</strong> on your system.</p>
 <p>
 </p>
-<h2><a name="building">Building</a></h2>
+<hr />
+<h1><a name="optimistic_build">OPTIMISTIC BUILD</a></h1>
 <p>Before you start to build RRDtool, you have to decide two things:</p>
 <ol>
 <li>
@@ -63,15 +75,10 @@ ones before you can build RRDtool.</p>
 <p>Where you want to install the software.</p>
 </li>
 </ol>
-<p>Once you have decided. Save the two locations into environment variables.
-Depending on the shell you are using, you can do either (bash,zsh):</p>
+<p>Once you have decided. Save the two locations into environment variables.</p>
 <pre>
  BUILD_DIR=/tmp/rrdbuild
- INSTALL_DIR=/usr/local/rrdtool-1.2.27</pre>
-<p>Or if you run tcsh:</p>
-<pre>
- set BUILD_DIR=/tmp/rrdbuild
- set INSTALL_DIR=/usr/local/rrdtool-1.2.27</pre>
+ INSTALL_DIR=/usr/local/rrdtool-1.3rc4</pre>
 <p>If your <em>/tmp</em> is mounted with the option noexec (RHEL seems todo that) you have to choose
 a different directory!</p>
 <p>Now make sure the BUILD_DIR exists and go there:</p>
@@ -79,22 +86,53 @@ a different directory!</p>
  mkdir -p $BUILD_DIR
  cd $BUILD_DIR</pre>
 <p>Lets first assume you already have all the necessary libraries
-pre-installed. Note that these instructions assume that your copies of
-<strong>tar</strong> and <strong>make</strong> are actually <strong>GNU tar</strong> and <strong>GNU make</strong> respectively. It
-could be that they are installed as <strong>gtar</strong> and <strong>gmake</strong> on your system.</p>
+pre-installed.</p>
 <pre>
- wget <a href="http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.2.27.tar.gz">http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.2.27.tar.gz</a>
- tar zxf rrdtool-1.2.27.tar.gz
- cd rrdtool-1.2.27
+ wget <a href="http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.3rc4.tar.gz">http://oss.oetiker.ch/rrdtool/pub/rrdtool-1.3rc4.tar.gz</a>
+ gunzip -c rrdtool-1.3rc4.tar.gz | tar xf -
+ cd rrdtool-1.3rc4
  ./configure --prefix=$INSTALL_DIR &amp;&amp; make &amp;&amp; make install</pre>
 <p>Ok, this was very optimistic. This try will probably have ended with
-<strong>configure</strong> complaining about several missing libraries. If you are on a
-Linux or *bsd system you may want to just install the missing bits from your
-software repository. When you do that, make sure you also get the <strong>-dev</strong>
-package for each library you install. Once you have the missing bits on
-board, just re-run the last line of the instructions above.</p>
-<p>But again this may have been too optimistic, and you actually have to
-compile your own copies of the required libraries.</p>
+<strong>configure</strong> complaining about several missing libraries.</p>
+<p>
+</p>
+<hr />
+<h1><a name="installing_dependencies">INSTALLING DEPENDENCIES</a></h1>
+<p>If your OS lets you install additional packages from a software repository,
+you may get away with installing the missing packages. When the packages are
+installed, run configure again and try to compile again. Below you find some
+hints on getting your OS ready for the rrdtool compilation. Additions to
+this list are welcome.</p>
+<p>
+</p>
+<h2><a name="opensolaris_2008_05">OpenSolaris 2008.05</a></h2>
+<p>Just add a compiler and the gnome development package:</p>
+<pre>
+ pkg install sunstudioexpress
+ pkg install SUNWgnome-common-devel</pre>
+<p>There is a a problem with <em>cairo.pc</em> on opensolaris. It suggests that
+xrender is required for compilation with cairo. This is not true and also
+bad since opensolaris does not include an <em>xrender.pc</em> file. Use perl to
+fix this:</p>
+<pre>
+ perl -i~ -p -e 's/(Requires.*?)\s*xrender.*/$1/' /usr/lib/pkgconfig/cairo.pc</pre>
+<p>
+</p>
+<h2><a name="debian___ubuntu">Debian / Ubuntu</a></h2>
+<p>Use apt-get to make sure you have all that is required. A number
+of packages will get added through dependencies.</p>
+<pre>
+ apt-get install libpango1.0-dev libxml2-dev</pre>
+<p>
+</p>
+<hr />
+<h1><a name="building_dependencies">BUILDING DEPENDENCIES</a></h1>
+<p>But again this may have been too optimistic still, and you actually have to
+compile your own copies of some of the required libraries. Things like
+libpng and zlib are pretty standard so you will probably have them on your
+system anyway. Freetype, Fontinst, Cairo, Pango may be installed, but it is
+possible that they are pretty old and thus don't live up to the
+expectations, so you may want to compile their latest versions.</p>
 <p>
 </p>
 <h3><a name="build_tipps_for_aix">Build Tipps for AIX</a></h3>
@@ -122,19 +160,69 @@ If you have an other compile you have to use the following settings:</p>
  CFLAGS=&quot;-xO3 -kPIC&quot;</pre>
 </dd>
 </dl>
+<p>Some libraries want to know where other libraries are. For this to work,
+set the following environamen variable</p>
+<pre>
+ export PKG_CONFIG_PATH=${INSTALL_DIR}/lib/pkgconfig
+ export PATH=$INSTALL_DIR/bin:$PATH</pre>
+<p>Since we are compiling libraries dynamically, you they must further know
+where to find each other. This is done by setting an appropriate LDFLAG.
+Unfortunatly the syntax differs from system to system:</p>
+<dl>
+<dt><strong><a name="item_solaris">Solaris</a></strong>
+
+<dd>
+<pre>
+ export LDFLAGS=-R${INSTALL_DIR}/lib</pre>
+</dd>
+<dt><strong><a name="item_linux">Linux</a></strong>
+
+<dd>
+<pre>
+ export LDFLAGS=&quot;-Wl,--rpath -Wl,${INSTALL_DIR}/lib&quot;</pre>
+</dd>
+<dd>
+<p>If you are on a 64bit platform, but would like to continue to use the rrd files created
+on your old 32bit linux, you may be able</p>
+</dd>
+<dt><strong><a name="item_hpux">HPUX</a></strong>
+
+<dd>
+<pre>
+
+ export LDFLAGS=&quot;+b${INSTALL_DIR}/lib&quot;</pre>
+</dd>
+<dt><strong><a name="item_aix">AIX</a></strong>
+
+<dd>
+<pre>
+ export LDFLAGS=&quot;-Wl,-blibpath:${INSTALL_DIR}/lib&quot;</pre>
+</dd>
+<p>If you have GNUmake installed and it is not called 'make',
+then do</p>
+<pre>
+ export MAKE=gmake
+ export GNUMAKE=gmake</pre>
+<p>otherwhise just do</p>
+<pre>
+ export MAKE=make</pre>
 <dl>
 <dt><strong><a name="item_building_zlib">Building zlib</a></strong>
 
+<dd>
+<p>Chances are very high that you already have that on your system ...</p>
+</dd>
 <dd>
 <pre>
  cd $BUILD_DIR
  wget <a href="http://oss.oetiker.ch/rrdtool/pub/libs/zlib-1.2.3.tar.gz">http://oss.oetiker.ch/rrdtool/pub/libs/zlib-1.2.3.tar.gz</a>
- tar  zxf zlib-1.2.3.tar.gz
+ gunzip -c zlib-1.2.3.tar.gz | tar xf -
  cd zlib-1.2.3
- env CFLAGS=&quot;-O3 -fPIC&quot; ./configure --prefix=$BUILD_DIR/lb
- make
make install</pre>
+ ./configure --prefix=$INSTALL_DIR CFLAGS=&quot;-O3 -fPIC&quot; --shared
+ $MAKE
$MAKE install</pre>
 </dd>
+</li>
 <dt><strong><a name="item_building_libpng">Building libpng</a></strong>
 
 <dd>
@@ -146,13 +234,12 @@ the end of line 4 means that line 4 and line 5 are on one line.</p>
 <dd>
 <pre>
  cd $BUILD_DIR
- wget <a href="http://oss.oetiker.ch/rrdtool/pub/libs/libpng-1.2.10.tar.gz">http://oss.oetiker.ch/rrdtool/pub/libs/libpng-1.2.10.tar.gz</a>
- tar zxvf libpng-1.2.10.tar.gz
+ wget <a href="http://oss.oetiker.ch/rrdtool/pub/libs/libpng-1.2.18.tar.gz">http://oss.oetiker.ch/rrdtool/pub/libs/libpng-1.2.18.tar.gz</a>
+ gunzip -c libpng-1.2.18.tar.gz | tar xf -
  cd libpng-1.2.10
- env CPPFLAGS=&quot;-I$BUILD_DIR/lb/include&quot; LDFLAGS=&quot;-L$BUILD_DIR/lb/lib&quot; CFLAGS=&quot;-O3 -fPIC&quot; \
-     ./configure --disable-shared --prefix=$BUILD_DIR/lb
- make
- make install</pre>
+ env CFLAGS=&quot;-O3 -fPIC&quot; ./configure --prefix=$INSTALL_DIR
+ $MAKE
+ $MAKE install</pre>
 </dd>
 </li>
 <dt><strong><a name="item_building_freetype">Building freetype</a></strong>
@@ -160,78 +247,132 @@ the end of line 4 means that line 4 and line 5 are on one line.</p>
 <dd>
 <pre>
  cd $BUILD_DIR
- wget <a href="http://oss.oetiker.ch/rrdtool/pub/libs/freetype-2.1.10.tar.bz2">http://oss.oetiker.ch/rrdtool/pub/libs/freetype-2.1.10.tar.bz2</a>
- tar jxvf freetype-2.1.10.tar.bz2
- cd freetype-2.1.10
- env CPPFLAGS=&quot;-I$BUILD_DIR/lb/include&quot; LDFLAGS=&quot;-L$BUILD_DIR/lb/lib&quot; CFLAGS=&quot;-O3 -fPIC&quot; \
-     ./configure --disable-shared --prefix=$BUILD_DIR/lb
- make
- make install</pre>
+ wget <a href="http://oss.oetiker.ch/rrdtool/pub/libs/freetype-2.3.5.tar.gz">http://oss.oetiker.ch/rrdtool/pub/libs/freetype-2.3.5.tar.gz</a>
+ gunzip -c freetype-2.3.5.tar.gz | tar xf -
+ cd freetype-2.3.5
+ ./configure --prefix=$INSTALL_DIR CFLAGS=&quot;-O3 -fPIC&quot;
+ $MAKE
+ $MAKE install</pre>
 </dd>
 <dd>
 <p>If you run into problems building freetype on Solaris, you may want to try to
-add the following at the end of the configure line:</p>
+add the following at the start the configure line:</p>
+</dd>
+<dd>
+<pre>
+ env EGREP=egrep</pre>
+</dd>
+<dt><strong><a name="item_building_libxml2">Building LibXML2</a></strong>
+
+<dd>
+<pre>
+ cd $BUILD_DIR
+ wget <a href="http://oss.oetiker.ch/rrdtool/pub/libs/libxml2-sources-2.6.31.tar.gz">http://oss.oetiker.ch/rrdtool/pub/libs/libxml2-sources-2.6.31.tar.gz</a>
+ gunzip -c libxml2-sources-2.6.32.tar.gz | tar xf -
+ cd libxml2-sources-2.6.32
+ ./configure --prefix=$INSTALL_DIR CFLAGS=&quot;-O3 -fPIC&quot;
+ $MAKE
+ $MAKE install</pre>
+</dd>
+<dt><strong><a name="item_building_fontconfig">Building fontconfig</a></strong>
+
+<dd>
+<p>Note that fontconfig has a runtime configuration file in INSTALL_DIR/etc you
+may want to adjust that so that fontconfig finds the fonts on your system.
+Run the fc-cache program to build the fontconfig cache after changeing the
+config file.</p>
 </dd>
 <dd>
 <pre>
- GNUMAKE=gmake EGREP=egrep</pre>
+ cd $BUILD_DIR
+ wget <a href="http://oss.oetiker.ch/rrdtool/pub/libs/fontconfig-2.4.2.tar.gz">http://oss.oetiker.ch/rrdtool/pub/libs/fontconfig-2.4.2.tar.gz</a>
+ gunzip -c fontconfig-2.4.2.tar.gz   | tar xf -
+ cd fontconfig-2.4.2
+ ./configure --prefix=$INSTALL_DIR CFLAGS=&quot;-O3 -fPIC&quot;
+ $MAKE
+ $MAKE install</pre>
+</dd>
+</li>
+<dt><strong><a name="item_building_pixman">Building Pixman</a></strong>
+
+<dd>
+<pre>
+ cd $BUILD_DIR
+ wget <a href="http://oss.oetiker.ch/rrdtool/pub/libs/pixman-0.10.0.tar.gz">http://oss.oetiker.ch/rrdtool/pub/libs/pixman-0.10.0.tar.gz</a>
+ gunzip -c pixman-0.10.0.tar.gz  | tar xf -
+ cd fontconfig-2.4.2
+ ./configure --prefix=$INSTALL_DIR CFLAGS=&quot;-O3 -fPIC&quot;
+ $MAKE
+ $MAKE install</pre>
 </dd>
-<dt><strong><a name="item_building_libart_lgpl">Building libart_lgpl</a></strong>
+<dt><strong><a name="item_building_cairo">Building Cairo</a></strong>
 
 <dd>
 <pre>
  cd $BUILD_DIR
- wget <a href="http://oss.oetiker.ch/rrdtool/pub/libs/libart_lgpl-2.3.17.tar.gz">http://oss.oetiker.ch/rrdtool/pub/libs/libart_lgpl-2.3.17.tar.gz</a>
- tar zxvf libart_lgpl-2.3.17.tar.gz
- cd libart_lgpl-2.3.17
- env CFLAGS=&quot;-O3 -fPIC&quot; ./configure --disable-shared --prefix=$BUILD_DIR/lb
- make
- make install</pre>
+ wget <a href="http://oss.oetiker.ch/rrdtool/pub/libs/cairo-1.6.4.tar.gz">http://oss.oetiker.ch/rrdtool/pub/libs/cairo-1.6.4.tar.gz</a>
+ gunzip -c cairo-1.4.10.tar.gz   | tar xf -
+ cd cairo-1.4.10
+ ./configure --prefix=$INSTALL_DIR \
+    --enable-xlib=no \
+    --enable-xlib-render=no \
+    --enable-win32=no \
+    CFLAGS=&quot;-O3 -fPIC&quot;
+ $MAKE
+ $MAKE install</pre>
+</dd>
+<dt><strong><a name="item_building_glib">Building Glib</a></strong>
+
+<dd>
+<pre>
+ cd $BUILD_DIR
+ wget <a href="http://oss.oetiker.ch/rrdtool/pub/libs/glib-2.15.4.tar.gz">http://oss.oetiker.ch/rrdtool/pub/libs/glib-2.15.4.tar.gz</a>
+ gunzip -c glib-2.12.13.tar.gz  | tar xf -
+ cd glib-2.12.13
+ ./configure --prefix=$INSTALL_DIR CFLAGS=&quot;-O3 -fPIC&quot;
+ $MAKE
+ $MAKE install</pre>
+</dd>
+<dt><strong><a name="item_building_pango">Building Pango</a></strong>
+
+<dd>
+<pre>
+ cd $BUILD_DIR
+ wget <a href="http://oss.oetiker.ch/rrdtool/pub/libs/pango-1.21.1.tar.gz">http://oss.oetiker.ch/rrdtool/pub/libs/pango-1.21.1.tar.gz</a>
+ gunzip -c pango-1.21.1.tar.gz  | tar xf -
+ cd pango-1.21.1
+ ./configure --prefix=$INSTALL_DIR CFLAGS=&quot;-O3 -fPIC&quot; --without-x
+ $MAKE
+ $MAKE install</pre>
 </dd>
 </dl>
-<p>Now all the dependent libraries are built and you can try again. Since these
-are static libraries, you may have to use <em>ranlib</em> to make them accessible.
-Especially BSD systems like Mac OS X may require this, Linux and Solaris
-will do just fine without since their <em>ar</em> command does ranlibs job as well.</p>
-<pre>
- ranlib $BUILD_DIR/lb/lib/*.a</pre>
-<p>This time you tell configure where it should be looking for libraries and
-include files. This is done via environment variables. Depending on the
-shell you are running, the syntax for setting environment variables is
-different. Under csh/tcsh you use:</p>
-<pre>
- set IR=-I$BUILD_DIR/lb/include
- setenv CPPFLAGS &quot;$IR $IR/libart-2.0 $IR/freetype2 $IR/libpng&quot;
- setenv LDFLAGS  -L$BUILD_DIR/lb/lib
- setenv CFLAGS -O3</pre>
-<p>If you are running bash/sh/ash/ksh/zsh use this:</p>
-<pre>
- IR=-I$BUILD_DIR/lb/include
- CPPFLAGS=&quot;$IR $IR/libart-2.0 $IR/freetype2 $IR/libpng&quot;
- LDFLAGS=&quot;-L$BUILD_DIR/lb/lib&quot;
- CFLAGS=-O3
- export CPPFLAGS LDFLAGS CFLAGS</pre>
+<p>Now all the dependent libraries are built and you can try again. This time
+you tell configure where it should be looking for libraries and include
+files. This is done via environment variables. Depending on the shell you
+are running, the syntax for setting environment variables is different.</p>
 <p>And finally try building again. We disable the python and tcl bindings
 because it seems that a fair number of people have ill configured python and
 tcl setups that would prevent rrdtool from building if they are included in
 their current state.</p>
 <pre>
- cd $BUILD_DIR/rrdtool-1.2.27
- ./configure --prefix=$INSTALL_DIR --disable-python --disable-tcl
make clean
- make
make install</pre>
+ cd $BUILD_DIR/rrdtool-1.3rc4
+ ./configure --prefix=$INSTALL_DIR --disable-tcl --disable-python
$MAKE clean
+ $MAKE
$MAKE install</pre>
 <p>SOLARIS HINT: if you want to build  the perl module for the native perl (the
-one shipping with solaris) you will need the sun forte compiler
-installed on your box or you have to hand-tune bindings/perl-shared/Makefile
-while building!</p>
-<p>Now go to <em>$INSTALL_DIR</em><strong>/share/rrdtool/examples/</strong> and run them to see if your
-build has been successful.</p>
+one shipping with solaris) you will need the sun forte compiler installed on
+your box or you have to hand-tune bindings/perl-shared/Makefile while
+building!</p>
+<p>Now go to <em>$INSTALL_DIR</em><strong>/share/rrdtool/examples/</strong> and run them to see if
+your build has been successful.</p>
 <p>
 </p>
 <hr />
 <h1><a name="author">AUTHOR</a></h1>
-<p>Tobias Oetiker &lt;<a href="mailto:tobi@oetiker.ch">tobi@oetiker.ch</a>&gt;</p>
+<p>Tobias Oetiker &lt;<a href="mailto:tobi@oetiker.ch">tobi@oetiker.ch</a>&gt;
+
+</p>
 
 </body>