Skip to content

Installation

Takahiro Ueda edited this page May 11, 2024 · 25 revisions

Using a package manager

The easiest way to install a stable version of FORM would be to use a package manager, although package managers tend to have old versions of FORM in their official repositories or FORM may not be available (see Repology).

Building from the source distribution

You can build your own FORM binaries on Unix-like systems (e.g., Linux, macOS, Windows Subsystem for Linux or Cygwin). To compile FORM sources, you need reasonably modern C and C++ compilers and the make utility. We recommend building FORM with two external libraries, GMP and zlib. Moreover, it is highly recommended to run the test suite to check whether executables are correctly compiled, which needs Ruby with the so-called test/unit library. All of them can be installed by:

  • Debian or Ubuntu
sudo apt-get update
sudo apt-get install build-essential libgmp-dev ruby zlib1g-dev
  • Fedora
sudo dnf install gcc-c++ gmp-devel make ruby rubygem-test-unit zlib-devel
  • CentOS
sudo yum install gcc-c++ gmp-devel make ruby rubygem-minitest zlib-devel
  • Cygwin (with apt-cyg1)
apt-cyg update
apt-cyg install gcc-g++ libgmp-devel make ruby ruby-test-unit zlib-devel

Source distributions of stable versions of FORM can be found in the Releases page as files with the name form-<version>.tar.gz. As of April 2023, the latest source distribution is form-4.3.1.tar.gz. Note that GitHub provides "Source code (zip)" and "Source code (tar.gz)" links, but these are really "only source code" and insufficient for building. The page also contains pre-built reference manuals and binaries for some specific systems.

After downloading the source distribution and unpacking it, you need to type the following commands in the generated directory:

./configure
make
make check
sudo make install

By default, make install installs binaries into /usr/local/bin. This installation path can be changed by passing the --prefix=DIR option to the ./configure script. You can also manually copy the compiled binary sources/form to any directory. In addition to form, tform will be compiled when POSIX Threads are available. More advanced options are found in the help message shown by ./configure --help. The file "INSTALL" also contains descriptions of some options.

Building from the source repository

If you are not satisfied with a release version for some reason, you can build FORM from the development repository. This requires additional software: Git and Autoconf/Automake. Note that the current source repository, as version 5.0beta, also requires GNU MPFR. They can be installed by, in addition to the packages shown in the previous section:

  • Debian or Ubuntu
sudo apt-get install automake git  # add libmpfr-dev for 5.0beta
  • Fedora
sudo dnf install automake git  # add mpfr-devel for 5.0beta
  • CentOS
sudo yum install automake git  # add mpfr-devel for 5.0beta
  • Cygwin (with apt-cyg)
apt-cyg install automake git  # add libmpfr-devel for 5.0beta

Then, you can clone the repository by

git clone https://github.com/vermaseren/form

which generates a form directory. Note that shallow clones may not work because the build system needs to find the release tag. Then, type the following commands in the generated directory:

autoreconf -i
./configure
make
make check
sudo make install

Brewed libraries

If you want to link the GMP and MPFR libraries installed via Homebrew, you may need to specify their installation paths during the configuration step:

./configure --with-gmp=$(brew --prefix gmp) --with-mpfr=$(brew --prefix mpfr)

Continuous integration

A GitHub Action (setup-form) is available.

Footnotes

1 Unfortunately, the original apt-cyg development has been discontinued. Several forks can be found here and elsewhere. Of course, you can also use the official GUI program setup-x86_64.exe to install the dependencies.