QuantLib is a free/open-source library for modeling, trading, and risk management in quantitative finance. In this below, we will demonstrate how to run an example code in Ubuntu linux.
First, one shall correctly install
- c++ compiler: g++
- boost c++ libraries
- QauntLib libraries
One can confirm the above installation through following command lines:
$cd /usr/lib
$ls *libboost*
$ls *libQauntLib*
$cd /usr/include
$ls ql
$ls boost
$quantlib-benchmark
$quantlib-config – -libs – -cflags
$quantlib-test-suite
Now we can test an example. Download an example code by copy and paste from QuantLib Documentation webpage (here). For instance, the code is saved to a file named “Bonds.cpp”.
Now, we can compile and link by
$g++ -o Bonds Bonds.cpp -L/usr/lib -lQauntLib
Then, run it.
$./Bonds
Now you can see pretty cool result for Bonds.