Migrating to the reposit project

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

Migrating to the reposit project

Eric Ehlers-3
Hi All,

I implemented a project called reposit.  In a nutshell, addin source
code is autogenerated by a new SWIG module which supersedes gensrc.
Here is a link to a presentation that I gave on this project at the
QuantLib User Meeting last year:
http://quantlib.org/slides/qlws14/ehlers.pdf.

Advantages of the new design are:

1) The source code for the object wrappers is autogenerated.

2) Maintaining SWIG interface files is much easier than maintaining
gensrc XML function metadata.  Often, implementing a new function is as
simple as copying a line of code from a QuantLib header file into a
reposit SWIG interface file.  An example of this is provided in the
links below.

A lot of progress was made in the last month.  Under the new build the
QuantLibXL addin can now run the Excel VBA Framework
(http://quantlib.org/quantlibxl/framework.html) and price a swap.  So
we are well beyond a proof of concept, and the project is definitely
viable.

The plan now is to migrate to reposit for the 1.7 release.  I have
merged the reposit code to the master branch of my quantlib repo on
git.  So if you are interested in this project then please pull from my
repo and have a look.  All feedback is welcome.

I have organized my repo so that the old and new builds coexist.  Here
are the directories for the old build:

    gensrc
    ObjectHandler
    QuantLibAddin
    QuantLibXL

I am hoping not to have to maintain the above directories.  Here are
the directories for the new build:

    reposit - (this is a copy of ObjectHandler, renamed, and decoupled
    from gensrc)
    QuantLibAddin2
    QuantLibXL2

I also cloned the SWIG repo and in my copy I implemented a new module
called reposit.

Here is the web site for the project:

    http://quantlib.org/reposit/

Here are instructions for cloning the repos and building QuantLibXL.
There is also an example of how to export an additional function from
QuantLib to QuantLibXL:

    http://quantlib.org/reposit/

The code is in a state of flux so if you attempt the build please be
patient with any glitches.  I will try to keep the above build stable.

In the new build the functions do not always have the same name as the
functions in the old build.  The convention is to name the functions
qlXxxYyy where Xxx is the class name and Yyy is the member function
name.  In the new build, the names are generated automatically, so the
convention is strictly followed.  In the old build, the names were
configured by hand and the convention was not always followed, so some
function names have changed.

Since we are breaking some things we decided to break a few others.

In the old build, function signatures looked like this:

Free Functions:
    ..., Trigger
Member Functions:
    ObjectId, ..., Trigger
Constructors:
    ObjectId, ..., Permanent, Trigger, Overwrite

Putting those autogenerated parameters at the end means that any time a
new parameter is added in the QuantLib interface, the function breaks.
So we decided to put those parameters at the beginning.  This means
that new optional parameters can be added at the end without breaking
anything:

Free Functions:
    Trigger, ...
Member Functions:
    Trigger, ObjectId, ...
Constructors:
    Trigger, ObjectId, Overwrite, Permanent, ...

I am probably going to write a utility to automatically convert
workbooks from the old format to the new.

With regard to the recent work that was done on the LibreOffice addin,
changes made to gensrc will be lost.  However I happen to need the
LibreOffice addin for my own purposes and I intend to get it working on
the new platform very soon.  I am very glad to have a recent build to
work from.

Kind Regards,
Eric

------------------------------------------------------------------------------
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev
Reply | Threaded
Open this post in threaded view
|

Re: Migrating to the reposit project

Eric Ehlers-3
Oops...

> Here are instructions for cloning the repos and building QuantLibXL.
> There is also an example of how to export an additional function from
> QuantLib to QuantLibXL:
>
>     http://quantlib.org/reposit/

That link should be:

http://quantlib.org/reposit/docs/latest/build_git_swig_windows.html

Kind Regards,
Eric

------------------------------------------------------------------------------
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev