Building Freeling in Mac OS X

I’m involved in a NLP project (the Natural Language Processing, not the Neuro-linguistic Programming thing) and I had to use Freeling. After some days of going back and forward with the installation instructions in the forums, I manage to build it. Here’s my recipe.

First, install¬†Macports. I tried brew, but it just does not work. You’ll also need XCode command line tools from Apple.

Then, open a Terminal and run:

sudo port install autoconf
sudo port install db46
sudo port install automake
sudo port install libtool
sudo port deactivate boost (optional, just in case you already have boost already installed in your system)
sudo port install subversion (just in case you’ve never used SVN before)

Edit /opt/local/etc/macports/sources.conf and add this line just before the “rsync” line

file:///Users/Shared/dports
mkdir /Users/Shared/dports
cd /Users/Shared/dports

Now install the specific version of boost by co-ing its revision (1.49, any other version will prevent freeling to build). Then, index your new repo and install boost

Now, checkout Freeling from SVN

svn checkout http://devel.cpl.upc.edu/freeling/svn/trunk freeling_src
cd freeling_src
aclocal
sudo glibtoolize –force
autoconf
automake -a

I guess something is basically wrong with boost sources from macports, because you have to do this:

cd /opt/local/include/boost
sudo ln -s property_map/property_map.hpp

Lastly, build freeling itself:

env LDFLAGS=”-L/opt/local/lib -L/opt/local/lib/db46″ CPPFLAGS=”-I/opt/local/include -I/opt/local/include/boost -I/opt/local/include/db46″ ./configure
make
sudo make install

UPDATE:
I’ve checkout the code from SVN today (June, 11th 2013) and I had to change a bit the configure call. Use this one:

$ env LDFLAGS=”-L/opt/local/lib -L/opt/local/lib/db46″ CPPFLAGS=”-I/opt/local/boost -I/opt/local/include/db46″ ./configure –enable-traces –enable-boost-locale CPPFLAGS=”-I/opt/local/include -I/opt/local/include/boost -I/opt/local/include/db46″ LDFLAGS=”-L/opt/local/lib -L/opt/local/lib/db46″

UPDATE 2:
If you copy & paste the line above, it won’t work because of wordpress replacing quotes and dashes. Use this one:

About Pablo Casado

Clinical lecturer at BarcelonaTech - http://www.upc.edu
This entry was posted in Uncategorized. Bookmark the permalink.

Comments

Leave a Reply