compiling_HFS T3
NB! The information below is up-to-date as of HFST 3.11.
Presently, HFST3 supports three different backends, all enabled by default:
-
OpenFST - weighted transducers (default)
-
Foma - xfst-compatible lexc and regex compiler, xfst
- SFST - unweighted transducers, fast substitute (optional)
HFST3 abstracts over the different backends, and will make it easy to add
The simple installation (you download ready-made programs)
Run these commands:
On Mac:
curl http://apertium.projectjj.com/osx/install-nightly.sh > install-nightly.sh chmod a+x install-nightly.sh sudo ./install-nightly.sh
On Linux ubuntu:
wget https://apertium.projectjj.com/apt/install-nightly.sh -O - | sudo bash sudo apt-get -f install apertium-all-dev
On Linux fedora (e.g. on gtlab):
curl https://apertium.projectjj.com/rpm/install-nightly.sh |sudo bash sudo apt-get -f install apertium-all-devel
This downloads a shell script (1), makes it executable (2), and runs it (3). The shell script in turn will download and install prebuilt binaries for:
- hfst
- vislcg3
- apertium
You get the latest version of all required tools in one go, no compilation required! : )
Installing the hard way (you build the programs yourself)
If you want to configure and compile the source code, do as follows:
Checkout and configuration
We assume installation from svn here. You can downloaded a tarball from the
svn co https://github.com/hfst/hfst.git/trunk hfst cd hfst/ ./autogen.sh ./configure --enable-all-tools --with-unicode-handler=glib
The configuration above is the default used by the Giella infra. To check what
To avoid the very wordy output of make, and get only essential messages,
--enable-silent-rules
Make and install
The final steps to build and install hfst after the configuration are as
make sudo make install
installing the SWIG Python binding
NB!! The following info is most likely outdated. See the Hfst readme file
If you want to run hfst from Python, you need to install the Python binding
sudo port install swig sudo port install swig-python
When done, you are ready to build and install the Python bindings:
python3.3 setup.py build_ext --inplace
Extra considerations for older systems
Special configuration on MacOSX 10.9
Due to a new default compiler on MacOSX 10.9 (with which the hfst code
./configure --without-foma --with-unicode-handler=glib --enable-all-tools \ LDFLAGS=" -stdlib=libstdc++"
Or:
./configure --without-foma --with-unicode-handler=glib --enable-all-tools \ CXXFLAGS=" -stdlib=libstdc++" LDFLAGS=" -stdlib=libstdc++"
Or:
./configure --without-foma --with-unicode-handler=glib --enable-all-tools \ CXXFLAGS="-I/usr/include/c++/4.2.1" LDFLAGS=" -stdlib=libstdc++"
NB! Remember to make clean after each ./configure run, and before
NB2! This does NOT apply to MacOSX 10.10 - in this case, just configure
Extra preparations on MacOSX 10.6
When building from the github source code,
sudo port install automake autoconf flex bison pkgconfig
After this, do ./autogen.sh etc. as above.