How to get Foma

Foma is a finite-state compiler that we will use to build descriptions of natural language morphology.

If possible, you also want the Graphviz package, which will help you visualize finite state automata created in Foma. This functionality is optional but very useful.

In the lab

EDIT: The advice in this section is no longer valid. There seems to be an additional layer of protection that prevents you from accessing other people's home folder even if they have set the r-x permission for all users. Also, ssh to the lab computers from locations outside the lab may not always work because somebody in the lab may have re-booted the computer in Windows.

When you are working on one of the lab computers, you do not have to install anything. You should be able to run my copy of Foma there. Make sure that the path to my Foma is in your PATH variable, then you can invoke foma from the folder where your morphological project resides. You do not have to be physically present in the lab. You can access the lab computers remotely using ssh (for example, connect to u-pl1.ms.mff.cuni.cz).

/bin/bash
export PATH=${PATH}:~zeman/npfl094/lab-twolm/foma
which foma
/afs/ms/u/z/zeman/npfl094/lab-twolm/foma/foma

On your own computer

There are precompiled binaries of Foma for several operating systems. If one of them works for you, use it.

Linux

Unfortunately, the precompiled Linux binaries do not work on some systems. They require a shared library that may not be installed:

linux-x86_64/foma: error while loading shared libraries: libtermcap.so.2: cannot open shared object file: No such file or directory

If this is your case, try my copy instead. It is older but it works on my Ubuntu Linux on which the newer version fails with the above error.

wget http://ufal.mff.cuni.cz/~zeman/vyuka/morfosynt/lab-twolm/foma-dan.tar.gz
tar xzf foma-dan.tar.gz
export PATH=${PATH}:$(pwd)/foma

If your Linux is Ubuntu and you have superuser privileges, you can also use the package manager to install Foma and its dependencies. Before you do so, check whether your system already has Graphviz. If not, install it before Foma.

sudo apt install graphviz
sudo apt install foma-bin

Mac

  1. First, check your OS X version. Versions 11, 12, 13 ("Big Sur", "Monterey", "Ventura", "Sonoma") are fine; if you have version 10, make sure it's 10.14 or later ("Mojave" or "Catalina").
  2. Install homebrew, if you don't have it already. Make sure you complete the very last step of adding homebrew to your OS's PATH.
  3. In Terminal, install GraphViz through homebrew.
  4. Install foma.
(echo ; echo 'eval "$(/usr/local/bin/brew shellenv)"') >> /Users/XXXX/.zprofile
eval "$(/usr/local/bin/brew shellenv)"
brew install graphviz
brew install foma

Windows

  1. The precompiled binary should work fine on Windows. Download "foma-0.9.18_win32.zip" from here, unzip it, rename the folder name "foma-0.9.18_win32" to "Foma", then move it into C:\Program Files (x86)\
  2. Add Foma to system PATH. Here is how.
  3. Then open a new cmd.exe window (for example, Win key + R, then type cmd.exe and ENTER). Inside the command line, you may want to call chcp 65001 to enable UTF-8, then use cd to navigate to your project folder, then invoke foma.

Credit: Many tips on this page come from Na Rae Han's installation instructions (see here).