Archive for the ‘quant’ Category

Quantlib and Quantlib Ruby on Mac Os X 10.5

Sunday, January 6th, 2008

today i installed Quantlib and Quantlib Ruby via the SWIG bindings on my macbook.

its quite simple.

  • install macports
  • install boost libs ( sudo port install boost )
  • download the latest Quantlib and Quantlib-SWIG
    for me it was like:
    cd /tmp
    wget http://garr.dl.sourceforge.net/sourceforge/quantlib/QuantLib-0.9.0.tar.gz
    wget http://garr.dl.sourceforge.net/sourceforge/quantlib/QuantLib-SWIG-0.9.0.tar.gz
  • extract them
    tar -xzvf QuantLib*
  • configure QuantLib
    cd QuantLib-0*
    ./configure –enable-static –with-boost-include=/opt/local/include/ –with-boost-lib=/opt/local/lib/ –prefix=/opt/local

    which was the actual tricky part. you need to specify where boost lives and you need to compile it static according to the QL FAQ )
  • build and install
    make && sudo make install
  • build and install Quantlib Ruby
    cd ../QuantLib-SWIG-0*
    cd Ruby && ruby setup.rb wrap
    ruby setup.rb build
    ruby setup.rb test
    sudo ruby setup.rb install
  • off you go! try a sample ( ruby examples/american-option.rb )

now i only have to learn what nifty stuff i can do with that 138mb lib ;)