Installation from Source Code

Installing polymake from the source code can be a rather tedious task compared to picking up ready-to-use binary packages like RPM or Fink. Unfortunately, we can't afford to prepare binaries for all possible combinations of hardware and operating system, thus you'll sometimes have to take this approach.

Please be aware that the installation procedure described here works on UNIX systems only. 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.

Quick summary

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

  1. Download a source tarball from the download page.
  2. Unpack the tarball and change into the source directory with
    tar xjf polymake-VERSION.tar.bz2
    cd polymake-VERSION

  3. Install needed packages according to your distribution. In the distributions section there are lists of packages for a variety of linux distributions.
  4. Configure polymake with

    ./configure

    There are many options that you can (de-)activate, see the configuration section and the further options subsection for details.

  5. Make and install polymake with

    make
    sudo make install

    If your system has multiple cores you can speed of the build process, see the build section for further details.

Preparation

Before you start you should check whether you have got all the building tools and prerequisite packages:

  • C and C++ compilers with full 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
  • C++ Library (one of the following):
    • GNU C++ Library. (On Linux this is usually already in the base system, or comes with gcc)
    • libc++, might come with LLVM/clang
  • XML processing tools: libxml2, libxslt (both being standard components of Gnome environment)
  • GNU Readline & History library v5.0+
  • Perl 5.16.0+, with all of the following modules:
    • ExtUtils::Embed, which some distributions ship separately as perl-ExtUtils-Embed
    • XML::LibXML, XML::LibXSLT, and XML::Writer
    • Term::ReadLine::Gnu
    • Term::ReadKey
  • GMP library 5.1.0+ . Some Linux vendors split the GMP in two packages, shared libraries and development stuff. Please install both. You also need to enable/install the C++ bindings for polymake version 2.11+.
  • MPFR library 3.0.0+ . Again both shared libraries and development stuff are required.
  • boost headers. The basic libboost-dev should suffice, no shared libraries are required for boost.

Libraries

  • bliss for computing automorphism groups of graphs and checking combinatorial equivalence of polytopes. Strongly recommended for the -minimal package, see also below.
  • PPL for convex hull computations, in many cases faster than the bundled cdd or lrs code.
  • Singular for Groebner basis computations.

Perl modules

  • SVG producing SVG pictures
  • MongoDB perl interface for the polydb interface

Visualization

  • A webbrowser with WebGL support for the three.js visualization (e.g. chrome, firefox or safari).
  • Java Development Kit 1.5+ if you are going to use the visualization tools 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.

Minimal tarball

Mandatory dependencies

Since the minimal tarball 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.

  • convex hull computation, at least cdd is required:
    • cddlib shared library, i.e. libcdd-dev or cddlib-devel
    • lrslib shared library, i.e. liblrs-dev or lrslib-devel
    • PPL shared library, i.e. libppl-dev or ppl-devel
  • graph isomorphism computation, exactly one of the following:
    • bliss shared library, i.e. libbliss-dev
      debian-like with headers in <prefix>/include/bliss/
    • nauty source directory (supported since polymake 3.0r2)

Libraries included in the minimal tarball

Since the following libraries are not available in most distributions they are included even in the minimal tarball:

  • PermLib (by Thomas Rehn) is shipped with polymake in external/permlib.
    The interface also supports a custom directory via --with-permlib=DIR.
  • SymPol (by Thomas Rehn and Achill Schürmann) is included in bundled/sympol/external/sympol.
    The interface also supports a custom directory via --with-sympol=DIR. Note that using a custom sympol installation is incompatible with the bundled versions of cdd, lrs and permlib; i.e. all of these have to be installed separately.
  • Normaliz (by Winfried Bruns, Bogdan Ichim and Christof Söger) is included in bundled/libnormaliz/external/libnormaliz.
    Since we use libnormaliz purely as a template-library (via libnormaliz-all.cpp) with our own Integer type this interface does not support custom installations at the moment.

More information on the bundled extensions and the corresponding software can be found here.

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

  • Enforcing a different directory layout.
    Using the following options you can place the parts of the polymake installation according to any possible layout convention:
    • --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.
  • Specifying the compilation options:
    • 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).
  • Specifying the build prerequisites:
    • --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
  • Optional libraries, see also the external software page:
    • --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

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.

  • Java interface options:
    • --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.
  • Preparing the Java interface re-build (normally not needed):
    • --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.

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.

Building the documentation

Finally, to obtain a copy of the reference documentation in HTML format (gathering everything you can get with interactive help commands a one place), run

sudo make release-docs

This will create all files in the documentation directory chosen during the configuration, again omit sudo for a user-install. By default the documentation will be installed into /usr/local/share/polymake/doc.

If you have already used polymake and installed extensions to polymake then to include them for the documentation, run

sudo make docs

Should you import or create a new extension later, you can also run the polymake script generate_docs to complete your documentation.

Distributions

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.

Source installation

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

sudo apt-get install ant ant-optional default-jdk g++ libboost-dev \
libgmp-dev libgmpxx4ldbl libmpfr-dev libperl-dev libterm-readline-gnu-perl \
libxml-libxml-perl libxml-libxslt-perl libxml-perl libxml-writer-perl \
libterm-readkey-perl libxml2-dev xsltproc 

The following packages are also recommended:

libmongodb-perl libbliss-dev libsvg-perl

Fedora

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

sudo dnf install ant java-1.8.0-openjdk-devel gcc-c++ boost-devel \
gmp-devel mpfr-devel perl-devel perl-XML-LibXML perl-XML-LibXSLT \
perl-XML-Writer libxml2-devel perl-ExtUtils-Embed perl-Term-ReadKey \
perl-Term-ReadLine-Gnu bliss-devel

You might need to specify the path to java with --with-java=PATH.

OpenSuse

You need to install ant and ant-antlr packages to recompile the java sources. PPL is available in ppl-devel.

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-XML-LibXML perl-XML-LibXSLT \
perl-Term-ReadLine-Gnu perl-Term-ReadKey gmp-devel mpfr-devel boost-devel \
libxml2-devel perl-ExtUtils-Embed

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.

Special Notes for Mac OS X

The C++ compiler is not part of the standard system installation and has to be installed separately. All required perl modules, as well as the GMP and GNU readline libraries, can be installed via Fink, Homebrew or independently. Look at our page with extra information for the Mac for detailed instructions.

howto/install.txt · Last modified: 2017/07/05 17:15 by gawrilow
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 4.0 International
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki