Redland on OS X Problem and Solution

This is probably of no interest to you, but I’ll post it so that people who run into the same problem will be able to find the solution through Google.

For my project I’m using Redland librdf, which is a RDF library written in C that has wrapper for Python and many other languages (I’m using the Python one obviously). As my iBook was broken I used my windows laptop for the past months and there it worked fine. However now I got my iBook back I wasn’t able to let the redland-bindings to compile.

However I kept getting an error similar to this:

$ make
Making all in test
make[1]: Nothing to be done for `all’.
gcc -DPACKAGE_NAME=”Redland RDF Application Framework bindings” -DPACKAGE_TARNAME=”redland-bindings” -DPACKAGE_VERSION=”1.0.2.1” -DPACKAGE_STRING=”Redland RDF Application Framework bindings 1.0.2.1” -DPACKAGE_BUGREPORT=”http://bugs.librdf.org/” -DPACKAGE=”redland-bindings” -DVERSION=”1.0.2.1” -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -I. -DREDLAND_POST_I -DREDLAND_DECL_I -DREDLAND_TYPEMAP_I -I/usr/local/include -I/opt/local/include/db4 -I/opt/local/Library/Frameworks/Python.framework/Versions/2.4/include/python2.4 -I/opt/local/include/python2.4 -g -O2 -I/usr/local/include -I/opt/local/include/db4 -g -O2 -fPIC -DPIC ./Redland_wrap.c -c -o Redland_wrap.so
In file included from ./Redland_wrap.c:1380:
./redland-post.i: In function ‘librdf_python_unicode_to_bytes’:
./redland-post.i:162: warning: pointer targets in passing argument 2 of ‘raptor_unicode_char_to_utf8’ differ in signedness
./Redland_wrap.c: In function ‘_wrap_librdf_digest_update’:
./Redland_wrap.c:1777: warning: pointer targets in passing argument 2 of ‘librdf_digest_update’ differ in signedness
./Redland_wrap.c: In function ‘_wrap_librdf_digest_update_string’:
./Redland_wrap.c:1812: warning: pointer targets in passing argument 2 of ‘librdf_digest_update_string’ differ in signedness
./Redland_wrap.c: In function ‘_wrap_librdf_new_uri’:
./Redland_wrap.c:2342: warning: pointer targets in passing argument 2 of ‘librdf_new_uri’ differ in signedness
./Redland_wrap.c: In function ‘_wrap_librdf_new_node_from_uri_string’:
./Redland_wrap.c:2575: warning: pointer targets in passing argument 2 of ‘librdf_new_node_from_uri_string’ differ in signedness
./Redland_wrap.c: In function ‘_wrap_librdf_new_node_from_literal’:
./Redland_wrap.c:2661: warning: pointer targets in passing argument 2 of ‘librdf_new_node_from_literal’ differ in signedness
./Redland_wrap.c: In function ‘_wrap_librdf_new_node_from_typed_literal’:
./Redland_wrap.c:2710: warning: pointer targets in passing argument 2 of ‘librdf_new_node_from_typed_literal’ differ in signedness
./Redland_wrap.c: In function ‘_wrap_librdf_new_node_from_blank_identifier’:
./Redland_wrap.c:2779: warning: pointer targets in passing argument 2 of ‘librdf_new_node_from_blank_identifier’ differ in signedness
./Redland_wrap.c: In function ‘_wrap_librdf_model_add_typed_literal_statement’:
./Redland_wrap.c:3936: warning: pointer targets in passing argument 4 of ‘librdf_model_add_typed_literal_statement’ differ in signedness
./Redland_wrap.c: In function ‘_wrap_librdf_parser_parse_string_as_stream’:
./Redland_wrap.c:5394: warning: pointer targets in passing argument 2 of ‘librdf_parser_parse_string_as_stream’ differ in signedness
./Redland_wrap.c: In function ‘_wrap_librdf_parser_parse_string_into_model’:
./Redland_wrap.c:5438: warning: pointer targets in passing argument 2 of ‘librdf_parser_parse_string_into_model’ differ in signedness
./Redland_wrap.c: In function ‘_wrap_librdf_parser_parse_counted_string_as_stream’:
./Redland_wrap.c:5486: warning: pointer targets in passing argument 2 of ‘librdf_parser_parse_counted_string_as_stream’ differ in signedness
./Redland_wrap.c: In function ‘_wrap_librdf_parser_parse_counted_string_into_model’:
./Redland_wrap.c:5536: warning: pointer targets in passing argument 2 of ‘librdf_parser_parse_counted_string_into_model’ differ in signedness
./Redland_wrap.c: In function ‘_wrap_librdf_new_query’:
./Redland_wrap.c:5663: warning: pointer targets in passing argument 4 of ‘librdf_new_query’ differ in signedness
gcc -g -O2 -I/usr/local/include -I/opt/local/include/db4 -g -O2 -Wl,-F. -Wl,-F. -bundle -framework Python Redland_wrap.so `redland-config — libs` -o Redland.so
/usr/bin/ld: Undefined symbols:
_raptor_locator_byte
_raptor_locator_column
_raptor_locator_file
_raptor_locator_line
_raptor_locator_uri
_raptor_unicode_char_to_utf8
collect2: ld returned 1 exit status
make[1]: *** [Redland-stamp] Error 1
make: *** [all-recursive] Error 1

The solution is as follows. From this page download seperately: raptor (latest .tar.gz), rasqal (latest .tar.gz), redland (latest .tar.gz) and redland-bindings (latest .tar.gz). Extract each of them and then compile them as follows:

raptor: ./configure && make && sudo make install
rasqal: ./configure && make && sudo make install
redland: ./configure — with-raptor=system — with-rasqal=system && make && sudo make install
redland-bindings: ./configure — with-python — with-whatever && make && make install (the configure command depends on the language bindings you need, I just used — with-python).

Hope this will help someone in the future.