Skip to content

Latest commit

 

History

History
66 lines (48 loc) · 1.07 KB

File metadata and controls

66 lines (48 loc) · 1.07 KB
title Build QuantLib with benchmark support
weight 4
layout learningpathall

Configure the QuantLib build

From the QuantLib source directory:

cd ~/QuantLib-$QL_VER

Run 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

Build QuantLib

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 %}}

Install QuantLib

After the build completes:

sudo make install
sudo ldconfig

Verify the build

Move to the test suite:

cd ~/QuantLib-$QL_VER/test-suite

Check that the benchmark executable exists:

ls quantlib-benchmark