Examples compile but don't run correctly

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

Examples compile but don't run correctly

Brian Clarkson
Hello,

I though I successfully installed quantlib-0.3.9 but when I compiled
the examples (using 'make examples'), they don't run correctly. Here is
what happens when I run the EuropeanOption example:
---------
~/downloads/QuantLib-0.3.9/Examples/EuropeanOption$ ./EuropeanOption
Using 0.3.9

option type = call
Time to maturity = 1
Underlying price = 7
Strike = 8
Risk-free interest rate = 5.000000 %
Dividend yield = 5.000000 %
Volatility = 10.000000 %



Method          Value           EstimatedError  Discrepancy     Rel.
Discr.
Black-Scholes   0       N/A             0               nan
Integral        0       N/A             0       nan
Binomial (JR)   0       N/A             0       nan
Binomial (CRR)  0       N/A             0       nan
Additive (EQP)  0       N/A             0       nan
Bin. Trigeorgis 0       N/A             0       nan
Binomial Tian   0       N/A             0       nan
Binomial LR     0       N/A             0       nan
Finite Diff.    0       N/A             0       nan
In function `Real QuantLib::Instrument::errorEstimate() const':
error estimate not provided
--------
Notice that all the values (even Black-Scholes) are all zero and then
it barfs on the call to errorEstimate for the option. What's going on?


My environment is:

MacOSX 10.3
fink boost1.31
quantlib-0.3.9

-brian



Reply | Threaded
Open this post in threaded view
|

Re: Examples compile but don't run correctly

Luigi Ballabio
On 06/15/2005 01:46:14 PM, Brian Clarkson wrote:
>
> I though I successfully installed quantlib-0.3.9 but when I compiled  
> the examples (using 'make examples'), they don't run correctly.
>
> My environment is:
>
> MacOSX 10.3
> fink boost1.31
> quantlib-0.3.9

Brian,
        I'll try and reproduce the problem. Stay tuned.

Later,
        Luigi



Reply | Threaded
Open this post in threaded view
|

Re: Examples compile but don't run correctly

Luigi Ballabio
In reply to this post by Brian Clarkson
On Jun 15, 2005, at 1:46 PM, Brian Clarkson wrote:
> I though I successfully installed quantlib-0.3.9 but when I compiled
> the examples (using 'make examples'), they don't run correctly.

Brian,
        I still haven't had the chance to try and compile the library under
Mac OS X. However, I know there were problems on that platform with
shared libraries. Did you try running the test suite, and if so, did
you have any problems? For it to run correctly, one had to configure
the library with
./configure --disable-shared
You may try running the above and recompiling the whole thing (I don't
know whether reconfiguring will trigger the recompilation, but 'make
clean' and 'make' will do the trick.)

HTH,
        Luigi



Reply | Threaded
Open this post in threaded view
|

Re: Examples compile but don't run correctly

Luigi Ballabio
In reply to this post by Brian Clarkson
On Jun 15, 2005, at 1:46 PM, Brian Clarkson wrote:
> I though I successfully installed quantlib-0.3.9 but when I compiled
> the examples (using 'make examples'), they don't run correctly.

Brian,
        I reproduced the error. Indeed it's a problem with Mac OS X shared
library.
Configure the library with
./configure --disable-shared
to compile QuantLib as a static library and obtain the correct behavior.

Later,
        Luigi



Reply | Threaded
Open this post in threaded view
|

Re: Examples compile but don't run correctly

Brian Clarkson
Luigi,

Sorry I took so long to reply and thank you for looking into this for
me! Your suggestion indeed worked and all of the examples compile and
run fine.  For documentation purposes my final configure commandline
was:

  ./configure --disable-shared --with-boost-include=/sw/include
--with-boost-lib=/sw/lib

because I have a fink installation of boost.

Cheers,
Brian


On Jul 9, 2005, at 6:50 PM, Luigi Ballabio wrote:

>
> On Jun 15, 2005, at 1:46 PM, Brian Clarkson wrote:
>> I though I successfully installed quantlib-0.3.9 but when I compiled
>> the examples (using 'make examples'), they don't run correctly.
>
> Brian,
> I reproduced the error. Indeed it's a problem with Mac OS X shared
> library.
> Configure the library with
> ./configure --disable-shared
> to compile QuantLib as a static library and obtain the correct
> behavior.
>
> Later,
> Luigi
>