Hello,
I have a problem using Quantlib on Sun solaris 8. the results I find for Black&Scholes pricing is wrong, for example the example EuropeanOption gives me: " Time to maturity = 0.25 Underlying price = 102 Strike = 100 Risk-free interest rate = 0.05 Volatility = 0.2 Method Value EstimatedError Discrepancy Rel. Discr. Black Scholes 3.2422 0.0000 0.000000 0.000000 Call-Put parity 3.2422 N/A 0 0.000000 Integral 5.8308 N/A 2.588611 0.798407 Finite Diff. 5.8309 N/A 2.588639 0.798416 MC (crude) 5.8313 0.0117 2.589092 0.798555 MC (antithetic) 5.8284 0.0052 2.586132 0.797643 Binomial (JR) 5.8308 N/A 2.588541 0.798385 Binomial (CRR) 5.8311 N/A 2.588926 0.798504" Here the result for Black Scholes 3.2422 is wrong. I've tested on Windows with Borland compiler and the result is correct there: Time to maturity = 0.25 Underlying price = 102 Strike = 100 Risk-free interest rate = 0.05 Volatility = 0.2 Method Value EstimatedError Discrepancy Rel. Discr. Black Scholes 5.8308 0.0000 0.000000 0.000000 Call-Put parity 5.8308 N/A 4.44089e-15 0.000000 Integral 5.8308 N/A 0.000001 0.000000 Finite Diff. 5.8309 N/A 0.000029 0.000005 MC (crude) 5.8435 0.0117 0.012658 0.002171 MC (antithetic) 5.8319 0.0052 0.001048 0.000180 Binomial (JR) 5.8308 N/A 0.000069 0.000012 Binomial (CRR) 5.8311 N/A 0.000315 0.000054 another problem, the example SwapValuation crashes on Unix but works well on NT. I'm using the same version of quantlib: version 0.3.0 and gcc version 2.95.3 20010315 (release) Is someone using the same configuration? Thanks for your help Xavier |
Xavier,
just a thought: Do you get the same results with all -Optimizations disabled? Jens. > Hello, > I have a problem using Quantlib on Sun solaris 8. ... > another problem, the example SwapValuation crashes on Unix but works > well on NT. > > I'm using the same version of quantlib: version 0.3.0 and gcc version > 2.95.3 20010315 (release) > |
In reply to this post by Xavier.Abulker
Hi Jens,
thanks for your reply, where is this -Optimizations located? I can't find any occurence Optimizations in any of text files into the Quantlib directory. Is it an option of compilation? Thanks Xavier "Jens Thiel" <[hidden email]> To: <[hidden email]> Sent by: cc: <[hidden email]> [hidden email] Subject: Re: [Quantlib-users] Quantlib on sun solaris 8 eforge.net 21/08/2002 11:51 Xavier, just a thought: Do you get the same results with all -Optimizations disabled? Jens. > Hello, > I have a problem using Quantlib on Sun solaris 8. ... > another problem, the example SwapValuation crashes on Unix but works > well on NT. > > I'm using the same version of quantlib: version 0.3.0 and gcc version > 2.95.3 20010315 (release) > ------------------------------------------------------- This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE! https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 _______________________________________________ Quantlib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Salut Xavier!
The thing is to delete -O2 (or -O3) from the compiler options. You can try to set the environment variable CXXFLAGS to "-g" e.g. if you use bash: export CXXFLAGS="-g" If this works, you can try to increment the optimization level by setting CXXFLAGS to "-g -O1" Regards, Sad On 21 Aug 2002 at 13:25, [hidden email] wrote: > > > Hi Jens, > thanks for your reply, where is this -Optimizations located? > I can't find any occurence Optimizations in any of text files into the > Quantlib directory. > Is it an option of compilation? > Thanks > Xavier |
In reply to this post by Xavier.Abulker
Hi Sad,
unfortunately it gives the same error: this is my Unix cession: [xavier:540]~/QuantLib-0.3.0/Examples/EuropeanOption> rm EuropeanOption [xavier:541]~/QuantLib-0.3.0/Examples/EuropeanOption> export CXXFLAGS="-g" [xavier:542]~/QuantLib-0.3.0/Examples/EuropeanOption> make /bin/sh ../../libtool --mode=link g++ -g -pedantic -Wall -o EuropeanOption EuropeanOption.o ../../ql/libQuantLib.la g++ -g -pedantic -Wall -o .libs/EuropeanOption EuropeanOption.o ../../ql/.libs/libQuantLib.so -R/usr/local/lib creating EuropeanOption [xavier:543]~/QuantLib-0.3.0/Examples/EuropeanOption> EuropeanOption Time to maturity = 0.25 Underlying price = 102 Strike = 100 Risk-free interest rate = 0.05 Volatility = 0.2 Method Value EstimatedError Discrepancy Rel. Discr. Black Scholes 3.2422 0.0000 0.000000 0.000000 Call-Put parity 3.2422 N/A 0 0.000000 Integral 5.8308 N/A 2.588611 0.798407 Finite Diff. 5.8309 N/A 2.588639 0.798416 MC (crude) 5.8110 0.0116 2.568813 0.792301 MC (antithetic) 5.8260 0.0052 2.583786 0.796919 Binomial (JR) 5.8308 N/A 2.588541 0.798385 Binomial (CRR) 5.8311 N/A 2.588926 0.798504 The Black Scholes price is still wrong. Thanks for your help Xavier Sadruddin Rejeb <[hidden email]> To: [hidden email] Sent by: cc: [hidden email] Subject: Re: [Quantlib-users] Quantlib on sun solaris 8 eforge.net 21/08/2002 15:41 Please respond to sad.rejeb Salut Xavier! The thing is to delete -O2 (or -O3) from the compiler options. You can try to set the environment variable CXXFLAGS to "-g" e.g. if you use bash: export CXXFLAGS="-g" If this works, you can try to increment the optimization level by setting CXXFLAGS to "-g -O1" Regards, Sad On 21 Aug 2002 at 13:25, [hidden email] wrote: > > > Hi Jens, > thanks for your reply, where is this -Optimizations located? > I can't find any occurence Optimizations in any of text files into the > Quantlib directory. > Is it an option of compilation? > Thanks > Xavier ------------------------------------------------------- This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE! https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 _______________________________________________ Quantlib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Xavier,
you must -- of course -- recompile the whole QuantLib library (thats were the calculations are done!) without compiler optimizations. And use a "make clean" before! Just removing the target won't help, since all optimizations are done while compiling to the .o files. With higher opt.levels (like -O1, -O2, etc.) compilers are more likely to produce errenous code due to over-agressive optimizations techniques. Jens. > > Hi Sad, > unfortunately it gives the same error: > this is my Unix cession: > > [xavier:540]~/QuantLib-0.3.0/Examples/EuropeanOption> rm EuropeanOption > > [xavier:541]~/QuantLib-0.3.0/Examples/EuropeanOption> export CXXFLAGS="-g" > > [xavier:542]~/QuantLib-0.3.0/Examples/EuropeanOption> make > /bin/sh ../../libtool --mode=link g++ -g -pedantic -Wall -o > EuropeanOption EuropeanOption.o ../../ql/libQuantLib.la > g++ -g -pedantic -Wall -o .libs/EuropeanOption EuropeanOption.o > ../../ql/.libs/libQuantLib.so -R/usr/local/lib > creating EuropeanOption > > [xavier:543]~/QuantLib-0.3.0/Examples/EuropeanOption> EuropeanOption > Time to maturity = 0.25 > Underlying price = 102 > Strike = 100 > Risk-free interest rate = 0.05 > Volatility = 0.2 > > Method Value EstimatedError Discrepancy Rel. Discr. > Black Scholes 3.2422 0.0000 0.000000 0.000000 > Call-Put parity 3.2422 N/A 0 0.000000 > Integral 5.8308 N/A 2.588611 0.798407 > Finite Diff. 5.8309 N/A 2.588639 0.798416 > MC (crude) 5.8110 0.0116 2.568813 0.792301 > MC (antithetic) 5.8260 0.0052 2.583786 0.796919 > Binomial (JR) 5.8308 N/A 2.588541 0.798385 > Binomial (CRR) 5.8311 N/A 2.588926 0.798504 > > The Black Scholes price is still wrong. > Thanks for your help > Xavier > > > > > > Sadruddin Rejeb > > <[hidden email]> To: > [hidden email] > Sent by: cc: > > [hidden email] > Subject: Re: [Quantlib-users] Quantlib on sun solaris 8 > eforge.net > > > > > > 21/08/2002 15:41 > > Please respond to sad.rejeb > > > > > > > > > > Salut Xavier! > The thing is to delete -O2 (or -O3) from the compiler options. > You can try to set the environment variable CXXFLAGS to "-g" > e.g. if you use bash: > export CXXFLAGS="-g" > If this works, you can try to increment the optimization level by > setting CXXFLAGS to "-g -O1" > > Regards, > Sad > > > On 21 Aug 2002 at 13:25, [hidden email] wrote: > > > > > > Hi Jens, > > thanks for your reply, where is this -Optimizations located? > > I can't find any occurence Optimizations in any of text files into the > > Quantlib directory. > > Is it an option of compilation? > > Thanks > > Xavier > > > ------------------------------------------------------- > This sf.net email is sponsored by: OSDN - Tired of that same old > cell phone? Get a new here for FREE! > https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 > _______________________________________________ > Quantlib-users mailing list > [hidden email] > https://lists.sourceforge.net/lists/listinfo/quantlib-users > > > > > > > ------------------------------------------------------- > This sf.net email is sponsored by: OSDN - Tired of that same old > cell phone? Get a new here for FREE! > https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 > _______________________________________________ > Quantlib-users mailing list > [hidden email] > https://lists.sourceforge.net/lists/listinfo/quantlib-users > > |
In reply to this post by Xavier.Abulker
Hi Jens, this is what I did and I still have the same problem: > export CXXFLAGS="-g" >make clean I have removed the -o3 from all the files in the quantlib directory the -o3 (36 files) I checked the result of the make command into a file make.txt to be sure that there's no -o3 used during the compilation. There's no -o3 >make If I test EuropeanOption, the result is still wrong. Thanks (See attached file: make.txt) "Jens Thiel" <[hidden email]> To: <[hidden email]> Sent by: cc: <[hidden email]> [hidden email] Subject: AW: [Quantlib-users] Quantlib on sun solaris 8 eforge.net 21/08/2002 14:09 Xavier, you must -- of course -- recompile the whole QuantLib library (thats were the calculations are done!) without compiler optimizations. And use a "make clean" before! Just removing the target won't help, since all optimizations are done while compiling to the .o files. With higher opt.levels (like -O1, -O2, etc.) compilers are more likely to produce errenous code due to over-agressive optimizations techniques. Jens. > > Hi Sad, > unfortunately it gives the same error: > this is my Unix cession: > > [xavier:540]~/QuantLib-0.3.0/Examples/EuropeanOption> rm EuropeanOption > > [xavier:541]~/QuantLib-0.3.0/Examples/EuropeanOption> export CXXFLAGS=" -g" > > [xavier:542]~/QuantLib-0.3.0/Examples/EuropeanOption> make > /bin/sh ../../libtool --mode=link g++ -g -pedantic -Wall -o > EuropeanOption EuropeanOption.o ../../ql/libQuantLib.la > g++ -g -pedantic -Wall -o .libs/EuropeanOption EuropeanOption.o > ../../ql/.libs/libQuantLib.so -R/usr/local/lib > creating EuropeanOption > > [xavier:543]~/QuantLib-0.3.0/Examples/EuropeanOption> EuropeanOption > Time to maturity = 0.25 > Underlying price = 102 > Strike = 100 > Risk-free interest rate = 0.05 > Volatility = 0.2 > > Method Value EstimatedError Discrepancy Rel. Discr. > Black Scholes 3.2422 0.0000 0.000000 0.000000 > Call-Put parity 3.2422 N/A 0 0.000000 > Integral 5.8308 N/A 2.588611 0.798407 > Finite Diff. 5.8309 N/A 2.588639 0.798416 > MC (crude) 5.8110 0.0116 2.568813 0.792301 > MC (antithetic) 5.8260 0.0052 2.583786 0.796919 > Binomial (JR) 5.8308 N/A 2.588541 0.798385 > Binomial (CRR) 5.8311 N/A 2.588926 0.798504 > > The Black Scholes price is still wrong. > Thanks for your help > Xavier > > > > > > Sadruddin Rejeb > > <[hidden email]> To: > [hidden email] > Sent by: cc: > > [hidden email] > Subject: Re: [Quantlib-users] Quantlib on sun solaris 8 > eforge.net > > > > > > 21/08/2002 15:41 > > Please respond to sad.rejeb > > > > > > > > > > Salut Xavier! > The thing is to delete -O2 (or -O3) from the compiler options. > You can try to set the environment variable CXXFLAGS to "-g" > e.g. if you use bash: > export CXXFLAGS="-g" > If this works, you can try to increment the optimization level by > setting CXXFLAGS to "-g -O1" > > Regards, > Sad > > > On 21 Aug 2002 at 13:25, [hidden email] wrote: > > > > > > Hi Jens, > > thanks for your reply, where is this -Optimizations located? > > I can't find any occurence Optimizations in any of text files into the > > Quantlib directory. > > Is it an option of compilation? > > Thanks > > Xavier > > > ------------------------------------------------------- > This sf.net email is sponsored by: OSDN - Tired of that same old > cell phone? Get a new here for FREE! > https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 > _______________________________________________ > Quantlib-users mailing list > [hidden email] > https://lists.sourceforge.net/lists/listinfo/quantlib-users > > > > > > > ------------------------------------------------------- > This sf.net email is sponsored by: OSDN - Tired of that same old > cell phone? Get a new here for FREE! > https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 > _______________________________________________ > Quantlib-users mailing list > [hidden email] > https://lists.sourceforge.net/lists/listinfo/quantlib-users > > ------------------------------------------------------- This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE! https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 _______________________________________________ Quantlib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users make.txt (163K) Download Attachment |
In reply to this post by Xavier.Abulker
Hi Jens,
this is what I did and I still have the same problem: > export CXXFLAGS="-g" >make clean I have removed the -o3 from all the files in the quantlib directory the -o3 (36 files) I checked the result of the make command into a file make.txt to be sure that there's no -o3 used during the compilation. There's no -o3 >make If I test EuropeanOption, the result is still wrong and SwapValuation crashes. Thanks "Jens Thiel" <[hidden email]> To: <[hidden email]> Sent by: cc: <[hidden email]> [hidden email] Subject: AW: [Quantlib-users] Quantlib on sun solaris 8 eforge.net 21/08/2002 14:09 Xavier, you must -- of course -- recompile the whole QuantLib library (thats were the calculations are done!) without compiler optimizations. And use a "make clean" before! Just removing the target won't help, since all optimizations are done while compiling to the .o files. With higher opt.levels (like -O1, -O2, etc.) compilers are more likely to produce errenous code due to over-agressive optimizations techniques. Jens. > > Hi Sad, > unfortunately it gives the same error: > this is my Unix cession: > > [xavier:540]~/QuantLib-0.3.0/Examples/EuropeanOption> rm EuropeanOption > > [xavier:541]~/QuantLib-0.3.0/Examples/EuropeanOption> export CXXFLAGS=" -g" > > [xavier:542]~/QuantLib-0.3.0/Examples/EuropeanOption> make > /bin/sh ../../libtool --mode=link g++ -g -pedantic -Wall -o > EuropeanOption EuropeanOption.o ../../ql/libQuantLib.la > g++ -g -pedantic -Wall -o .libs/EuropeanOption EuropeanOption.o > ../../ql/.libs/libQuantLib.so -R/usr/local/lib > creating EuropeanOption > > [xavier:543]~/QuantLib-0.3.0/Examples/EuropeanOption> EuropeanOption > Time to maturity = 0.25 > Underlying price = 102 > Strike = 100 > Risk-free interest rate = 0.05 > Volatility = 0.2 > > Method Value EstimatedError Discrepancy Rel. Discr. > Black Scholes 3.2422 0.0000 0.000000 0.000000 > Call-Put parity 3.2422 N/A 0 0.000000 > Integral 5.8308 N/A 2.588611 0.798407 > Finite Diff. 5.8309 N/A 2.588639 0.798416 > MC (crude) 5.8110 0.0116 2.568813 0.792301 > MC (antithetic) 5.8260 0.0052 2.583786 0.796919 > Binomial (JR) 5.8308 N/A 2.588541 0.798385 > Binomial (CRR) 5.8311 N/A 2.588926 0.798504 > > The Black Scholes price is still wrong. > Thanks for your help > Xavier > > > > > > Sadruddin Rejeb > > <[hidden email]> To: > [hidden email] > Sent by: cc: > > [hidden email] > Subject: Re: [Quantlib-users] Quantlib on sun solaris 8 > eforge.net > > > > > > 21/08/2002 15:41 > > Please respond to sad.rejeb > > > > > > > > > > Salut Xavier! > The thing is to delete -O2 (or -O3) from the compiler options. > You can try to set the environment variable CXXFLAGS to "-g" > e.g. if you use bash: > export CXXFLAGS="-g" > If this works, you can try to increment the optimization level by > setting CXXFLAGS to "-g -O1" > > Regards, > Sad > > > On 21 Aug 2002 at 13:25, [hidden email] wrote: > > > > > > Hi Jens, > > thanks for your reply, where is this -Optimizations located? > > I can't find any occurence Optimizations in any of text files into the > > Quantlib directory. > > Is it an option of compilation? > > Thanks > > Xavier > > > ------------------------------------------------------- > This sf.net email is sponsored by: OSDN - Tired of that same old > cell phone? Get a new here for FREE! > https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 > _______________________________________________ > Quantlib-users mailing list > [hidden email] > https://lists.sourceforge.net/lists/listinfo/quantlib-users > > > > > > > ------------------------------------------------------- > This sf.net email is sponsored by: OSDN - Tired of that same old > cell phone? Get a new here for FREE! > https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 > _______________________________________________ > Quantlib-users mailing list > [hidden email] > https://lists.sourceforge.net/lists/listinfo/quantlib-users > > ------------------------------------------------------- This sf.net email is sponsored by: OSDN - Tired of that same old cell phone? Get a new here for FREE! https://www.inphonic.com/r.asp?r=sourceforge1&refcode1=vs3390 _______________________________________________ Quantlib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Free forum by Nabble | Edit this page |