Table of Contents

Installation from Source Code

This page describes how to install polymake from the source code. See the downloads page for other ways of installing polymake. In particular, if you are using Ubuntu or Debian, you might want to consider installing our debian packages.

Warning: Unfortunately polymake is not compatible with perl 5.38.0 or newer. Since several Linux distributions have switched to the new perl version the polymake package had to be removed from their repositories. If you want to continue using polymake you can try our new jll-based binaries or see below to build polymake from source with a custom perl.

Usually, following the description in the quick summary should do the job. Please be aware that the installation procedure described on this page works on UNIX systems with the newest version of polymake. If you have special needs, you might find help in other places:

Mac

We support some versions of MacOS. Please visit the Mac installation page for detailed instructions.

Windows

polymake is not supported on any native Windows platform. You might try to get it running in a UNIX emulation like Cygwin, but you will be left to your own devices since we are not used to this setup.

Legacy versions

If you for some reason are trying to build an old version of polymake, please consult the legacy installation page additionally, as it may have details that are not necessary for the most recent polymake anymore.

Quick summary

Installing polymake from sources can usually be accomplished using the following six steps:

Dependencies

Must have

Before you start you should check whether you have got all the building tools and prerequisite packages. See the distributions section for package lists for some common linux distros. Here's what you'll need:

Perlbrew

If your perl version is 5.38 or newer you need to build a custom perl to use with polymake. The easiest way to do this is to install perlbrew with your package manager (or from https://perlbrew.pl/).

Once you have perlbrew installed you need to initialize it with perlbrew init and add source ~/perl5/perlbrew/etc/bashrc to your shell rc file as shown in the output. To build a compatible perl use:

perlbrew install perl-5.36.1 --as pmperl -Duseshrplib

The above command will take a few minutes, once that is done you can (temporarily) switch the perl version for the current shell with perlbrew use pmperl. This change is active until you close that terminal again.

To install the required perl modules for this perl installation run:

perlbrew use pmperl
perlbrew install-cpanm
cpanm Term::ReadLine::Gnu Term::ReadKey XML::SAX XML::Writer JSON SVG

In this shell you can now run the configure script for polymake and continue with the installation instructions. Make sure to always switch the perl to pmperl before running polymake.

If you want pretty things and use bundled extensions, you might want to consider installing further packages.

Libraries

Perl modules

Visualization

Minimal tarball

Since the minimal tarball version does not contain several of the bundled libraries, the packaging system should make sure the following additional dependencies are met. Check ./configure --help for the corresponding command line arguments.

As the PermLib and SymPol librarys polymake uses are not available in most distributions, they are included even in the minimal tarball.

Configuration

The next step after unpacking the tar ball is

./configure

polymake's configuration is not based on autoconf, but it looks similar. If you are working in a standard environment then your configuration probably does not require any further options. For more elaborate ways to configure your setup see below.

After the configuration, you get a new subtree build.ARCH, where ARCH is usually an abbreviation of your hardware platform as reported by uname -m . Inside this directory there is a file conf.make which can be manually edited, if necessary.

To get the complete picture of the configuration options:

./configure --help

It is common for GNU/Linux programs to be installed into /usr/local. Obviously, the installation requires write privileges set accordingly. If you want to install to somewhere else use --prefix=/my/installation/directory. Notice that the installation directory must be distinct from the directory where you compile.

Further options

Remark: Please avoid mixing different C++ libraries when building the dependencies and polymake and make sure they use the same C++ ABI version:
Libraries with C++ interface should be built with -std=c++11 or newer.

If you opt to exclude Java components from the build, you won't be able to use any of Java-based visualization tools with polymake. However, you (or other users of your polymake installation) can revise this decision later: after having installed a Java SDK, you'll have to reconfigure the corresponding rule files.

The results of running the configuration script are stored in the file build.ARCH/conf.make . You might edit it manually if needed. At the very beginning the copy of your last configure command is stored for documentation purposes. You can pick it there and repeat the configuration for a different platform or with different options. As long as you specify different architecture names, several configurations can peacefully co-exist.

Compilation and Installation

Having finished the configuration, run

make

If your machine is equipped with several CPUs (or cores), you should utilize them all: make -jN , where N is the number of cores to be used. Otherwise schedule the compilation step for your extended lunch break. Please be aware that gcc may require up to 1GB RAM (per core used) during the compilation!

If you want, for whatever reason, recompile the Java interface modules, it can be done with

make all-java

Then, run

sudo make install

If you are building polymake for several hardware platforms sharing the architecture-independent parts, the command from the second platform on should be

sudo make install-arch [Arch=NAME]

Note: If you are installing polymake in your home-directory, i.e. you have set --prefix, you should omit sudo in the above commands.

Dependency lists for common distros

Debian and Ubuntu

Packages

We are proud to announce that polymake is part of the debian package library. So for newer debian based distributions like Ubuntu 15.10 (Wily Werewolf) you can install polymake by using the command:

sudo apt-get install polymake

This will install polymake and all its dependencies.

Please note that jReality is not part of the debian package (which is built from the minimal tarball). You may want to use other visualization methods like threejs, tikz or javaview.

Installation from Source

On most recent Ubuntu versions installing the following packages (and their dependencies) should suffice to build polymake 4.1 from source:

sudo apt-get install ant ant-optional default-jdk g++ libboost-dev \
libflint-dev libgmp-dev libgmpxx4ldbl libmpfr-dev libperl-dev libterm-readline-gnu-perl \
libxml-perl libxml-writer-perl libterm-readkey-perl libjson-perl ninja-build

If you are going to use the polymake Database, you'll also need to install

libmongodb-perl

The following packages are recommended but not strictly necessary:

libbliss-dev libsvg-perl

Fedora

The following should suffice to be able to build polymake from source on Fedora

sudo dnf install ant java-1.8.0-openjdk-devel gcc-c++ boost-devel \
flint-devel gmp-devel mpfr-devel perl-devel perl-XML-Writer \
perl-ExtUtils-Embed perl-TermReadKey perl-Term-ReadLine-Gnu bliss-devel \
ninja-build perl-JSON

You might need to specify the path to your java installation with --with-java=JAVA_HOME.

Arch Linux

The following should suffice to be able to build polymake from source on Arch Linux 4.13.12:

sudo pacman -S gcc readline perl libxml-perl perl-xml-writer perl-json \
perl-term-readline-gnu perl-term-readkey mpfr gmp boost ninja flint

OpenSuse

You need to install ant and ant-antlr packages to recompile the java sources. PPL is available in ppl-devel. The package for Ninja is called ninja.

Scientific Linux

The following packages together with their dependencies should suffice to build polymake on a minimal install of SL7:

lbzip2 perl gcc-c++ perl-XML-Writer perl-Term-ReadLine-Gnu \
perl-Term-ReadKey gmp-devel mpfr-devel boost-devel perl-ExtUtils-Embed\
ninja-build

For visualization via jreality java-1.8.0-openjdk-devel and and-antlr are needed, passing --with-java=/usr/lib/jvm/java to configure should help with the java detection.