I have followed the guidlines for installing QuantLib for mac from here http://quantlib.org/install/macosx.shtml and also fixed the flags using the commands:
export CXXFLAGS = -stdlib=libstdc++
export LDFLAGS = -mmacosx-version-min=10.6
However, when I try to compile the examples as told in the guidlines, I get the following error:
In file included from BermudanSwaption.cpp:22:
In file included from /opt/local/include/ql/quantlib.hpp:43:
In file included from /opt/local/include/ql/experimental/all.hpp:25:
In file included from /opt/local/include/ql/experimental/volatility/all.hpp:21:
In file included from /opt/local/include/ql/experimental/volatility/zabr.hpp:31:
In file included from /opt/local/include/ql/math/statistics/incrementalstatistics.hpp:35:
In file included from /opt/local/include/boost/accumulators/statistics/stats.hpp:14:
In file included from /opt/local/include/boost/accumulators/statistics_fwd.hpp:12:
/opt/local/include/boost/mpl/print.hpp:50:19: warning: in-class initialization of non-static data member is a
C++11 extension [-Wc++11-extensions]
const int m_x = 1 / (sizeof(T) - sizeof(T));
^
1 warning generated.
Undefined symbols for architecture x86_64:
"QuantLib::MultiStepSwap::nextTimeStep(QuantLib::CurveState const&, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> >&, std::__1::vector<std::__1::vector<QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator<QuantLib::MarketModelMultiProduct::CashFlow> >, std::__1::allocator<std::__1::vector<QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator<QuantLib::MarketModelMultiProduct::CashFlow> > > >&)", referenced from:
vtable for QuantLib::MultiStepSwap in BermudanSwaption-a6bf28.o
"QuantLib::ExerciseAdapter::nextTimeStep(QuantLib::CurveState const&, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> >&, std::__1::vector<std::__1::vector<QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator<QuantLib::MarketModelMultiProduct::CashFlow> >, std::__1::allocator<std::__1::vector<QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator<QuantLib::MarketModelMultiProduct::CashFlow> > > >&)", referenced from:
vtable for QuantLib::ExerciseAdapter in BermudanSwaption-a6bf28.o
"QuantLib::OneStepForwards::nextTimeStep(QuantLib::CurveState const&, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> >&, std::__1::vector<std::__1::vector<QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator<QuantLib::MarketModelMultiProduct::CashFlow> >, std::__1::allocator<std::__1::vector<QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator<QuantLib::MarketModelMultiProduct::CashFlow> > > >&)", referenced from:
vtable for QuantLib::OneStepForwards in BermudanSwaption-a6bf28.o
"QuantLib::BermudanExercise::BermudanExercise(std::__1::vector<QuantLib::Date, std::__1::allocator<QuantLib::Date> > const&, bool)", referenced from:
_main in BermudanSwaption-a6bf28.o
"QuantLib::MultiStepNothing::nextTimeStep(QuantLib::CurveState const&, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> >&, std::__1::vector<std::__1::vector<QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator<QuantLib::MarketModelMultiProduct::CashFlow> >, std::__1::allocator<std::__1::vector<QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator<QuantLib::MarketModelMultiProduct::CashFlow> > > >&)", referenced from:
vtable for QuantLib::MultiStepNothing in BermudanSwaption-a6bf28.o
"QuantLib::MultiStepRatchet::nextTimeStep(QuantLib::CurveState const&, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> >&, std::__1::vector<std::__1::vector<QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator<QuantLib::MarketModelMultiProduct::CashFlow> >, std::__1::allocator<std::__1::vector<QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator<QuantLib::MarketModelMultiProduct::CashFlow> > > >&)", referenced from:
vtable for QuantLib::MultiStepRatchet in BermudanSwaption-a6bf28.o
"QuantLib::MultiStepForwards::nextTimeStep(QuantLib::CurveState const&, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> >&, std::__1::vector<std::__1::vector<QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator<QuantLib::MarketModelMultiProduct::CashFlow> >, std::__1::allocator<std::__1::vector<QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator<QuantLib::MarketModelMultiProduct::CashFlow> > > >&)", referenced from:
vtable for QuantLib::MultiStepForwards in BermudanSwaption-a6bf28.o
"QuantLib::MultiStepSwaption::nextTimeStep(QuantLib::CurveState const&, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> >&, std::__1::vector<std::__1::vector<QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator<QuantLib::MarketModelMultiProduct::CashFlow> >, std::__1::allocator<std::__1::vector<QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator<QuantLib::MarketModelMultiProduct::CashFlow> > > >&)", referenced from:
vtable for QuantLib::MultiStepSwaption in BermudanSwaption-a6bf28.o
"QuantLib::OneStepOptionlets::nextTimeStep(QuantLib::CurveState const&, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> >&, std::__1::vector<std::__1::vector<QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator<QuantLib::MarketModelMultiProduct::CashFlow> >, std::__1::allocator<std::__1::vector<QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator<QuantLib::MarketModelMultiProduct::CashFlow> > > >&)", referenced from:
vtable for QuantLib::OneStepOptionlets in BermudanSwaption-a6bf28.o
"QuantLib::MultiStepOptionlets::nextTimeStep(QuantLib::CurveState const&, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> >&, std::__1::vector<std::__1::vector<QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator<QuantLib::MarketModelMultiProduct::CashFlow> >, std::__1::allocator<std::__1::vector<QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator<QuantLib::MarketModelMultiProduct::CashFlow> > > >&)", referenced from:
vtable for QuantLib::MultiStepOptionlets in BermudanSwaption-a6bf28.o
"QuantLib::OneStepCoinitialSwaps::nextTimeStep(QuantLib::CurveState const&, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> >&, std::__1::vector<std::__1::vector<QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator<QuantLib::MarketModelMultiProduct::CashFlow> >, std::__1::allocator<std::__1::vector<QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator<QuantLib::MarketModelMultiProduct::CashFlow> > > >&)", referenced from:
vtable for QuantLib::OneStepCoinitialSwaps in BermudanSwaption-a6bf28.o
"QuantLib::OneStepCoterminalSwaps::nextTimeStep(QuantLib::CurveState const&, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> >&, std::__1::vector<std::__1::vector<QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator<QuantLib::MarketModelMultiProduct::CashFlow> >, std::__1::allocator<std::__1::vector<QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator<QuantLib::MarketModelMultiProduct::CashFlow> > > >&)", referenced from:
vtable for QuantLib::OneStepCoterminalSwaps in BermudanSwaption-a6bf28.o
"QuantLib::MultiStepCoinitialSwaps::nextTimeStep(QuantLib::CurveState const&, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> >&, std::__1::vector<std::__1::vector<QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator<QuantLib::MarketModelMultiProduct::CashFlow> >, std::__1::allocator<std::__1::vector<QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator<QuantLib::MarketModelMultiProduct::CashFlow> > > >&)", referenced from:
vtable for QuantLib::MultiStepCoinitialSwaps in BermudanSwaption-a6bf28.o
"QuantLib::MultiStepInverseFloater::nextTimeStep(QuantLib::CurveState const&, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> >&, std::__1::vector<std::__1::vector<QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator<QuantLib::MarketModelMultiProduct::CashFlow> >, std::__1::allocator<std::__1::vector<QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator<QuantLib::MarketModelMultiProduct::CashFlow> > > >&)", referenced from:
vtable for QuantLib::MultiStepInverseFloater in BermudanSwaption-a6bf28.o
"QuantLib::MultiStepCoterminalSwaps::nextTimeStep(QuantLib::CurveState const&, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> >&, std::__1::vector<std::__1::vector<QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator<QuantLib::MarketModelMultiProduct::CashFlow> >, std::__1::allocator<std::__1::vector<QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator<QuantLib::MarketModelMultiProduct::CashFlow> > > >&)", referenced from:
vtable for QuantLib::MultiStepCoterminalSwaps in BermudanSwaption-a6bf28.o
"QuantLib::MultiStepCoterminalSwaptions::nextTimeStep(QuantLib::CurveState const&, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> >&, std::__1::vector<std::__1::vector<QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator<QuantLib::MarketModelMultiProduct::CashFlow> >, std::__1::allocator<std::__1::vector<QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator<QuantLib::MarketModelMultiProduct::CashFlow> > > >&)", referenced from:
vtable for QuantLib::MultiStepCoterminalSwaptions in BermudanSwaption-a6bf28.o
"QuantLib::MultiStepPeriodCapletSwaptions::nextTimeStep(QuantLib::CurveState const&, std::__1::vector<unsigned long, std::__1::allocator<unsigned long> >&, std::__1::vector<std::__1::vector<QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator<QuantLib::MarketModelMultiProduct::CashFlow> >, std::__1::allocator<std::__1::vector<QuantLib::MarketModelMultiProduct::CashFlow, std::__1::allocator<QuantLib::MarketModelMultiProduct::CashFlow> > > >&)", referenced from:
vtable for QuantLib::MultiStepPeriodCapletSwaptions in BermudanSwaption-a6bf28.o
"QuantLib::Error::Error(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, long, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&)", referenced from:
QuantLib::DiscretizedOption::reset(unsigned long) in BermudanSwaption-a6bf28.o
QuantLib::Instrument::setupArguments(QuantLib::PricingEngine::arguments*) const in BermudanSwaption-a6bf28.o
QuantLib::Option::setupArguments(QuantLib::PricingEngine::arguments*) const in BermudanSwaption-a6bf28.o
QuantLib::Payoff::accept(QuantLib::AcyclicVisitor&) in BermudanSwaption-a6bf28.o
QuantLib::BlackVolTermStructure::accept(QuantLib::AcyclicVisitor&) in BermudanSwaption-a6bf28.o
QuantLib::SimpleQuote::value() const in BermudanSwaption-a6bf28.o
QuantLib::Handle<QuantLib::Quote>::operator->() const in BermudanSwaption-a6bf28.o
...
"QuantLib::detail::operator<<(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, QuantLib::detail::percent_holder const&)", referenced from:
calibrateModel(boost::shared_ptr<QuantLib::ShortRateModel> const&, std::__1::vector<boost::shared_ptr<QuantLib::CalibrationHelper>, std::__1::allocator<boost::shared_ptr<QuantLib::CalibrationHelper> > > const&) in BermudanSwaption-a6bf28.o
_main in BermudanSwaption-a6bf28.o
"QuantLib::operator<<(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, QuantLib::Date const&)", referenced from:
QuantLib::InterestRateIndex::valueDate(QuantLib::Date const&) const in BermudanSwaption-a6bf28.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Is there something wrong I have done? What is the problem with the "linker" here? I would really appreciate for help since I have been trying to get this to work for a very long time now.