| title | Build QuantLib with benchmark support |
|---|---|
| weight | 4 |
| layout | learningpathall |
From the QuantLib source directory:
cd ~/QuantLib-$QL_VERRun the configure script:
./configure \
--prefix=/usr/local \
--enable-benchmark \
--enable-parallel-unit-test-runner \
CFLAGS="-g -O2 -mcpu=native" \
CXXFLAGS="-g -O2 -mcpu=native"This configuration:
- installs QuantLib to
/usr/local - enables the benchmark executable
- enables parallel test execution
- applies CPU-specific optimization flags
Compile using all available cores:
make -j$(nproc){{% notice Note %}} The build may take 30–45 minutes on smaller instances. Use tmux to avoid losing progress if your SSH session disconnects. {{% /notice %}}
After the build completes:
sudo make install
sudo ldconfigMove to the test suite:
cd ~/QuantLib-$QL_VER/test-suiteCheck that the benchmark executable exists:
ls quantlib-benchmark