Building the Pastel library

Back to Pastel

Here are the steps to build Pastel in Linux. The same steps work in Windows with small changes.

Compiler

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

Operating system Compiler
Windows Visual Studio 2019 16.11.5 or later
Linux Gcc 11 or later
Linux Clang ? or later
MacOsX XCode ? or later

Clone Pastel from github

git clone https://github.com/kaba2/pastel
cd pastel
git checkout 1.6.0

Install vcpkg

In the directory Pastel was cloned to (e.g. pastel):

git clone https://github.com/microsoft/vcpkg
cd vcpkg

Linux

./bootstrap-vcpkg.sh
./vcpkg integrate bash

Windows

bootstrap-vcpkg
vcpkg integrate install

Install dependencies

In the directory vcpkg was cloned to (e.g. pastel/vcpkg):

Linux

./vcpkg install boost
./vcpkg install tbb
./vcpkg install range-v3
./vcpkg install eigen3

Windows

vcpkg install boost
vcpkg install tbb
vcpkg install range-v3
vcpkg install eigen3

Generate build files

In the directory Pastel was cloned to (e.g. pastel):

cmake -S . -DCMAKE_BUILD_TYPE=RelWithDebInfo -B build

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

Building

Compile and link the toolset-specific build files.

Makefiles

cd build
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

start build/Pastel.sln

XCode

To build Pastel in XCode:

Learn more

Files

Compiler setup

Matlab configuration