Dave Beckett

Hosted by

since 2005.


(See DOAP Project)

Redland librdf RDF API Library - Building from CVS

1. Introduction

So you want the latest bits and pieces? That means running from CVS. There are several redland packages but it's easiest if you just get two - redland and redland-bindings, since redland includes raptor and rasqal.

2. Checking out the Redland Sources

Follow the instructions to get CVS redland and bindings checked out, given in: and

and you'll end up with two directories, redland and bindings.

At this point, in order to match the way I set this up originally, you'll now need to make a symlink from redland to librdf:

  $ ln -s redland librdf

3. Setup

Now it is a matter of setting up CVS. For this you need to run the autotools on the cvs tree. However, before doing that you need to have the right set of utility programs and libraries, so that's the first step and it's somewhat system specific.

3.1 Debian Setup

Starting from the redland Debian Build Dependencies (which are for building from releases, not from CVS) the core set of packages needed. For simplicity, I've removed lower level versions from this list, but if you are reading this document some time after this publication date, there may be newer version number alternatives:


autotools-dev libtool perl libdb4.3-dev libmysqlclient12-dev libsqlite3-dev libxml2-dev libcurl3-dev

(An alternative to libxml is expat, in which case use libexpat1-dev)

bindings extras:

python2.2 python2.2-dev python2.3 python2.3-dev ruby1.8 ruby1.8-dev

... more depending on languages ...

Also needed are reasonably new versions of automake and autoconf. I always use the latest there is, which is right now, automake 1.9.5 (1.7 min) and autoconf 2.59 (2.54 min). The install documents above track the version requirements in more detail and the scripts described below check them when you run them.

Finally the various language parsers (such as Turtle in raptor, RDQL and SPARQL in Rasqal) need GNU bison, flex 2.5.31 and swig 1.3.x (1.3.14 minimum) for generating the lexers and parser generators.

For actual debian unstable/sid users this is easier since redland's in the archive and all you need is:

  $ sudo apt-get build-dep redland redland-bindings

plus the extras:

  $ sudo apt-get install bison swig1.3 flex automake-1.9 autoconf2.50

Redland and bindings ship with Ubuntu on CD1 (yay!) and are in Debian.

3.2 Redhat (RPM systems) Setup

Something similar applies to the world of RPMs if you have yum or apt installed although the package names are different:


libtool perl db4-devel mysql-devel libxml2-devel curl-devel

(An alternative to libxml2 is expat, in which case use expat-devel)


python python-devel ruby ruby-devel

... more depending on languages ...

I had to build flex 2.5.31 separately as the ancient flex on RedHat Fedora Core 3 was of no use. However the rest can be installed with:

  $ sudo yum install PACKAGES

Redland and bindings are in some RPM distributions.

3.3 OSX (w/fink) Setup

There's a similar set of packages for OSX with fink with sigh slightly different names again, something like:

  autoconf2.5 automake1.8 curl-ssl-dev curl-ssl-shlibs db42 db42-bin
  db42-shlibs flex-devel libtool14 libtool14-shlibs pkgconfig swig

... more for languages ...

on OSX the flex you need is in /sw/lib/flex/bin/flex after installing flex-devel - either put that directory in your PATH or make a symlink to the binary to somewhere in your existing path.

  $ sudo fink install PACKAGES

You can try to get by without fink but you won't have any persistent storage. Perl, python and required headers should already be installed.

3.4 BSDen and Gentoo Setup

Sorry, I don't know the relevant port-based systems instructions. You can probably work out the right names. For gentoo it is something like:

 $ sudo emerge PACKAGES

The redland and redland-bindings packages are already in BSD freshports and gentoo as of this date.

4. Configuring and building Redland

Now it's time to try the scripts

  $ cd redland
  $ ./ --with-raptor=internal --with-rasqal=internal --with-prefix=/usr

and see what happens. The --with options ensure redland's always built with the CVS versions of everything rather than any system version. You can of course add more options; see the redland install document pointed to above.

  $ make
  $ make check

which may work, this being development versions in CVS, there are no guarantees.

If brave and you want it globally:

  $ sudo make install

5. Configuring and building Redland bindings

  $ cd ../bindings

This involves picking a language, but it's optional, so either don't:

  $ ./ --with-redland=internal

or do:

  $ ./ --with-redland=internal --with-perl --with-python=/usr/bin/python2.5

  $ make
  $ make check

Same caveats as above; things may break.

If you didn't do the --with-LANGUAGE or if you just wanted to build something else, you can always just cd LANGUAGE and make for any of the bindings languages.

Then to install the bindings in their natural places:

  $ sudo make install

6. What To Do When Something Gets Fixed In CVS


  $ cd redland
  $ cvs up -APd
  $ make

then maybe: sudo make install

  $ cd ../bindings
  $ cvs up -APd
  $ make

then maybe: sudo make install

However now and then you'll need to re-run the scripts such as when new directories are added or removed from CVS or files are renamed, moved or deleted. This can usually be seen when make stops working with some error about missing files after a cvs up

Additionally if you ever update your autotools, you will likely need to re-run the in order that the generated files are refreshed.

7. Help! This is Too Complex

Grab the nightly tarballs (source) or RPMs then :)

Then all the generated files are made for you from the tools I am using.

8. Feedback

Please get in contact with me with fixes to this document, thanks
-- Dave

Last Modified: $Date: 2005/03/22 20:50:10 $