Skip to content

Commit 31a26ec

Browse files
committed
Boost 1.39 or later required.
This allows one to use make_shared to create shared_ptr instances. Unfortunately, the C++03 version only allows a maximum of 9 constructor arguments, so we won't be able to use it everywhere. (Also, let's use make_shared in new code, and by all means use it to replace explicit new when you come across it, but I wouldn't go and hunt for all allocations. A quick grep call gives more than 1000 hits, and the time to change them all is better spent for something else.)
1 parent b9e80a3 commit 31a26ec

File tree

12 files changed

+12
-47
lines changed

12 files changed

+12
-47
lines changed

QuantLib.spec.in

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ and developers.
3030
%package devel
3131
Summary: The header files and the static library.
3232
Group: Development/Libraries
33-
Requires: QuantLib = %{version}, boost >= 1.34.1
34-
BuildRequires: boost-devel >= 1.34.1
33+
Requires: QuantLib = %{version}, boost >= 1.39.0
34+
BuildRequires: boost-devel >= 1.39.0
3535

3636
%description devel
3737
QuantLib is an open source C++ library for financial quantitative analysts
@@ -43,8 +43,8 @@ use the QuantLib C++ libraries.
4343
%package test-suite
4444
Summary: The test-suite to check the setup of quantlib installation.
4545
Group: Development/Tools
46-
Requires: QuantLib = %{version}, boost-test >= 1.34.1
47-
BuildRequires: boost-test >= 1.34.1
46+
Requires: QuantLib = %{version}, boost-test >= 1.39.0
47+
BuildRequires: boost-test >= 1.39.0
4848

4949
%description test-suite
5050
QuantLib is an open source C++ library for financial quantitative analysts

Readme.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ in a number of formats from <http://quantlib.org>.
1212

1313
QuantLib depends on Boost <http://www.boost.org>. You will need to
1414
download, build, and install Boost before compiling and using
15-
QuantLib. Boost 1.34.1 or later is required.
15+
QuantLib. Boost 1.39 or later is required.
1616

1717
Please report bugs using the Bug Tracker at
1818
<http://sourceforge.net/tracker/?group_id=12740&atid=112740>,

acinclude.m4

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ AC_DEFUN([QL_CHECK_BOOST_DEVEL],
5555
# ----------------------
5656
# Check whether the Boost installation is up to date
5757
AC_DEFUN([QL_CHECK_BOOST_VERSION],
58-
[AC_MSG_CHECKING([Boost version])
58+
[AC_MSG_CHECKING([for Boost version >= 1.39])
5959
AC_REQUIRE([QL_CHECK_BOOST_DEVEL])
6060
AC_TRY_COMPILE(
6161
[@%:@include <boost/version.hpp>],
62-
[@%:@if BOOST_VERSION < 103100
62+
[@%:@if BOOST_VERSION < 103900
6363
@%:@error too old
6464
@%:@endif],
6565
[AC_MSG_RESULT([yes])],

ql/math/distributions/normaldistribution.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@
2222

2323
#include <ql/math/distributions/normaldistribution.hpp>
2424
#include <ql/math/comparison.hpp>
25-
26-
#if BOOST_VERSION >= 103500
2725
#include <boost/math/distributions/normal.hpp>
28-
#endif
2926

3027
namespace QuantLib {
3128

@@ -170,7 +167,6 @@ namespace QuantLib {
170167
return average_ + result*sigma_;
171168
}
172169

173-
#if BOOST_VERSION >= 103500
174170
MaddockInverseCumulativeNormal::MaddockInverseCumulativeNormal(
175171
Real average, Real sigma)
176172
: average_(average), sigma_(sigma) {}
@@ -179,5 +175,5 @@ namespace QuantLib {
179175
return boost::math::quantile(
180176
boost::math::normal_distribution<Real>(average_, sigma_), x);
181177
}
182-
#endif
178+
183179
}

ql/math/distributions/normaldistribution.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,6 @@ namespace QuantLib {
225225
static const Real c8_;
226226
};
227227

228-
#if BOOST_VERSION >= 103500
229228
//! Maddock Inverse cumulative normal distribution class
230229
/*! Given x between zero and one as
231230
the integral value of a gaussian normal distribution
@@ -250,7 +249,7 @@ namespace QuantLib {
250249
private:
251250
const Real average_, sigma_;
252251
};
253-
#endif
252+
254253

255254
// inline definitions
256255

ql/money.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ namespace QuantLib {
193193

194194

195195
std::ostream& operator<<(std::ostream& out, const Money& m) {
196-
#if defined(QL_PATCH_MSVC71) && BOOST_VERSION > 103600
196+
#if defined(QL_PATCH_MSVC71)
197197
// boost::format doesn't work with VC7 - simplified output
198198
return out << m.currency().code() << " "
199199
<< m.rounded().value();

ql/qldefines.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636

3737
#include <boost/config.hpp>
3838
#include <boost/version.hpp>
39-
#if BOOST_VERSION < 103100
39+
#if BOOST_VERSION < 103900
4040
#error using an old version of Boost, please update.
4141
#endif
4242
#if !defined(BOOST_ENABLE_ASSERT_HANDLER)

test-suite/distributions.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,6 @@ void DistributionTest::testNormal() {
250250
<< "tolerance exceeded");
251251
}
252252

253-
#if BOOST_VERSION >= 103500
254253
MaddockInverseCumulativeNormal mInvCum(average, sigma);
255254
std::transform(x.begin(),x.end(), x.begin(), diff.begin(),
256255
compose3(std::minus<Real>(),
@@ -262,7 +261,6 @@ void DistributionTest::testNormal() {
262261
<< QL_SCIENTIFIC << e << "\n"
263262
<< "tolerance exceeded");
264263
}
265-
#endif
266264

267265
// check that cum.derivative = Gaussian
268266
for (i=0; i<x.size(); i++)

test-suite/fdheston.cpp

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,7 @@
5555
#include <ql/experimental/finitedifferences/fdmhestonfwdop.hpp>
5656

5757
#include <boost/math/special_functions/gamma.hpp>
58-
#if BOOST_VERSION >= 103900
5958
#include <boost/math/distributions/non_central_chi_squared.hpp>
60-
#endif
6159

6260
using namespace QuantLib;
6361
using boost::unit_test_framework::test_suite;
@@ -789,7 +787,6 @@ void FdHestonTest::testBlackScholesFokkerPlanckFwdEquation() {
789787

790788
namespace {
791789

792-
#if BOOST_VERSION >= 103900
793790
Real squareRootGreensFct(Real v0, Real kappa, Real theta,
794791
Real sigma, Real t, Real x) {
795792

@@ -803,7 +800,6 @@ namespace {
803800

804801
return boost::math::pdf(dist, x/k) / k;
805802
}
806-
#endif
807803

808804
Real stationaryProbabilityFct(Real kappa, Real theta,
809805
Real sigma, Real v) {
@@ -839,8 +835,6 @@ namespace {
839835
}
840836

841837
void FdHestonTest::testSquareRootZeroFlowBC() {
842-
#if BOOST_VERSION >= 103900
843-
844838
BOOST_TEST_MESSAGE("Testing Zero Flow BC for the square root process...");
845839

846840
SavedSettings backup;
@@ -904,7 +898,6 @@ void FdHestonTest::testSquareRootZeroFlowBC() {
904898
<< "\n tolerance: " << tol);
905899
}
906900
}
907-
#endif
908901
}
909902

910903

@@ -1054,8 +1047,6 @@ void FdHestonTest::testSquareRootEvolveWithStationaryDensity() {
10541047
}
10551048

10561049
void FdHestonTest::testSquareRootFokkerPlanckFwdEquation() {
1057-
#if BOOST_VERSION >= 103900
1058-
10591050
BOOST_TEST_MESSAGE("Testing Fokker-Planck forward equation "
10601051
"for the square root process with Dirac start...");
10611052

@@ -1120,7 +1111,6 @@ void FdHestonTest::testSquareRootFokkerPlanckFwdEquation() {
11201111
<< "\n tolerance: " << tol);
11211112
}
11221113
}
1123-
#endif
11241114
}
11251115

11261116

@@ -1310,16 +1300,12 @@ test_suite* FdHestonTest::experimental() {
13101300
test_suite* suite = BOOST_TEST_SUITE("Finite Difference Heston tests");
13111301
suite->add(QUANTLIB_TEST_CASE(
13121302
&FdHestonTest::testBlackScholesFokkerPlanckFwdEquation));
1313-
#if BOOST_VERSION >= 103900
13141303
suite->add(QUANTLIB_TEST_CASE(&FdHestonTest::testSquareRootZeroFlowBC));
1315-
#endif
13161304
suite->add(QUANTLIB_TEST_CASE(&FdHestonTest::testTransformedZeroFlowBC));
13171305
suite->add(QUANTLIB_TEST_CASE(
13181306
&FdHestonTest::testSquareRootEvolveWithStationaryDensity));
1319-
#if BOOST_VERSION >= 103900
13201307
suite->add(QUANTLIB_TEST_CASE(
13211308
&FdHestonTest::testSquareRootFokkerPlanckFwdEquation));
1322-
#endif
13231309
suite->add(QUANTLIB_TEST_CASE(
13241310
&FdHestonTest::testHestonFokkerPlanckFwdEquation));
13251311

test-suite/fdmlinearop.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1276,7 +1276,6 @@ void FdmLinearOpTest::testSpareMatrixReference() {
12761276

12771277
namespace {
12781278
#ifndef QL_NO_UBLAS_SUPPORT
1279-
#if BOOST_VERSION >= 103900
12801279
Size nrElementsOfSparseMatrix(const SparseMatrix& m) {
12811280
Size retVal = 0;
12821281
for (SparseMatrix::const_iterator1 i1 = m.begin1();
@@ -1286,12 +1285,10 @@ namespace {
12861285
return retVal;
12871286
}
12881287
#endif
1289-
#endif
12901288
}
12911289

12921290
void FdmLinearOpTest::testSparseMatrixZeroAssignment() {
12931291
#ifndef QL_NO_UBLAS_SUPPORT
1294-
#if BOOST_VERSION >= 103900
12951292
BOOST_TEST_MESSAGE("Testing SparseMatrix zero assignment...");
12961293

12971294
SparseMatrix m(5,5);
@@ -1311,7 +1308,6 @@ void FdmLinearOpTest::testSparseMatrixZeroAssignment() {
13111308
BOOST_FAIL("three elements expected");
13121309
}
13131310
#endif
1314-
#endif
13151311
}
13161312

13171313
test_suite* FdmLinearOpTest::suite() {

0 commit comments

Comments
 (0)