Introduction

The QuantLib addin provides an interface to the classes and class methods / functions of the financial library QuantLib (www.quantlib.org) which is written in C++. On this page you will not find an introduction of how to use this library. Rather it is an implementation of an interface to LibreOffice/Calc for the mentioned C++ classes and methods / functions. For examples see the provided examples. These examples are "translations" of the C++ examples provided by the QuantLib library in the Examples folder.


Binary and Examples

Generated addin for Linux/amd64 (debian) using LibreOffice 5.2: Calc Addin (current version 1.0 for QuantLib-1.12)

Examples based on the Calc addin:

If you start LibreOffice with the extension you will have to wait a few seconds (huge size of addin). All examples are available as an archive.

Not all QuantLib objects are stored by the addin. Some are instantiated on the fly (enumerated objects). Further some objects require templated arguments. You will find enumerated classes and template arguments in this HTML help file. For further explanations see the Introduction text.


Scource Code

Some words on the addin and how it works: Introduction.

Code for QuantLib Calc-Addin on Linux/amd64: Addin Code. Step into the directory Calc for compilation.

The modified version of QuantLib is Modified QuantLib Code. If you compile the addin code you need to change some files of the original QuantLib code (see Introduction.pdf).

Addin Code Generation

Change to the directory gensrc. Execute 'python main.py -o'.
Requirements:
  1. Python 3
  2. PyParsing package
Both requirements are met using Anaconda3.

Code Compilation

Change to the directory 'Calc'. Edit the file 'environment.sh' - the meaning of the variables is the following:
  1. QL_PATH: path to your QuantLib source code (e.g. QL_PATH=/test/QuantLib)
  2. QL_LIB: path to the compiled QuantLib library (e.g. QL_LIB=/test/QuantLib/ql/.libs)
  3. BOOST_PATH: path to your boost development installation (header files, depending
  4. on your system)
In order to compile the files genereated you have to include the path variables (e.g. execute '. environment.sh' under Gnu/Linux-bash). Include the LibreOffice SDK development setup to your path (e.g. execute '. ~/libreoffice/sdk/setsdkenv_unix.sh' under Gnu/Linux-bash).

Requirements for Addin Compilation

If you have used the auto-installation feature of the LibreOffice SDK nothing else has to be done. You can open the test sheet 'Examples.ods' by executing 'soffice path/Examples.ods'.
Requirements:
  1. installation of LibreOffice SDK
  2. development files for boost and compiled boost libraries (boost_regex, boost_serialization, lboost_filesystem, lboost_system)
  3. QuantLib library and QuantLib header files
  4. C++ compiler (e.g. g++ under Gnu/Linux)

Finally ...

If you have any questions please contact me. Please be aware that I respond usually at weekends.