This section describes how to build the Pastel library.
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 |
The external dependencies are detailed here.
Under Windows, unpack Boost to some directory.
Under Linux and aptitude
write:
sudo apt install libboost-dev
Under Windows, unpack the modified ranges-v3 to some directory.
Under Linux, unpack the original ranges-v3 to some directory.
Under Windows, unpack Armadillo to some directory.
Under Linux and aptitude
write:
sudo apt install libarmadillo-dev
Under Windows, unpack Threading Building Blocks to some directory.
Under Linux and aptitude
write:
sudo apt install libtbb-dev
We provide prebuilt libraries for LAPACK and BLAS under Windows; these are the same as provided with Armadillo.
Under Linux and aptitude
write:
sudo apt install liblapack-dev
Under Windows, install CMake using an installer.
Under Linux and aptitude
write:
sudo apt install cmake
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 the tool-specific build-files.
build/
directory.build/
directory, type cmake-gui ..
Configure
button.Advanced
button is not checked.Configure
button again.Generate
button.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 |
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
.
The build-configuration is chosen inside the Visual Studio IDE after opening the generated solution.
The build-configuration is chosen inside the XCode IDE after opening the generated solution.
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.
Compile and link the toolset-specific build files.
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.
To build Pastel using Visual Studio:
Pastel.sln
. To build Pastel in XCode 4:
Pastel.xcodeproj
.Product
–> Scheme
–> Edit scheme...
.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.