Building the Pastel library

Back to Pastel

This section describes how to build the Pastel library.

Compiler

Since Pastel uses C++14, it requires a recent compiler to be built. The following work:

Operating system Compiler
Windows Visual Studio 2017
Linux Gcc 5.4
MacOsX XCode 6.4

External dependencies

The external dependencies are detailed here.

Boost

Windows

Under Windows, unpack Boost to some directory.

Linux

Under Linux and aptitude write:

sudo apt install libboost-dev

Ranges-v3

Windows

Under Windows, unpack the modified ranges-v3 to some directory.

Linux

Under Linux, unpack the original ranges-v3 to some directory.

Armadillo

Windows

Under Windows, unpack Armadillo to some directory.

Linux

Under Linux and aptitude write:

sudo apt install libarmadillo-dev

Threading Building Blocks

Windows

Under Windows, unpack Threading Building Blocks to some directory.

Linux

Under Linux and aptitude write:

sudo apt install libtbb-dev

LAPACK and BLAS

Windows

We provide prebuilt libraries for LAPACK and BLAS under Windows; these are the same as provided with Armadillo.

Linux

Under Linux and aptitude write:

sudo apt install liblapack-dev

CMake

Windows

Under Windows, install CMake using an installer.

Linux

Under Linux and aptitude write:

sudo apt install cmake

Paths to external dependencies

Modify Paths.cmake to refer to the locations you installed the external libraries at. You may also need to modify paths in FindTbb_.cmake and other files named like FindXXX_.cmake.

Generate tool-specific build-files

Generate the tool-specific build-files.

Generation

Build options

BuildExamples
Whether to build Pastel’s example executables.
BuildLibraries
Whether to build Pastel’s core libraries.
BuildMatlab
Whether to build Pastel’s Matlab libraries.
BuildTests
Whether to build Pastel’s test executables.

Build type

Pastel comes with the standard CMake build-configurations, which are

The Debug configuration enables debugging information and ASSERTs and PENSUREs. The RelWithDebInfo configuration disables ASSERTs and PENSUREs, but enables debug information. The Release configuration disables both.

Property / Config Debug Release RelWithDebInfo
ASSERT and PENSURE x
ENSURE x x x
Debug information x x

Makefiles

For a single-configuration tool-set, such as makefiles, the build-configuration can be chosen in cmake-gui by selecting the proper value for CMAKE_BUILD_TYPE .

Visual Studio

The build-configuration is chosen inside the Visual Studio IDE after opening the generated solution.

XCode

The build-configuration is chosen inside the XCode IDE after opening the generated solution.

Tool-set

If you want to change the tool-set later, you need to remove the CMakeCache.txt file, and run these instructions again. The purpose of this file is to remember options so that they need not specified repeatedly.

Building

Compile and link the toolset-specific build files.

Makefiles

In the build/ directory, run

make -j 4

The j option specifies the number of threads to use in the building process. On multi-core machines this shortens the build-times dramatically.

Visual Studio

To build Pastel using Visual Studio:

XCode

To build Pastel in XCode 4:

Output files

The libraries will be placed in the lib/toolset/config directory, and the executables will be placed in the bin/toolset/config directory, where the toolset is the used tool-set, and config is the used configuration.

Learn more

Files

Armadillo configuration

Blas configuration

Boost configuration

Compiler setup

Lapack configuration

Manual paths for external libraries

Matlab configuration

Ranges-v3 configuration

Tbb configuration