compiling_HFS T3
Compiling HFST3
This is a receipt for setting up HFST3, with the backends we need. See the HFST3 README file for further details, and how to turn on or off specific backens if needed or wanted.
Up-to-date as of 2013-04-11
Presently, HFST3 supports three different backends:
-
OpenFST - weighted transducers (default)
-
Foma - xfst-compatible lexc and regex compiler, xfst scripts (optional)
- SFST - unweighted transducers, fast substitute (optional)
As of HFST 3.4, the backends are included in the source distributions, and in
HFST3 abstracts over the different backends, and will make it easy to add
The bottom line: use the latest version, and follow the receipts below, and you
Building HFST3
Please note that HFST3 requires rather new versions of flex and bison. The
We assume installation from svn here:
svn co http://svn.code.sf.net/p/hfst/code/trunk/hfst3 cd hfst3/ ./autogen.sh ./configure --enable-proc --enable-lexc # This is the minimum we need
As of HFST 3.4.4, the foma and sfst backends are enabled by default,
For MacOS X
For some reason .yy files must be built explicitly on MacOS X:
for yy_file in `find . -name '*.yy'`; do pushd `dirname $yy_file`; make `basename $yy_file .yy`.cc; cp -vf `basename $yy_file .yy`.hh `basename $yy_file .yy`.h; popd; done
You will get this error message at the end of the output:
~/lingsvn/hfst3/tools/src/parsers ~/lingsvn/hfst3 make: *** No rule to make target `xfst-parser.cc'. Stop. cp: xfst-parser.hh: No such file or directory
Just ignore it, it won't stop HFST3 from building.
make sudo make install
To check what other options there are for enabling other backends and functions,
Building on Victorio
Victorio lacks a few crucial tools to build from svn. One thus have to first build a distro on another machine, and move it to victorio, or use the prebuilt tarball from the hfst site. To build a tarball on your local machine, do:
cd hfst3/ make dist
Copy the tarball to victorio. When the tarball is on victorio, proceed as follows:
tar -xzf hfst-3.2.0.tar.gz cd hfst-3.2.0/ ./configure --with-foma --enable-proc --enable-lexc # as above make sudo make install

