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:
We support some versions of MacOS. Please visit the Mac installation page for detailed instructions.
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.
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.
Installing polymake from sources can usually be accomplished using the following six steps:
tar xjf polymake-VERSION.tar.bz2 cd polymake-VERSION
./configure
There are many options that you can (de-)activate, see the configuration section and the further options subsection for details.
make sudo make install
If your system has multiple cores you can speed of the build process, see the build section for further details.
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:
C++14
support, one of the following is recommended:
gcc
and g++
, version at least 5 (Note that these might come in separate packages)
clang
, version at least 3.4
gcc
)
ninja-build
.
libxml2
, libxslt
(both being standard components of Gnome environment)
ExtUtils::Embed
, which some distributions ship separately as perl-ExtUtils-Embed
XML::SAX
XML::Writer
Term::ReadLine::Gnu
Term::ReadKey
JSON
libboost-dev
should suffice, no shared libraries are required for boost.
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.
-minimal
package, see also below.
JavaView
or jReality
via polymake.
ant
1.7.1+ with ant-antlr
task is needed if you want to recompile the interface to the Java visualization tools, but normally you won't do it.
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.
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.
--prefix=DIR
put everything beneath this directory.
--exec-prefix=DIR
put the architecture-dependent parts beneath this directory, namely the main script polymake
and the compiled modules.
--bindir=DIR
put the main script polymake
in this directory
--includedir=DIR
put the header files in this directory (actually, creates a subdirectory polymake
there)
--libdir=DIR
put the callable library libpolymake
in this directory
--libexecdir=DIR
put the dynamic modules (loadable at runtime) and Java native interface libraries in this directory (actually, creates a subdirectory polymake
there)
--datadir=DIR
put the architecture-independent parts in this directory, namely the perl modules, rule files, scripts, and java archives.
--docdir=DIR
put the automatically generated documentation in HTML format in this directory
--build=ARCH
assign this architecture name to the current build configuration; per default, some excerpt from uname -a
is taken.
CC=program
the C compiler
CFLAGS="options"
options for the C compiler, e.g. enabling machine-specific optimization or non-standard include paths
CXX=program
the C++ compiler
CXXFLAGS="options"
options for the C++ compiler
CXXOPT=-On
optimization level of the C++ compiler (some unlucky versions happen to produce broken code when trying hard to optimize)
LDFLAGS="options"
options for the linker, e.g. non-standard library search paths
LIBS="-lLib …"
additional non-standard libraries required for C++ programs
PERL=program
the perl interpreter
--with-toolchain=DIR
path to a full GCC or LLVM (including clang and libc++) installation, automatically sets the above flags for the compiler and standard C++
library.
--with-libcxx
build against the libc++ library instead of the GNU libstdc++, useful when building with LLVM/Clang.
--without-native
don't optimize for the current CPU, i.e. don't set -march=native
to allow running on different CPUs (with the same architecture).
--with-gmp=DIR
location of the Gnu MultiPrecision library (GMP). Its public header file is expected at DIR/include/gmp.h
and the shared libraries under DIR/lib
or DIR/lib64
.
--with-mpfr=DIR
location of the Gnu MultiPrecision Floating-point Reliable library (MPFR). Its public header file is expected at DIR/include/mpfr.h
and the shared libraries under DIR/lib
or DIR/lib64
.
--with-boost=DIR
location of the boost headers
--with-libxml2=DIR
location of the XML processing library
--with-ppl=DIR
installation directory of the Parma Polyhedra Library (PPL)
--with-cdd=DIR
installation directory of cddlib
--with-lrs=DIR
installation directory of lrslib
--with-bliss=DIR
installation directory of bliss, headers must be in DIR/include/bliss/
--with-nauty-src=DIR
nauty source directory
--with-singular=DIR
singular installation directory
--with-soplex=DIR
soplex directory, built with GMP=true
and SHARED=true
--with-permlib=DIR
permlib header directory
--with-sympol=DIR
sympol installation directory, headers should be DIR/include/sympol/
, yal
and matrix
must be in subfolders. Note that using a custom sympol installation is incompatible with the bundled versions of cdd, lrs and permlib; i.e. those then have to be installed separately.
--with-libnormaliz=DIR
libnormaliz installation directory
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.
--with-java=DIR
the top directory of the Java SDK installation
--with-jni-headers=DIR
the location of jni.h
header file, if it resides outside the SDK tree (mostly needed on Macs)
--without-java
you don't have any Java SDK installed on your machine.
--with-fink=DIR
Fink installation top directory (for Mac OS only). Usually it resides at /sw
.
--with-ant=program
the ANT tool
--with-javaview=program
the JavaView start script
--without-javaview
JavaView is not installed on your machine; jReality will still be recompiled
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.
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.
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
.
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
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
.
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
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
.
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.