Error building BermudanSwaption sample

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Error building BermudanSwaption sample

Spokane-Dude
I have installed (correctly I hope) QuantLib-1.1 on OS X (Snow Leopard).  The install completed without any errors.  I am now trying to compile the example, and am getting the following errors:

iMac:test-suite rolfmarsh$ g++ -I/opt/local/include/ -I/opt/local/include/boost BermudanSwaption.cpp \
>     -o bermudanswaption -L/opt/local/lib/ -lQuantLib
Undefined symbols:
  "boost::unit_test::test_suite::add(boost::unit_test::test_unit*, unsigned long, unsigned int)", referenced from:
      BermudanSwaptionTest::suite()      in ccGTRDSg.o
  "boost::unit_test::unit_test_log_t::operator()(boost::unit_test::log_level)", referenced from:
      BermudanSwaptionTest::testCachedValues()       in ccGTRDSg.o
  "boost::unit_test::ut_detail::entry_value_collector::operator<<(boost::unit_test::lazy_ostream const&) const", referenced from:
      BermudanSwaptionTest::testCachedValues()       in ccGTRDSg.o
  "boost::unit_test::unit_test_log_t::set_checkpoint(boost::unit_test::basic_cstring<char const>, unsigned long, boost::unit_test::basic_cstring<char const>)", referenced from:
      BermudanSwaptionTest::testCachedValues()       in ccGTRDSg.o
      BermudanSwaptionTest::testCachedValues()       in ccGTRDSg.o
      BermudanSwaptionTest::testCachedValues()       in ccGTRDSg.o
      BermudanSwaptionTest::testCachedValues()       in ccGTRDSg.o
      BermudanSwaptionTest::testCachedValues()       in ccGTRDSg.o
      BermudanSwaptionTest::testCachedValues()       in ccGTRDSg.o
      QuantLib::detail::quantlib_test_case::operator()() constin ccGTRDSg.o
      QuantLib::detail::quantlib_test_case::operator()() constin ccGTRDSg.o
  "_main", referenced from:
      start in crt1.10.6.o
  "boost::unit_test::ut_detail::entry_value_collector::~entry_value_collector()", referenced from:
      BermudanSwaptionTest::testCachedValues()       in ccGTRDSg.o
      BermudanSwaptionTest::testCachedValues()       in ccGTRDSg.o
  "boost::unit_test::unit_test_log_t::operator<<(boost::unit_test::log::begin const&)", referenced from:
      BermudanSwaptionTest::testCachedValues()       in ccGTRDSg.o
  "boost::unit_test::test_suite::test_suite(boost::unit_test::basic_cstring<char const>)", referenced from:
      BermudanSwaptionTest::suite()      in ccGTRDSg.o
  "QuantLib::flatRate(QuantLib::Date const&, double, QuantLib::DayCounter const&)", referenced from:
      BermudanSwaptionTest::testCachedValues()       in ccGTRDSg.o
  "boost::unit_test::ut_detail::normalize_test_case_name(boost::unit_test::basic_cstring<char const>)", referenced from:
      boost::unit_test::make_test_case(boost::unit_test::callback0<boost::unit_test::ut_detail::unused> const&, boost::unit_test::basic_cstring<char const>)in ccGTRDSg.o
  "vtable for boost::unit_test::unit_test_log_t", referenced from:
      boost::unit_test::unit_test_log_t::unit_test_log_t()in ccGTRDSg.o
      boost::unit_test::unit_test_log_t::~unit_test_log_t()in ccGTRDSg.o
  "boost::test_tools::tt_detail::check_impl(boost::test_tools::predicate_result const&, boost::unit_test::lazy_ostream const&, boost::unit_test::basic_cstring<char const>, unsigned long, boost::test_tools::tt_detail::tool_level, boost::test_tools::tt_detail::check_type, unsigned long, ...)", referenced from:
      BermudanSwaptionTest::testCachedValues()       in ccGTRDSg.o
      BermudanSwaptionTest::testCachedValues()       in ccGTRDSg.o
      BermudanSwaptionTest::testCachedValues()       in ccGTRDSg.o
      BermudanSwaptionTest::testCachedValues()       in ccGTRDSg.o
      BermudanSwaptionTest::testCachedValues()       in ccGTRDSg.o
      BermudanSwaptionTest::testCachedValues()       in ccGTRDSg.o
      QuantLib::detail::quantlib_test_case::operator()() constin ccGTRDSg.o
      QuantLib::detail::quantlib_test_case::operator()() constin ccGTRDSg.o
  "boost::unit_test::test_case::test_case(boost::unit_test::basic_cstring<char const>, boost::unit_test::callback0<boost::unit_test::ut_detail::unused> const&)", referenced from:
      boost::unit_test::make_test_case(boost::unit_test::callback0<boost::unit_test::ut_detail::unused> const&, boost::unit_test::basic_cstring<char const>)in ccGTRDSg.o
ld: symbol(s) not found
collect2: ld returned 1 exit status


Am I missing a component?
Reply | Threaded
Open this post in threaded view
|

Re: Error building BermudanSwaption sample

Bojan Nikolic

You need to also link to boost_unit_test_framework, e.g.,
-lboost_unit_test_framework.  

If you are using the supplied makefiles check that your "./configure"
step found the boost unit test libraries.

Best,
Bojan

--
Bojan Nikolic          ||          http://www.bnikolic.co.uk/ql

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: Error building BermudanSwaption sample

Luigi Ballabio
In reply to this post by Spokane-Dude

Is that the BermudanSwaption.cpp inside Examples/BermudanSwaption, or
the one inside test-suite?  If it's the one inside test-suite, it won't
do you any good trying to compile it alone; it's just one of several
files in the test suite.  And as Bojan said, you'll need the Boost
unit-test libraries for that.

If you wanted the example instead, your command line is correct but
you're probably in the wrong place.  As I mentioned,
Examples/BermudanSwaption is where you probably want to be.

Luigi


On Mon, 2011-07-11 at 06:37 -0700, Spokane-Dude wrote:

> I have installed (correctly I hope) QuantLib-1.1 on OS X (Snow Leopard).  The
> install completed without any errors.  I am now trying to compile the
> example, and am getting the following errors:
>
> iMac:test-suite rolfmarsh$ g++ -I/opt/local/include/
> -I/opt/local/include/boost BermudanSwaption.cpp \
> >     -o bermudanswaption -L/opt/local/lib/ -lQuantLib
> Undefined symbols:
>   "boost::unit_test::test_suite::add(boost::unit_test::test_unit*, unsigned
> long, unsigned int)", referenced from:
>       BermudanSwaptionTest::suite()      in ccGTRDSg.o
>  
> "boost::unit_test::unit_test_log_t::operator()(boost::unit_test::log_level)",
> referenced from:
>       BermudanSwaptionTest::testCachedValues()       in ccGTRDSg.o
>  
> "boost::unit_test::ut_detail::entry_value_collector::operator<<(boost::unit_test::lazy_ostream
> const&) const", referenced from:
>       BermudanSwaptionTest::testCachedValues()       in ccGTRDSg.o
>  
> "boost::unit_test::unit_test_log_t::set_checkpoint(boost::unit_test::basic_cstring<char
> const>, unsigned long, boost::unit_test::basic_cstring<char const>)",
> referenced from:
>       BermudanSwaptionTest::testCachedValues()       in ccGTRDSg.o
>       BermudanSwaptionTest::testCachedValues()       in ccGTRDSg.o
>       BermudanSwaptionTest::testCachedValues()       in ccGTRDSg.o
>       BermudanSwaptionTest::testCachedValues()       in ccGTRDSg.o
>       BermudanSwaptionTest::testCachedValues()       in ccGTRDSg.o
>       BermudanSwaptionTest::testCachedValues()       in ccGTRDSg.o
>       QuantLib::detail::quantlib_test_case::operator()() constin ccGTRDSg.o
>       QuantLib::detail::quantlib_test_case::operator()() constin ccGTRDSg.o
>   "_main", referenced from:
>       start in crt1.10.6.o
>  
> "boost::unit_test::ut_detail::entry_value_collector::~entry_value_collector()",
> referenced from:
>       BermudanSwaptionTest::testCachedValues()       in ccGTRDSg.o
>       BermudanSwaptionTest::testCachedValues()       in ccGTRDSg.o
>  
> "boost::unit_test::unit_test_log_t::operator<<(boost::unit_test::log::begin
> const&)", referenced from:
>       BermudanSwaptionTest::testCachedValues()       in ccGTRDSg.o
>  
> "boost::unit_test::test_suite::test_suite(boost::unit_test::basic_cstring<char
> const>)", referenced from:
>       BermudanSwaptionTest::suite()      in ccGTRDSg.o
>   "QuantLib::flatRate(QuantLib::Date const&, double, QuantLib::DayCounter
> const&)", referenced from:
>       BermudanSwaptionTest::testCachedValues()       in ccGTRDSg.o
>  
> "boost::unit_test::ut_detail::normalize_test_case_name(boost::unit_test::basic_cstring<char
> const>)", referenced from:
>      
> boost::unit_test::make_test_case(boost::unit_test::callback0<boost::unit_test::ut_detail::unused>
> const&, boost::unit_test::basic_cstring<char const>)in ccGTRDSg.o
>   "vtable for boost::unit_test::unit_test_log_t", referenced from:
>       boost::unit_test::unit_test_log_t::unit_test_log_t()in ccGTRDSg.o
>       boost::unit_test::unit_test_log_t::~unit_test_log_t()in ccGTRDSg.o
>  
> "boost::test_tools::tt_detail::check_impl(boost::test_tools::predicate_result
> const&, boost::unit_test::lazy_ostream const&,
> boost::unit_test::basic_cstring<char const>, unsigned long,
> boost::test_tools::tt_detail::tool_level,
> boost::test_tools::tt_detail::check_type, unsigned long, ...)", referenced
> from:
>       BermudanSwaptionTest::testCachedValues()       in ccGTRDSg.o
>       BermudanSwaptionTest::testCachedValues()       in ccGTRDSg.o
>       BermudanSwaptionTest::testCachedValues()       in ccGTRDSg.o
>       BermudanSwaptionTest::testCachedValues()       in ccGTRDSg.o
>       BermudanSwaptionTest::testCachedValues()       in ccGTRDSg.o
>       BermudanSwaptionTest::testCachedValues()       in ccGTRDSg.o
>       QuantLib::detail::quantlib_test_case::operator()() constin ccGTRDSg.o
>       QuantLib::detail::quantlib_test_case::operator()() constin ccGTRDSg.o
>  
> "boost::unit_test::test_case::test_case(boost::unit_test::basic_cstring<char
> const>, boost::unit_test::callback0<boost::unit_test::ut_detail::unused>
> const&)", referenced from:
>      
> boost::unit_test::make_test_case(boost::unit_test::callback0<boost::unit_test::ut_detail::unused>
> const&, boost::unit_test::basic_cstring<char const>)in ccGTRDSg.o
> ld: symbol(s) not found
> collect2: ld returned 1 exit status
>
>
> Am I missing a component?

--

If I do not want others to quote me, I do not speak.
-- Phil Wayne



------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users