Re: Fwd: QuantLib Installation Issue on Mac OSX 10.10

Posted by Takehiro Yanagi on
URL: http://quantlib.414.s1.nabble.com/QuantLib-Installation-Issue-on-Mac-OSX-10-10-tp16747p16752.html

Hi, Will

The following configure option works for me. (builds with g++ (clang version) and your example code builds successfully.)

Cheers, Takehiro

$ CXXFLAGS="-std=c++0x" ./configure --enable-static --with-boost-include=INCLUDE_DIR  --with-boost-lib=LIB_DIR  --prefix= PREFIX_DIR


On Thu, Jul 30, 2015 at 5:05 PM, Peng (Will) Chen <[hidden email]> wrote:
Hi All,

I’m new to QuantLib and trying to install it on my mac, I followed the site’s instructions here http://quantlib.org/install/macosx.shtml and used the following configuration.

./configure --enable-static --with-boost-include=/opt/local/include/ --with-boost-lib=/opt/local/lib/ --prefix=/opt/local/ CXXFLAGS="-stdlib=libstdc++ -mmacosx-version-min=10.6" LDFLAGS="-stdlib=libstdc++ -mmacosx-version-min=10.6”

I used the following command to compile the example BermudanSwaption
cd Examples/BermudanSwaption
g++ -I/opt/local/include/ -I/opt/local/include/boost BermudanSwaption.cpp \ -o bermudanswaption -L/opt/local/lib/ -lQuantLib
but I got the following error, I searched on Google all night but still cannot fix the issue. I also tried to use QuantLib in Xcode, no luck either. Any help would be greatly appreciated! 

Thanks, Will

QuantLib-1.6 Will$ cd Examples/BermudanSwaption
vpn-165-124-160-169:BermudanSwaption Will$ g++ -I/opt/local/include/ -I/opt/local/include/boost BermudanSwaption.cpp -o bermudanswaption -L/opt/local/lib/ -IQuantLib
Undefined symbols for architecture x86_64:
  "boost::assertion_failed(char const*, char const*, char const*, long)", referenced from:
      boost::shared_ptr<QuantLib::Observable>::operator->() const in BermudanSwaption-4140a1.o
      boost::shared_ptr<QuantLib::DiscretizedAsset>::operator->() const in BermudanSwaption-4140a1.o
      boost::shared_ptr<QuantLib::SwapIndex>::operator->() const in BermudanSwaption-4140a1.o
      boost::shared_ptr<QuantLib::IborIndex>::operator->() const in BermudanSwaption-4140a1.o
      boost::shared_ptr<QuantLib::Quote>::operator->() const in BermudanSwaption-4140a1.o
      boost::shared_ptr<QuantLib::DefaultProbabilityTermStructure>::operator->() const in BermudanSwaption-4140a1.o
      boost::shared_ptr<QuantLib::Exercise>::operator->() const in BermudanSwaption-4140a1.o
      ...
  "boost::assertion_failed_msg(char const*, char const*, char const*, char const*, long)", referenced from:
      boost::array<long double, 171ul>::operator[](unsigned long) const in BermudanSwaption-4140a1.o
  "QuantLib::Constraint::Constraint(boost::shared_ptr<QuantLib::Constraint::Impl> 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-4140a1.o
  "QuantLib::EndCriteria::EndCriteria(unsigned long, unsigned long, double, double, double)", referenced from:
ption-4140a1.o
  "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-4140a1.o
  "QuantLib::TermStructure::update()", referenced from:
      QuantLib::DefaultProbabilityTermStructure::update() in BermudanSwaption-4140a1.o
      QuantLib::FittedBondDiscountCurve::update() in BermudanSwaption-4140a1.o
      QuantLib::ForwardSpreadedTermStructure::update() in BermudanSwaption-4140a1.o
      QuantLib::ZeroSpreadedTermStructure::update() in BermudanSwaption-4140a1.o
      vtable for QuantLib::TermStructure in BermudanSwaption-4140a1.o
      vtable for QuantLib::VolatilityTermStructure in BermudanSwaption-4140a1.o
      construction vtable for QuantLib::TermStructure-in-QuantLib::VolatilityTermStructure in BermudanSwaption-4140a1.o
      ...
  "QuantLib::EuropeanOption::EuropeanOption(boost::shared_ptr<QuantLib::StrikedTypePayoff> const&, boost::shared_ptr<QuantLib::Exercise> const&)", referenced from:
      QuantLib::ReplicatingVarianceSwapEngine::computeReplicatingPortfolio(std::__1::vector<std::__1::pair<boost::shared_ptr<QuantLib::StrikedTypePayoff>, double>, std::__1::allocator<std::__1::pair<boost::shared_ptr<QuantLib::StrikedTypePayoff>, double> > > const&) const in BermudanSwaption-4140a1.o
  "QuantLib::InflationIndex::addFixing(QuantLib::Date const&, double, bool)", referenced from:
      vtable for QuantLib::InflationIndex in BermudanSwaption-4140a1.o
  "QuantLib::SabrVolSurface::accept(QuantLib::AcyclicVisitor&)", referenced from:
      vtable for QuantLib::SabrVolSurface in BermudanSwaption-4140a1.o
  "QuantLib::SabrVolSurface::update()", referenced from:
      vtable for QuantLib::SabrVolSurface in BermudanSwaption-4140a1.o
  "QuantLib::SwaptionHelper::SwaptionHelper(QuantLib::Period const&, QuantLib::Period const&, QuantLib::Handle<QuantLib::Quote> const&, boost::shared_ptr<QuantLib::IborIndex> const&, QuantLib::Period const&, QuantLib::DayCounter const&, QuantLib::DayCounter const&, QuantLib::Handle<QuantLib::YieldTermStructure> const&, QuantLib::CalibrationHelper::CalibrationErrorType, double, double, double)", referenced from:
      _main in BermudanSwaption-4140a1.o
  "QuantLib::AbcdAtmVolCurve::accept(QuantLib::AcyclicVisitor&)", referenced from:
      vtable for QuantLib::AbcdAtmVolCurve in BermudanSwaption-4140a1.o
  "QuantLib::AbcdAtmVolCurve::update()", referenced from:
      vtable for QuantLib::AbcdAtmVolCurve in BermudanSwaption-4140a1.o
  "QuantLib::BlackKarasinski::BlackKarasinski(QuantLib::Handle<QuantLib::YieldTermStructure> const&, double, double)", referenced from:
      _main in BermudanSwaption-4140a1.o
  "QuantLib::BlackVolSurface::accept(QuantLib::AcyclicVisitor&)", referenced from:
      construction vtable for QuantLib::BlackVolSurface-in-QuantLib::SabrVolSurface in BermudanSwaption-4140a1.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-4140a1.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-4140a1.o
  "QuantLib::SegmentIntegral::SegmentIntegral(unsigned long)", referenced from:
      QuantLib::VariancePathPricer::operator()(QuantLib::Path const&) const in BermudanSwaption-4140a1.o
  "QuantLib::BermudanExercise::BermudanExercise(std::__1::vector<QuantLib::Date, std::__1::allocator<QuantLib::Date> > const&, bool)", referenced from:
      _main in BermudanSwaption-4140a1.o
  "QuantLib::BlackAtmVolCurve::accept(QuantLib::AcyclicVisitor&)", referenced from:
      construction vtable for QuantLib::BlackAtmVolCurve-in-QuantLib::AbcdAtmVolCurve in BermudanSwaption-4140a1.o
      construction vtable for QuantLib::BlackAtmVolCurve-in-QuantLib::SabrVolSurface in BermudanSwaption-4140a1.o
  "QuantLib::EuropeanExercise::EuropeanExercise(QuantLib::Date const&)", referenced from:
      QuantLib::ReplicatingVarianceSwapEngine::computeReplicatingPortfolio(std::__1::vector<std::__1::pair<boost::shared_ptr<QuantLib::StrikedTypePayoff>, double>, std::__1::allocator<std::__1::pair<boost::shared_ptr<QuantLib::StrikedTypePayoff>, double> > > const&) const in BermudanSwaption-4140a1.o
  "QuantLib::FlatSmileSection::FlatSmileSection(double, double, QuantLib::DayCounter const&, double, double)", referenced from:
      QuantLib::CapletVarianceCurve::smileSectionImpl(double) const in BermudanSwaption-4140a1.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-4140a1.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-4140a1.o
  "QuantLib::DiscretizedOption::postAdjustValuesImpl()", referenced from:
      vtable for QuantLib::DiscretizedOption in BermudanSwaption-4140a1.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-4140a1.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-4140a1.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-4140a1.o
  "QuantLib::StochasticProcess::update()", referenced from:
      vtable for QuantLib::OrnsteinUhlenbeckProcess in BermudanSwaption-4140a1.o
  "QuantLib::FdG2SwaptionEngine::FdG2SwaptionEngine(boost::shared_ptr<QuantLib::G2> const&, unsigned long, unsigned long, unsigned long, unsigned long, double, QuantLib::FdmSchemeDesc const&)", referenced from:
     ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
vpn-165-124-160-169:BermudanSwaption Will$ 



------------------------------------------------------------------------------

_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users



------------------------------------------------------------------------------

_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users