Installation

Dependencies

pagmo is written in modern C++, and it requires a compiler able to understand at least C++17. pagmo is known to run on the following setups:

  • GCC 7 and later versions on GNU/Linux,

  • Clang 4 and later versions on GNU/Linux,

  • MSVC 2015 and later versions on Windows,

  • Clang 4 and later versions on Windows (with the clang-cl driver for MSVC),

  • MinGW GCC 8 on Windows,

  • Clang on OSX (Xcode 6.4 and later),

  • Clang on FreeBSD.

The pagmo C++ library has the following mandatory dependencies:

  • the Boost C++ libraries (at least version 1.60),

  • the Intel TBB library.

Additionally, pagmo has the following optional dependencies:

Additionally, CMake is the build system used by pagmo and it must also be available when installing from source (the minimum required version is 3.3).

Packages

pagmo packages are available from a variety of package managers on several platforms.

Conda

pagmo is available via the conda package manager for Linux, OSX and Windows thanks to the infrastructure provided by conda-forge. Two packages are available:

  • pagmo, which contains the pagmo shared library,

  • pagmo-devel, which contains the pagmo headers and the CMake support files.

In order to install pagmo via conda, you just need to add conda-forge to the channels, and then we can immediately install pagmo:

$ conda config --add channels conda-forge
$ conda config --set channel_priority strict
$ conda install pagmo pagmo-devel

The conda packages for pagmo are maintained by the core development team, and they are regularly updated when new pagmo versions are released.

Please refer to the conda documentation for instructions on how to setup and manage your conda installation.

Arch Linux

pagmo is also available on the Arch User Repository (AUR) in Arch Linux. It is recommended to use an AUR helper like yay or pikaur for ease of installation. See the AUR helpers page on the Arch Linux wiki for more info.

Note

To install pagmo with optional dependency support like nlopt or ipopt, make sure to install the optional dependencies before installing the pagmo package.

Install optional dependencies:

$ yay -S coin-or-ipopt eigen nlopt

Install pagmo:

$ yay -S pagmo

FreeBSD

A FreeBSD port via pkg has been created for pagmo. In order to install pagmo using pkg, execute the following command:

$ pkg install pagmo2

Homebrew

A Homebrew recipe for pagmo is also available. In order to install pagmo on OSX with Homebrew, it is sufficient to execute the following command:

$ brew install pagmo

Installation from source

After making sure the dependencies are installed on your system, you can download the pagmo source code from the GitHub release page. Alternatively, and if you like living on the bleeding edge, you can get the very latest version of pagmo via git:

$ git clone https://github.com/esa/pagmo2.git

We follow the usual PR-based development workflow, thus pagmo’s master branch is normally kept in a working state.

After downloading and/or unpacking pagmo’s source code, go to pagmo’s source tree, create a build directory and cd into it. E.g., on a Unix-like system:

$ cd /path/to/pagmo
$ mkdir build
$ cd build

Once you are in the build directory, you must configure your build using cmake. This will allow you to enable support for optional dependencies, configure the install destination, etc.

The following options are currently recognised by pagmo’s build system:

  • PAGMO_BUILD_TESTS: build the test suite (defaults to OFF),

  • PAGMO_BUILD_TUTORIALS: build the C++ tutorials (defaults to OFF),

  • PAGMO_WITH_EIGEN3: enable features depending on Eigen3 (defaults to OFF),

  • PAGMO_WITH_NLOPT: enable the NLopt wrappers (defaults to OFF),

  • PAGMO_WITH_IPOPT: enable the Ipopt wrapper (defaults to OFF).

Additionally, there are various useful CMake variables you can set, such as:

  • CMAKE_BUILD_TYPE: the build type (Release, Debug, etc.), defaults to Release.

  • CMAKE_INSTALL_PREFIX: the path into which pagmo will be installed (e.g., this defaults to /usr/local on Unix-like platforms).

  • CMAKE_PREFIX_PATH: additional paths that will be searched by CMake when looking for dependencies.

Please consult CMake’s documentation for more details about CMake’s variables and options.

A typical CMake invocation for pagmo may look something like this:

$ cmake ../ -DPAGMO_BUILD_TESTS=ON -DCMAKE_INSTALL_PREFIX=~/.local

That is, we build the test suite and we will be installing pagmo into our home directory into the .local subdirectory. If CMake runs without errors, we can then proceed to actually building pagmo:

$ cmake --build .

This command will build the pagmo library and, if requested, the test suite. Next, we can install pagmo with the command:

$ cmake  --build . --target install

This command will install the pagmo library and header files to the directory tree indicated by the CMAKE_INSTALL_PREFIX variable.

If enabled, the test suite can be executed with the command:

$ cmake  --build . --target test

Note

On Windows, in order to execute the test suite you have to ensure that the PATH variable includes the directory that contains the pagmo DLL (otherwise the tests will fail to run).

Getting help

If you run into troubles installing pagmo, please do not hesitate to contact us either through our gitter channel or by opening an issue report on github.