about semantic web, software architecture and life in general

This is an archived version of my blog.
See also my homepage.

Post details: Redland Python bindings on Mac OS X

2009-02-24

Permalink 15:43:51, Categories: Semantic Web   English (EU)

Redland Python bindings on Mac OS X

If you need to install Redland Python bindings on Mac OS X then one of the ways is to use MacPorts:

sudo port install redland-bindings +python25

It is just one command and all dependencies will be installed automatically. (Though I usually install python25 with a separate command)

There is a cost to this because MacPorts would compile its own version of Python and as a result the installation might take a while. This is due to MacPorts policy to install all the prerequisites.

Context: I was having issues installing Redland Python bindings on Mac OS X and it seemed that nobody around me had them working either. MacPorts turned out to be the easiest way to do this.

See also:

Comments, Pingbacks:

Comment from: Martin [Visitor]
I also had some problems compiling the bindings, but finally this configure command did the trick (system python on 10.5., redland+bindings 1.0.8 with sqlite3):

./configure --with-python=/usr/bin/python --with-redland=system LIBS='-lraptor -lrasqal -lsqlite3'

PermalinkPermalink 2009-02-24 @ 16:46
Comment from: captsolo [Member]
Martin: good to know compiling from source code manually worked for you. the config line you posted could also help others do that.

somewhere along the way I may have got this approach working as well but it is not as trivial as one line of shell commands (assumes you are familiar with compiling from source, installing prerequisites, etc).

I hope MacPorts will allow Redland and its Python bindings be used by people who do not necessarily have knowledge or willingness to compile stuff and just want a easy way to install this RDF library.
PermalinkPermalink 2009-02-25 @ 16:04
Comment from: Barry [Visitor]
You are so damn right!

I tried a few hours and still can't get it to build properly on Mac. MacPort rocks..
PermalinkPermalink 2009-03-06 @ 02:06
Comment from: kurtjx [Visitor]
I was _finally_ able to get the python bindings working on os x w/ Martin's configure arguments. thanks a million!
PermalinkPermalink 2009-03-07 @ 15:41
Comment from: Benjamin Heitmann [Visitor]
Hi, yesterday I succeeded in compiling the redland python bindings on Mac OS X without using macports.

I used this configure invocation:

./configure --prefix=/usr/local/redland --with-python=/sw/bin/python2.6 --with-python-ldflags="-Wl,-F. -bundle -L/sw/lib/python2.6/config -ldl -lpython2.6" LIBS="-L/usr/local/redland/lib -lraptor -lrasqal"

You probably need to change this for your own system:
* change the prefix for the installation
* put in your python binary
* put the output of "my-python-version-config --ldflags" in the --with-python-ldflags argument.
* also put "-Wl,-F. -bundle" in the --with-python-ldflags argument.
* add the LIBS string with all database libraries and raptor and rasqal libraries and their respective paths.

(I filed a bug for the fact that these are not all detected, lets see how that goes.)
PermalinkPermalink 2009-04-22 @ 19:46
Comment from: captsolo [Member]
Benjamin: Congratulations! :)
Thanks for sharing tips on how to compile them.

Parameters that you describe are very similar to those that MacPorts uses internally when compiling the port.
PermalinkPermalink 2009-04-23 @ 01:06
Comment from: Graham Higgins [Visitor]
None of the above worked for me. This is possibly because I'm using a Python2.6 dmg package which installs 2.6 as an OS X Framework and it doesn't explicitly have a libpython2.6.so file.

I ended up by linking "/Library/Frameworks/Python.framework/Versions/2.6/Python" to "/usr/lib/libpython2.6.dylib" and using the following configure options, making and installing as I worked my way serially through the packages.


raptor:
./configure \
--prefix=/usr/local/redland

rasqal:
./configure \
--prefix=/usr/local/redland \
--with-redland=../redland-1.0.9

redland-1.0.9:
./configure \
--prefix=/usr/local/redland \
--with-bdb=/usr/local/BerkeleyDB.4.7 \
--with-bdb-lib=/usr/local/BerkeleyDB.4.7/lib \
--with-bdb-include=/usr/local/BerkeleyDB.4.7/include \
--with-mysql=/usr/local/mysql/bin/mysql_config

redland-1.0.8-bindings:
./configure --prefix=/usr/local/redland \
--with-python=/usr/local/bin/python2.6 \
--with-python-ldflags="-dynamiclib -ldl -lpython2.6" \
--with-python-libext="dylib"


Hope this helps someone.
PermalinkPermalink 2009-05-18 @ 06:00
Comment from: Elmi [Visitor]
the tips works...thank you so much, yesterday i compiling the redland python bindings on Mac OS X without using macports just like u said. thanks to benjamin !
PermalinkPermalink 2009-05-21 @ 12:33

Page served in 0.443 seconds

Valid XHTML 1.0! Valid CSS! Valid RSS! Valid Atom!