Re: mac install

Posted by bo.zhao on
URL: http://quantlib.414.s1.nabble.com/mac-install-tp15629p15630.html

Dear Sakeeb,

I have installed Quantlib on Mac and it's working fine. What I did was just simply following the instruction that you mentioned in your email.

One thing I cannot remember exactly is whether you would need to configure your Mac so that you can compile c++ in the first place. In my case, I think I had been using Xcode to do c++ programming, before I had Quantlib installed, which means it was for sure that my Mac is able to compile c++.

Regards,

Bo


On 22 July 2014 04:40, Sakeeb Zaman <[hidden email]> wrote:
Hi, I have tried following the instructions on http://quantlib.org/install/macosx.shtml. I’m on OS 10.9.4. I am completely new to all of this so not knowing what info is useful, I listed all the steps I took below. Please could you help me get this working? Thanks in advance for any help. 

1) Got macports

2) sudo port install boost
- first time it did a bunch of stuff, now when I tried it again it returns:
--->  Computing dependencies for boost
--->  Cleaning boost
--->  Scanning binaries for linking errors
--->  No broken files found.

3) From sourceforge I downloaded QuantLib-1.4.tar.gz … it saved in my Downloads directory

4) In Downloads I ran tar xzvf QuantLib-1.4.tar.gz

5) Then there was a QuantLib-1.4 directory within Downloads

6) In the QuantLib-1.4 directory:  ./configure --enable-static --with-boost-include=/opt/local/include/ \
            --with-boost-lib=/opt/local/lib/ --prefix=/opt/local/

Note: I also tried doing: 
./configure --enable-static --with-boost-include=/opt/local/include/ \
            --with-boost-lib=/opt/local/lib/ --prefix=/opt/local/ \
            CXXFLAGS="-stlib=libstdc++ -mmacosx-version-min=10.6" \
            LDFLAGS="-stlib=libstdc++ -mmacosx-version-min=10.6”

But this doesn’t do much, returning: 

checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... config/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gawk... (cached) awk
checking for gcc... gcc
checking whether the C compiler works... no
configure: error: in `/Users/myname/Downloads/QuantLib-1.4':
configure: error: C compiler cannot create executables
See `config.log' for more details
6) make && sudo make install

7) runs for about 90mins and asks for my password once while doing so

8) Finally when I try compiling within ~/Downloads/QuantLib-1.4/test-suite directory with: g++ -I/opt/local/include/ -I/opt/local/include/boost BermudanSwaption.cpp \
    -o bermudanswaption -L/opt/local/lib/ -lQuantLib

I get:

Undefined symbols for architecture x86_64:
  "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 BermudanSwaption-7aa50d.o
      QuantLib::detail::quantlib_test_case::operator()() const in BermudanSwaption-7aa50d.o
  "boost::unit_test::test_suite::add(boost::unit_test::test_unit*, unsigned long, unsigned int)", referenced from:
      BermudanSwaptionTest::suite() in BermudanSwaption-7aa50d.o
  "boost::unit_test::test_suite::test_suite(boost::unit_test::basic_cstring<char const>)", referenced from:
      BermudanSwaptionTest::suite() in BermudanSwaption-7aa50d.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 BermudanSwaption-7aa50d.o
      QuantLib::detail::quantlib_test_case::operator()() const in BermudanSwaption-7aa50d.o
  "boost::unit_test::unit_test_log_t::operator()(boost::unit_test::log_level)", referenced from:
      BermudanSwaptionTest::testCachedValues() in BermudanSwaption-7aa50d.o
  "boost::unit_test::unit_test_log_t::operator<<(boost::unit_test::log::begin const&)", referenced from:
      BermudanSwaptionTest::testCachedValues() in BermudanSwaption-7aa50d.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 BermudanSwaption-7aa50d.o
  "boost::unit_test::ut_detail::entry_value_collector::~entry_value_collector()", referenced from:
      BermudanSwaptionTest::testCachedValues() in BermudanSwaption-7aa50d.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 BermudanSwaption-7aa50d.o
  "QuantLib::flatRate(QuantLib::Date const&, double, QuantLib::DayCounter const&)", referenced from:
      BermudanSwaptionTest::testCachedValues() in BermudanSwaption-7aa50d.o
  "boost::unit_test::ut_detail::entry_value_collector::operator<<(boost::unit_test::lazy_ostream const&) const", referenced from:
      BermudanSwaptionTest::testCachedValues() in BermudanSwaption-7aa50d.o
  "vtable for boost::unit_test::unit_test_log_t", referenced from:
      boost::unit_test::unit_test_log_t::unit_test_log_t() in BermudanSwaption-7aa50d.o
  NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
  "_main", referenced from:
     implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64

------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users



------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users