Building Open Source Risk Engine (Quaternion ORE) in VS2017 without Git

The Open Source Risk Engine is an opensource software project for risk analytics and xVA. It is written (mostly) in C++ and based on QuantLib. In this post we explain how the ORE can be built from source in Visual Studio 2017.

Prologue: I am really excited with the fact, that QuantLib (the free open source C++ library for quantitative finance) really gets the second wind. Several years ago I started writing the notes on getting started with QuantLib but surprisingly there was little interest even among wanna-be-quants. But the situation does change: not only because I encounter more and more cases in which QuantLib is used but also because I recently got one more donation for my notes (for several years I got none and now I got two within two months). Thank you, guys! Though $10 does not make me rich, I really appreciate your acknowledgement and this strongly motivates me to write further posts about QuantLib. Today we will consider the ORE, since the xVA is a very interesting and (since Basel III) a highly demanded topic.
But before we can dive into the exciting world of Credit, Debit and Funding  Valuation Adjustments, we shall first build the ORE. Building without  Git is though old-fashioned but highly practical. Firstly, wanna-be-quants are usually not trained to use version control systems. Even more important that the IT policies in financial institutions are often too restrictive, so the installation of Git may be prohibited (and even if allowed, Git usage behind a proxy-server may be a real challenge).

In order to build ORE you need to have boost libraries installed. You can either install the binaries or (preferably) build them from source according to my instructions on NP (consider the Update: howto build QuantLib 1.2.1 + boost_1_52_0 in VS2012).

After installing boost, download the latest ORE release (currently 1.8.3.0).
Further download the latest QuantLib release (currently 1.13) and unpack it as follows

Do not be confused with Git reference

If you look in fule .gitmodules you will see the following line
[code][submodule "QuantLib"] path = QuantLib url = https://github.com/lballabio/QuantLib.git branch = v1.8.x ignore = dirty[/code]
v1.8.x is, however, too old.
Official manual recommends: Set up QuantLib 1.11 from its github or sourceforge download page, unless already installed. But fortunately is also works with the latest version 1.13

[collapse]

Further open oreEverything VS-Solution file and add boost libraries to VC++ Directories as follows

Finally you might need to add the line

C:\boost\boost_1_65_1\stage\lib\libboost_regex-vc141-mt-gd-1_65_1.lib;C:\boost\boost_1_65_1\stage\lib\libboost_serialization-vc141-mt-gd-1_65_1.lib;C:\boost\boost_1_65_1\stage\lib\libboost_date_time-vc141-mt-gd-1_65_1.lib;C:\boost\boost_1_65_1\stage\lib\libboost_system-vc141-mt-gd-1_65_1.lib;C:\boost\boost_1_65_1\stage\lib\libboost_filesystem-vc141-mt-gd-1_65_1.lib;C:\boost\boost_1_65_1\stage\lib\libboost_unit_test_framework-vc141-mt-gd-1_65_1.lib;

to the additional dependencies for the projects ore, OREAnalyticsTestSuite, OREDataTestSuite and quanttexttestsuite.

Build solution (F7), have fun! 🙂
And if you don't know how to get started with xVA, read Counterparty Risk FAQ: Credit VaR, PFE, CVA, DVA, Closeout, Netting, Collateral, Re-hypothecation, WWR, Basel, Funding, CCDS and Margin Lending by Damiano Brigo.

Like this post and wanna learn more? Have a look at Knowledge rather than Hope: A Book for Retail Investors and Mathematical Finance Students

FinViz - an advanced stock screener (both for technical and fundamental traders)