Skip to content

x: GT with Homebrew

Niko Partanen edited this page May 14, 2017 · 7 revisions

Setting up GT infrastructure on Mac with Homebrew

For normal instructions how to set up Giellatekno infrastructure, please refer to their good instructions with MacPorts here and here. If you don't care about whether you use MacPorts or Homebrew, then following the official instructions with MacPorts is maybe a good idea.

First it is necessary to get the repository from SVN. Actually I'm not sure if this part even needs the username, but if want to contribute it is probably good to get it anyway.

svn co https://victorio.uit.no/langtech/trunk main --username <username>

Then the following software can be installed with Homebrew:

brew install autoconf
brew install automake
brew install libtool
brew install antiword
brew install wv
brew install libxslt
brew install poppler
brew install wget
brew install bison
brew install cmake
brew install gawk
brew install saxon
brew install boost
brew install homebrew/science/vislcg3

This needed bit more tweaking:

brew install icu4c
echo 'export PATH="/usr/local/opt/icu4c/bin:$PATH"' >> ~/.bash_profile
echo 'export PATH="/usr/local/opt/icu4c/sbin:$PATH"' >> ~/.bash_profile

Then following Python packages were installed:

pip install --user beautifulsoup4
pip install --user unittest2
pip install --user lxml
pip install --user html5lib
pip install --user feedparser
pip install --user pyth
pip install --user pytidylib

I couldn't run pip install --user pysvn, but everything seems to work anyway. Then I did:

pip3 install --user PyYAML
pip3 install --user pexpect

Then following Perl packages were also needed:

curl -L http://xrl.us/installperlosx | bash
cpanm Text::Brew
cpanm XML::Twig
cpanm XML::LibXML

HFST

I just took this from binaries as compiling was somehow problematic.

wget http://apertium.projectjj.com/osx/nightly/hfst-latest.zip
unzip hfst-latest.zip
echo 'export PATH="/Users/niko/langtech/hfst/bin:$PATH"' >> ~/.bash_profile

XFST

This is also just few binaries.

http://web.stanford.edu/~laurik/.book2software/
gunzip -c bin.tar.gz | tar xopf -
echo 'export PATH="/Users/niko/langtech/xfst/bin:$PATH"' >> ~/.bash_profile

Building a language

In this point we get into actual language building. I had some issues with GIELLA_CORE and GIELLA_SHARED variables here.

cd langtech/main/giella-core/
./autogen.sh 
./configure
make
echo 'export GIELLA_CORE=/Users/niko/langtech/main/giella-core' >> ~/.bash_profile

cd langtech/main/giella-shared/
./autogen.sh 
./configure
make
echo 'export GIELLA_SHARED=/Users/niko/langtech/main/giella-shared' >> ~/.bash_profile

cd langtech/main/langs/kpv
./autogen.sh -l
./configure --with-hfst --enable-syntax --enable-tokenisers --enable-morpher --with-saxon=/Users/niko/langtech/saxon-he-9.4.0.7.jar
make

And then I also had to add into file /Users/niko/langtech/hfst/bin/hfst-twolc lines /Users/niko/langtech/hfst/bin/htwolcpre1, as it was pointing to /opt/osx/htwolcpre1 etc. Otherwise the make failed right in the beginning with phonology.

Anyway after this it all works fine!

Clone this wiki locally