Re: QuantLibAddin, Addin/Cpp

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

Re: QuantLibAddin, Addin/Cpp

Roland Lichters-2
Let's keep in touch and I will certainly let you know when I get back
into this in detail.  I would definitely welcome any help you could
provide on this front.

Hi Eric,

I mad a few more steps last weekend:

1) copied/pasted a simple example (I call it calcaddins.cpp) based on http://wiki.services.openoffice.org/wiki/Calc/Add-In/Simple_Calc_Add-In and
2) modified OpenOffice.org3.1_SDK/examples/DevelopersGuide/Components/Makefile to compile the simple example and deploy it into Calc
3) managed to link the sdk example code with QuantLibAddin, ObjectHandler 0.9.9 etc.
4) added calcutils.cpp, init.cpp, conversions.cpp from QuantLibAddin/Addins/Calc to the compilation
5) added a few functions manually to the example code:  qlVersion(), qlAddinVersion(), qlEuropeanExercise()

It is all in a very experimental stage (see attached), but at least it compiles on my Mac, the addin library gets deployed, the functions show up in Calc's function wizard, and they work.

At this point I think we could make the QuantLibAddin for Calc work in 0.9.9 with OOo 3 as it did in version 0.9.0 with Ooo 2.4 (I mean adding functions manually, have not looked into gensrc yet).
Before I continue digging into this, I'd like to discuss with you a bit more. For example, your IDL file looks already different from the example I have picked etc. I'm also curious whether the attached files work on your (I guess) Linux environment, too (definitely needs changing paths in the Makefile).

What do you think?

Best regards,
Roland
 
 

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev

calcaddin.tar.gz (376K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: QuantLibAddin, Addin/Cpp

Roland Lichters-2
How would you feel about putting together a new example workbook that we
could use for a new screenshot on http://www.quantlibaddin.org - ideally
something that shows off the business functionality as much as possible,
and shows the latest version numbers for Calc + QL, using the colors
from the website - ?
Hi Eric,
 
thanks for the encouraging words ;-).
In fact it did not take much yesterday night to get the Option.ods up again. I organised the code such that it is similar to your original files in QuantLibAddin/Addins/Calc and I reused most of it with tiny modifications. I will commit it to the 0.9.9 branch tonight or tomorrow, QuantLibAddin/Addins/Calc2 and QuantLibAddin/Clients/Calc2, as you suggested.
 
I am really wondering now which change prevented compilation/deployment in the first place. I cannot tell because I started from scratch with the simple wiki examples and added your code step by step.
 

The holy grail would be to get the Calc addin into a state where it
could seamlessly load the flagship example QLXL workbooks...

QuantLibXL/Workbooks/StandaloneExamples/YieldTermStructures.xls
QuantLibXL/Workbooks/StandaloneExamples/InterestRateDerivatives.xls

...but that would take a lot of work.
Ok, I'm tempted. But doesn't it make more sense to look at gensrc for Calc now rather than putting the code together manually?
 
Best regards,
Roland

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Fwd: QuantLibAddin, Addin/Cpp

Roland Lichters-2

The holy grail would be to get the Calc addin into a state where it
could seamlessly load the flagship example QLXL workbooks...

QuantLibXL/Workbooks/StandaloneExamples/YieldTermStructures.xls
QuantLibXL/Workbooks/StandaloneExamples/InterestRateDerivatives.xls

...but that would take a lot of work.
Ok, I'm tempted. But doesn't it make more sense to look at gensrc for Calc now rather than putting the code together manually?
 
Hi Eric,
I made small changes to gensrc/gensrc/addins/calc.py (attached) just to make it run and produce output files again. Next would be adjusting the output to the "new" format.. 
But apart from this step- if I want to expose more functionality to Calc (that is already exposed to XL), does this mean I have to add <SupportedPlatform name='Calc'/> to the desired functions in QuantLibAddin/gensrc/metadata/functions/*.xml? This seems to be it at first glance.
Regards,
Roland



------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev

calc.py (14K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: QuantLibAddin, Addin/Cpp

Eric Ehlers-2
Hi Roland,

I only just noticed that we were cc-ing quantlib-dev here :)

> if I want to expose more functionality to Calc (that is already
> exposed to XL), does this mean I have to add <SupportedPlatform
> name='Calc'/> to the desired functions in
> QuantLibAddin/gensrc/metadata/functions/*.xml?

Yes, that would be the very first step.  But it would take a whole lot
more work to get the Calc addin to the stage where it supports
YieldTermStructures.xls and InterestRateDerivatives.xls.

Setting <SupportedPlatform name='Calc'/> will tell gensrc to attempt to
autogenerate the source code for the relevant function in the Calc
addin.  But for many functions, the autogenerated code will not compile,
or will compile and then fail at runtime.  The main things that are
missing are conversion functions, plus various other features of
ObjectHandler which are further advanced for Excel than for Calc.

Regards,
Eric



------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: QuantLibAddin, Addin/Cpp

Roland Lichters-2
> if I want to expose more functionality to Calc (that is already
> exposed to XL), does this mean I have to add <SupportedPlatform
> name='Calc'/> to the desired functions in
> QuantLibAddin/gensrc/metadata/functions/*.xml?

Yes, that would be the very first step.  But it would take a whole lot
more work to get the Calc addin to the stage where it supports
YieldTermStructures.xls and InterestRateDerivatives.xls.

Setting <SupportedPlatform name='Calc'/> will tell gensrc to attempt to
autogenerate the source code for the relevant function in the Calc
addin.  But for many functions, the autogenerated code will not compile,
or will compile and then fail at runtime.  The main things that are
missing are conversion functions, plus various other features of
ObjectHandler which are further advanced for Excel than for Calc.
Hi Eric,
yes, I noticed the limits :-). I have modified calc.py and functions/*.xml
to produce the basic files/functions in Addins/Calc2, and I am now trying
to include more functions. It worked for some termstructures and
instruments etc.,  but indeed I'll have to look into conversions now.
Indeed, quite some work ahead. 
Do you consider including Calc2 into the QuantLibAddin-0.9.9 release?
Regards,
Roland 

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Re: Fwd: QuantLibAddin, Addin/Cpp

Eric Ehlers-2
Hi Roland,

> Do you consider including Calc2 into the QuantLibAddin-0.9.9 release?

Yes, definitely - the old addin is simply broken so even if yours works
only on your Mac it's still the best we have ;)

I will let you know when we're near to packaging the prerelease tarballs
and at that point let's try to get the addin into a consistent state.  I
will try to get it running on linux and windows and I'll rename
Calc->Calc_old
Calc2->Calc

Regards,
Eric


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev