|
| 1 | + |
| 2 | +# Building ORE on Posix Systems (e.g. MacOS and Linux) |
| 3 | + |
| 4 | +This tutorial explains how to build ORE on Posix systems such as MacOS and |
| 5 | +Linux. The commands listed here were tested on Ubuntu and you will likely have |
| 6 | +to modify the commands slightly on other systems. |
| 7 | + |
| 8 | +[Back to tutorials index](../tutorials_index.md) |
| 9 | + |
| 10 | +# Prerequisites |
| 11 | + |
| 12 | +This build requires: |
| 13 | + |
| 14 | +- gcc |
| 15 | +- Boost |
| 16 | +- CMake |
| 17 | + |
| 18 | +# Source code |
| 19 | + |
| 20 | +You need to grab the source code for ORE, e.g: |
| 21 | + |
| 22 | + git clone --recurse-submodules https://github.com/OpenSourceRisk/Engine.git ore |
| 23 | + |
| 24 | +# Environment Variables |
| 25 | + |
| 26 | +For purposes of this tutorial, create environment variable |
| 27 | +`ORE_ROOT_DIR`pointing to the root directory of your build, e.g: |
| 28 | + |
| 29 | + ORE_ROOT_DIR=/home/repos/ore |
| 30 | + |
| 31 | +If you installed boost from packages (e.g. `sudo apt install |
| 32 | +libboost-all-dev`), then your build will probably find boost automatically. If |
| 33 | +you built boost yourself from source, then export some environment variables |
| 34 | +pointing to the boost include and lib directories, e.g: |
| 35 | + |
| 36 | + export BOOST_INCLUDEDIR=/home/repos/boost/install/include |
| 37 | + export BOOST_LIBRARYDIR=/home/repos/boost/install/lib |
| 38 | + |
| 39 | +# Build ORE |
| 40 | + |
| 41 | +## Configure ORE |
| 42 | + |
| 43 | +Below are the commands to configure the ORE build using cmake: |
| 44 | + |
| 45 | + mkdir $ORE_ROOT_DIR/build |
| 46 | + cd $ORE_ROOT_DIR/build |
| 47 | + cmake .. |
| 48 | + |
| 49 | +## Build ORE |
| 50 | + |
| 51 | +Below are the commands to build ORE. |
| 52 | + |
| 53 | + cd $ORE_ROOT_DIR/build |
| 54 | + cmake --build . |
| 55 | + |
| 56 | +# Run tests |
| 57 | + |
| 58 | +## QuantLib |
| 59 | + |
| 60 | +cd to the test directory: |
| 61 | + |
| 62 | + cd $ORE_ROOT_DIR/build/QuantLib/test-suite |
| 63 | + |
| 64 | +Run all unit tests: |
| 65 | + |
| 66 | + ./quantlib-test-suite |
| 67 | + |
| 68 | +Run a selected test, e.g: |
| 69 | + |
| 70 | + ./quantlib-test-suite --log_level=all --run_test="QuantLib test suite/Swap tests" |
| 71 | + |
| 72 | +## QuantExt |
| 73 | + |
| 74 | + cd $ORE_ROOT_DIR/build/QuantExt/test |
| 75 | + ./quantext-test-suite |
| 76 | + |
| 77 | +## OREData |
| 78 | + |
| 79 | + cd $ORE_ROOT_DIR/build/OREData/test |
| 80 | + ./ored-test-suite |
| 81 | + |
| 82 | +## OREAnalytics |
| 83 | + |
| 84 | + cd $ORE_ROOT_DIR/build/OREAnalytics/test |
| 85 | + ./orea-test-suite |
| 86 | + |
0 commit comments