Back to Building the Pastel library
Pastel provides several build switches to control the code generation. We explain these switches here. Note that these switches are essentially enabled or disabled by the configuration you use to build Pastel.
In the following we list the global preprocessor switches which should be defined at the level of the build-system, not at the source code level.
ENSUREs are runtime checks used to check preconditions for
functions. The triggering of such a check signals the presence
of a bug on the user's side.
However, some of these checks can cause relatively severe
performance degradation, notably when the function is of low complexity.
These checks are marked as PENSUREs, for Performance ENSURE.
This build switch controls the code generation for PENSUREs.
If PASTEL_ENABLE_PENSURES is defined, the tests are generated,
otherwise they are not.
The ASSERTs form another class of runtime checks which are
used internally to check invariants in the Pastel library.
The triggering of such check always signals a presence of a bug
on the part of the implementation. They can possibly interfere
with optimization and therefore this switch allows to control
whether their code is generated or not.
If PASTEL_DEBUG_MODE is defined, the tests are generated,
otherwise they are not.
Pastel uses the OpenMp library for parallelizing some sections
of the code, such as all-nearest neighbors searching.
The OpenMp library comes with a header file omp.h, which however might not
always be available on a given building environment. To solve
this problem, Pastel has a redirection file named pastelomp.h,
which includes omp.h conditionally based on this build switch.
If PASTEL_ENABLE_OMP is defined, then omp.h is included in pastelomp.h,
otherwise it is not included.
Pastel includes some global type definitions in the file mytypes.h,
which is included in practically every file in Pastel. In that file
there is particularly the definition of real type which you might
want to change to either float or double based on your specific
requirements. The other types should be chosen such that they meet
the obvious requirements (e.g. the size of uint16 is 16 bits).
These requirements are checked automatically in pastelsys.cpp in
the PastelSys library. Compilation of that file fails if the
requirements are not met. In this case you might need to change the
types in mytypes.h to proper types.