FFC is normally installed as part of an installation of FEniCS. If you are using FFC as part of the FEniCS software suite, it is recommended that you follow the installation instructions for FEniCS.

To install FFC itself, read on below for a list of requirements and installation instructions.

Requirements and dependencies

FFC requires Python version 2.7 or later and depends on the following Python packages:

  • NumPy
  • six

FFC also depends on the following FEniCS Python packages:

  • FIAT
  • UFL
  • dijitso

These packages will be automatically installed as part of the installation of FFC, if not already present on your system.

TSFC requirements

To use experimental tsfc representation, additional dependencies are needed:

and in turn their additional dependencies:


TSFC requirements are not installed in FEniCS Docker images by default yet but they can be easilly installed on demand:

docker pull
docker run -ti --rm
sudo apt-get update && sudo apt-get -y install glpk-utils && \
  sudo pip2 install --prefix=${FENICS_PREFIX} --no-cache-dir \
  git+ \
  git+ \
  git+ \
  singledispatch networkx pulp && \
  sudo pip3 install --prefix=${FENICS_PREFIX} --no-cache-dir \
  git+ \
  git+ \
  git+ \
  singledispatch networkx pulp && \
  sudo apt-get clean && \
  sudo rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

The first two commands (or their modification, or fenicsproject helper script) are to be run on a host, while the last command, to be run in the container, actually installs all the TSFC requirements. For further reading, see FEniCS Docker reference.

[1](1, 2, 3) These are forks of the original packages tested to be compatible with FFC and updated frequently from upstream.
[2](1, 2, 3) Pip-installable.
[3]Binary package; glpsol executable needed. Version GLPSOL: GLPK LP/MIP Solver, v4.57 from Ubuntu 16.04 glpk-utils package is known to produce the same references as our test system.
[4](1, 2) Needed for certain COFFEE optimizations.

Installation instructions

To install FFC, download the source code from the FFC Bitbucket repository, and run the following command:

pip install .

To install to a specific location, add the --prefix flag to the installation command:

pip install --prefix=<some directory> .