QuantLib
: a free/open-source library for quantitative finance
fully annotated source code - version 1.38
Loading...
Searching...
No Matches
pages
config.docs
Go to the documentation of this file.
1
2
/*
3
Copyright (C) 2004, 2005 StatPro Italia srl
4
5
This file is part of QuantLib, a free-software/open-source library
6
for financial quantitative analysts and developers - http://quantlib.org/
7
8
QuantLib is free software: you can redistribute it and/or modify it
9
under the terms of the QuantLib license. You should have received a
10
copy of the license along with this program; if not, please email
11
<quantlib-dev@lists.sf.net>. The license is also available online at
12
<http://quantlib.org/license.shtml>.
13
14
This program is distributed in the hope that it will be useful, but WITHOUT
15
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16
FOR A PARTICULAR PURPOSE. See the license for more details.
17
*/
18
19
/*! \page config User configuration
20
21
A number of macros is provided for user configuration. Defining
22
or undefining such macros triggers variations in some library
23
functionality.
24
25
When using CMake, they can be set to `ON` or `OFF` as properties.
26
27
Under a Linux/Unix system, they are (un)set by `configure`;
28
run
29
\code
30
./configure --help
31
\endcode
32
for a list of corresponding command-line options.
33
34
Under a Windows system, they must be (un)defined by editing the
35
file `<ql/userconfig.hpp>` and commenting or uncommenting the
36
relevant lines.
37
38
Such macros include:
39
40
\code
41
#define QL_ERROR_FUNCTIONS
42
\endcode
43
If defined, function information is added to the error messages
44
thrown by the library. Undefined by default.
45
46
\code
47
#define QL_ERROR_LINES
48
\endcode
49
If defined, file and line information is added to the error
50
messages thrown by the library. Undefined by default.
51
52
\code
53
#define QL_ENABLE_TRACING
54
\endcode
55
If defined, tracing messages might be emitted by the library
56
depending on run-time settings. Enabling this option can degrade
57
performance. Undefined by default.
58
59
\code
60
#define QL_EXTRA_SAFETY_CHECKS
61
\endcode
62
If defined, extra run-time checks are added to a few
63
functions. This can prevent their inlining and degrade
64
performance. Undefined by default.
65
66
\code
67
#define QL_USE_INDEXED_COUPON
68
\endcode
69
If defined, indexed coupons (see the documentation) are used in
70
floating legs. If undefined (the default), par coupons are used.
71
72
\code
73
#define QL_ENABLE_SESSIONS
74
\endcode
75
If defined, singletons will return different instances for
76
different threads; in particular, this means that the evaluation
77
date, the stored index fixings and any other settings will be
78
per-thread. Undefined by default.
79
80
\code
81
#define QL_ENABLE_THREAD_SAFE_OBSERVER_PATTERN
82
\endcode
83
If defined, a thread-safe (but less performant) version of the
84
observer pattern is used. You should define it if you want to use
85
%QuantLib via the SWIG layer within the JVM or .NET ecosystem or
86
any other environment with an async garbage collector. Undefined
87
by default.
88
89
\code
90
#define QL_HIGH_RESOLUTION_DATE
91
\endcode
92
If defined, date objects willsupport an intraday datetime
93
resolution down to microseconds. Strictly monotone daycounters
94
(`Actual360`, `Actual365Fixed` and `ActualActual`) will take the
95
additional information into account and allow for accurate
96
intraday pricing. If undefined (the default) the smallest
97
resolution of date objects is a single day. Intraday
98
datetime resolution is experimental.
99
100
\code
101
#define QL_THROW_IN_CYCLES
102
\endcode
103
If defined, lazy objects will raise an exception when they detect
104
a notification cycle which would result in an infinite recursion
105
loop. If undefined (the default), they will break the recursion
106
without throwing. Enabling this option is recommended but might
107
cause existing code to throw.
108
109
\code
110
#define QL_FASTER_LAZY_OBJECTS
111
\endcode
112
If defined (the default), lazy objects will forward the first
113
notification received, and discard the others until recalculated;
114
the rationale is that observers were already notified, and don't
115
need further notifications until they recalculate, at which point
116
this object would be recalculated too. After recalculation, this
117
object would again forward the first notification received.
118
Although not always correct, this behavior is a lot faster and
119
thus is the current default.
120
121
\code
122
#define QL_USE_STD_ANY
123
\endcode
124
If defined (the default), `std::any` and related classes and
125
functions will be used instead of `boost::any`. If undefined, the
126
Boost facilities will be used.
127
128
\code
129
#define QL_USE_STD_OPTIONAL
130
\endcode
131
If defined (the default), `std::optional` and related classes and
132
functions will be used instead of `boost::optional`. If undefined,
133
the Boost facilities will be used.
134
135
\code
136
#define QL_USE_STD_SHARED_PTR
137
\endcode
138
If defined, `std::shared_ptr` and related classes and functions
139
will used instead of `boost::shared_ptr`. If undefined (the
140
default) the Boost facilities will be used. Note that
141
`std::shared_ptr` does not check access and can cause segmentation
142
faults.
143
144
\code
145
#define QL_NULL_AS_FUNCTIONS
146
\endcode
147
If defined, `Null` will be implemented as a template function.
148
This allows the code to work with user-defined `Real` types but
149
was reported to cause internal compiler errors with Visual C++
150
2022 in some cases. If undefined (the default) `Null` will be
151
implemented as a class template, as in previous releases.
152
153
\code
154
#define QL_ENABLE_PARALLEL_UNIT_TEST_RUNNER
155
\endcode
156
If defined, a parallel unit test runner will be used to execute
157
the C++ test suite. This will reduce the runtime on multi core
158
CPUs. Undefined by default.
159
160
*/
161
Generated by
Doxygen
1.9.5