CAPD::DynSys Library  6.0.0
Build CAPD

This section describes how to compile the CAPD library from sources.

Before compiling the library, please check if all System Requirements are fulfilled.

Quick guide on how to build the library

Here is a short list of commands which clones the repository, builds the library with support to multriprecision computation enabled, builds example programs and runs all tests. For more details and options see below.

git clone https://github.com/CAPDGroup/CAPD
cd CAPD
mkdir build
cd build
cmake ..
make -j

Configuration

First download the sources of CAPD (see Get CAPD for more details):

  • either clone the latest master branch of the repository
    git clone https://github.com/CAPDGroup/CAPD
  • or download and unzip the latest stable version from github.com/CAPDGroup/CAPD/releases

We are using the cmake tool to configure the CAPD library. First, you need to create an empty directory in which the library will be built. For example,

mkdir build
cd build
cmake <path_to_CAPD_source_directory> [options]
make -j

List of cmake options

Available CAPD-specific options are:

  1. –DCAPD_ENABLE_MULTIPRECISION=<true|false> - turns on/off support for computation in multiprecision. If true, cmake checks if gmp and mpfr libraries are installed. Default value is true.
    Note
    to enable multiprecision gmp and mpfr libraries must be installed in the system along with their header files.
  2. –DCAPD_BUILD_EXAMPLES=<true|false> - specifies wheter example programs should be built or not. Default value is false.
  3. –DCAPD_BUILD_TESTS=<true|false> - specifies whether test programs should be built or not. Default value is false.
    Note
    Most of the tests are written using Boost test suite. Hence, in order to compile them boost unit test library should be installed in the system – see System Requirements.
  4. –DCAPD_BUILD_ALL=<true|false> - turns on/off building both examples and tests. Default value is false, that is building examples and tests depends on setting CAPD_BUILD_EXAMPLES and CAPD_BUILD_TESTS, respectively.

Usefull cmake general options:

  1. –DCMAKE_INSTALL_PREFIX=<path> - specifies the directory, where the CAPD library will be installed after call to make install. By default it is equal to /usr/local/.
    Note
    Installation of the library is optional. One can still build his own programs, having only locally compiled CAPD library – see Building your own programs for more details.
  2. –DCMAKE_CXX_COMPILER=compiler - specifies, which C++ compiler (e.g. g++, clang++) will be used to build the library.

Example:

cmake .. -DCAPD_BUILD_ALL=true -DCAPD_ENABLE_MULTIPRECISION=true -DCMAKE_CXX_COMPILER=clang++

Installation of the library

This step is optional. After successful build of the library one can call

make install

The above command copies all header files and files for pkg-config to CMAKE_INSTALL_PREFIX directory.

Note

The last command may require administrator rights depending on the path specified in CMAKE_INSTALL_PREFIX.