Compiling RRDtool 1.3.x On Mac OS X

I’ve recently been trying to upgrade RRDtool to 1.3.x as I’ve previously been using 1.2.x. New in 1.3 is moving to Cairo graphics, which is pretty cool and provides much better anti-aliased text. MMAP IO should also help since I run it on an old box. It’s a worthwhile upgrade.

Unfortunately the build directions for Mac OS X are lacking (they don’t really exist). Building the dependencies didn’t really work for me. For anyone who wants to follow this, note that these are changes to the instructions, not replacements. It doesn’t discuss everything. I have only done this on Mac OS X 10.4.11. I have no idea if this works on any other version, though I suspect 10.5 will work fine.

For starters I used the following LDFLAGS:

LDFLAGS="-Wl,-blibpath:${INSTALL_DIR}/lib"

I’m not sure if -Wl is necessary or not, but I don’t think it’s harmful.

In general the directions listed on the build page are pretty strait forward and work fine on Mac OS X but I did encounter an issue once I started to compile Pango 1.17.5:

 gcc -DHAVE_CONFIG_H -I. -I.. -DG_LOG_DOMAIN=\"Pango\" -DPANGO_ENABLE_BACKEND -DPANGO_ENABLE_ENGINE -DSYSCONFDIR=\"/usr/local/rrdtool-1.3.5/etc\" -DLIBDIR=\"/usr/local/rrdtool-1.3.5/lib\" -I.. -DPANGO_ENABLE_DEBUG -D_REENTRANT -I/usr/local/rrdtool-1.3.5/include/glib-2.0 -I/usr/local/rrdtool-1.3.5/lib/glib-2.0/include -I/usr/local/rrdtool-1.3.5/include/cairo -I/usr/local/rrdtool-1.3.5/include/freetype2 -I/usr/local/rrdtool-1.3.5/include -I/usr/local/rrdtool-1.3.5/include/libpng12 -I/usr/local/rrdtool-1.3.5/include/pixman-1 -I/usr/local/rrdtool-1.3.5/include -I/usr/local/rrdtool-1.3.5/include/freetype2 -I/usr/local/rrdtool-1.3.5/include -xobjective-c -O3 -fPIC -Wall -MT libpangocairo_1_0_la-pangocairo-fontmap.lo -MD -MP -MF .deps/libpangocairo_1_0_la-pangocairo-fontmap.Tpo -c pangocairo-fontmap.c  -fno-common -DPIC -o .libs/libpangocairo_1_0_la-pangocairo-fontmap.o
In file included from pangocairo-fontmap.c:29:
pangocairo-atsui.h:27:25: error: cairo-atsui.h: No such file or directory
make[4]: *** [libpangocairo_1_0_la-pangocairo-fontmap.lo] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all] Error 2
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

After some experimentation I found that I had to update to a newer version of Pango. Which needs a newer version of GLib and Cairo. Which requires a newer version of Pixman. You’ve got to love how that cascades. Here’s what I changed:

Pixman

I ended up using Pixman 0.13.2 and doing:

tar -xzf pixman-0.13.2.tar.gz
cd pixman-0.13.2
./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC"
make
make install

Cairo

Then I installed Cairo 1.8.6 using:

tar -xzf cairo-1.8.6.tar.gz
cd cairo-1.8.6
./configure --prefix=$INSTALL_DIR --enable-xlib=no --enable-xlib-xrender=no --enable-win32=no  --enable-quartz=yes --enable-quartz-font=yes CFLAGS="-O3 -fPIC"
make
make install

I modified a few configure flags to use quartz though I left --enable-quartz-image off because it’s experimental as of 1.8.6. Also some of the flags changed slightly between versions (xlib-render is now xlib-xrender).

GLib

I then upgraded GLib to 2.18:

tar -xzf glib-2.18.tar.gz
cd glib-2.18
./configure --prefix=$INSTALL_DIR CFLAGS="-O3 -fPIC"
make
make install

This took forever to build, but it worked fine.

Pango

I then finally installed Pango 1.22.4:

tar -xzf pango-1.22.4.tar.gz
cd pango-1.22.4
./configure --prefix=$INSTALL_DIR --disable-tcl --disable-python
make
make install

If for some reason Pango doesn’t include Cairo as it’s backend like this when ./configure ends:

configuration:
        backends: Cairo FreeType X

Try using the following statements first:

CAIRO_CFLAGS="-I=/usr/local/rrdtool-1.3.5/include/cairo"
CAIRO_LIBS=/usr/local/rrdtool-1.3.5/lib/

Then run ./configure again.

Then compile RRDtool itself by following the directions as normal. This worked fine for me.

Cascading dependencies suck. There may have been an easier fix to my problem, but I wasn’t able to find it. Simply updating to newer versions of these libraries seemed like the best solution. That said, these aren’t officially sanctioned versions by the RRDtool team. Be warned.

Good luck to anyone else who tries this.

2 thoughts on “Compiling RRDtool 1.3.x On Mac OS X

  1. Hi Robert,

    I just faced the same problem when I reinstalled my Mini with 10.5 as home server.

    I got around the tedious task of solving the dependencies by installing Darwin ports and using that to install both cairo and pango.

    Hope this saves you some work next time!

    Regards,
    Hollie.

Leave a Reply

Your email address will not be published. Required fields are marked *