Re: QuantLib and Linux

Posted by Dirk Eddelbuettel on
URL: http://quantlib.414.s1.nabble.com/QuantLib-and-Linux-tp4393p4396.html

On 22 January 2006 at 19:33, L.Isella wrote:
| On Sun, 2006-01-22 at 11:06 -0600, Dirk Eddelbuettel wrote:
| On 22 January 2006 at 11:45, L.Isella wrote:
| > | Dear All,
| > | I am new fairly new to C++ and Linux.
| > | I am currently using Ubuntu (a Debian-based distribution).
| >
| > Which version of Ubuntu?  Which version of QuantLib did that give you?
| > I am on Ubuntu 5.10 (Breezy). I am using version 0.3.9 of the QuantLib
| > library (to be precise: libquantlib0-dev version 0.3.9-6ubuntu3).

Ok, same here on my Kubuntu (== Ubuntu with KDE instead of Gnome) box.

[...]

| > You need to install the libquantlib0-dev package as well.  
| >
| Which I did.

Ok, then you have to show us what you did, and what errors you got. We can't
guess that.

[ Ok I just tried it, and there is an implicit Depends: on the -dev package
for the Boost headers. So also do 'apt-get install libboost-test-dev' and the
you should be set. ]

So try this:

0. Prelims:  
        Besides libquantlib0-dev, you need quantlib-examples for the
        source code of the examples. I presume you have that.

1. Get source code, copy to /tmp and gunzip
        $ cd /usr/share/doc/libquantlib-0.3.9c2/examples/
        $ cp -a DiscreteHedging/ /tmp/
        $ cd /tmp/DiscreteHedging/
       
2. Build it:
        $ g++ -o DH DiscreteHedging.cpp -lQuantLib

3. You should have a new executable 'DH':
        edd@joe:/tmp/DiscreteHedging$ ls -l DH
        -rwxr-xr-x  1 edd edd 523030 2006-01-22 14:09 DH

4. Run it:
        edd@joe:/tmp/DiscreteHedging$ ./DH
Option value: 2.51207

        |        | P&L          |  P&L    | Derman&Kamal | P&L          | P&L
samples | trades | Mean         | Std Dev | Formula      | skewness     | kurt.
-------------------------------------------------------------------------------
50000   | 21     | -0.000       | 0.43    | 0.44         | -0.35        | 1.59
50000   | 84     | -0.001       | 0.22    | 0.22         | -0.20        | 1.76



| Being able to execute binaries is necessary but not sufficient to compiling
| > your own.
| >
| > Dirk
| >
| Alright, I see the point you and the others are trying to make.
| I thought apt-get would take care of everything as usual, whereas, if I am
| getting it right, I should compile the library myself.

No, I don't think anybody suggested that. You should be able to get started
with the Debian / Ubuntu packages.

Arguably, you found a minor bug in that the libquantlib0-dev package should
probably also pull in the libboost-test-dev package. I will add that.

Hope this helps,   Dirk

--
Hell, there are no rules here - we're trying to accomplish something.
                                                  -- Thomas A. Edison