Building Quantlib with Intel® C++ Compiler for Linux*

This document explains how to configure and build the open source Quantlib* library († ) and an example application provided with Quantlib. The Quantlib web page explains “The Quantlib project is aimed at providing a comprehensive software framework for quantitative finance. Quantlib is a free/open-source library for modeling, trading, and risk management in real-life. Quantlib is written in C++ with a clean object model, and is then exported to different languages such as C#, Objective Caml, Java, Perl, Python, GNU R, Ruby, and Scheme”. Quantlib depends on the Boost* C++ libraries, so we first describe how to configure and build Boost for Intel® C++ Compiler for Linux*.

Version Information
The version of Quantlib: Quantlib-0.3.13.tar.gz
The version of Boost: boost_1_33_1
The version of Intel C++ Compiler for Linux used: 10.0

Application Notes
The sample application prices a bermudan swaption using different models calibrated to market swaptions.

Obtaining the Source Code
Quantlib is an open-source library and can be downloaded from† . Boost provides free peer-reviewed portable C++ source libraries and is available for download at† .

In addition, Boost requires Bjam to build. Download Bjam version boost-jam-3.1.13-1-linuxx86.tgz at† .

Obtaining the latest version of Intel® C++ Compiler
See /en-us/articles/intel-compilers/ for details.

Quantlib depends on Boost being installed and correctly configured to work. The build instructions generate code to run on Intel® Core™ Micro-processor based systems by using the -xT option. See below for information on running on other processors.

Boost Configuration and Set-up Information
First we will build Boost, then Quantlib. Boost requires bjam to build. The following with configure Boost and Quantlib optimized for the Intel® Core Micro-Architecture using the compiler option -xT to generate SSSE3 instructions. The executables will only run on processors that support SSSE3 instructions. Depending on the processor the application is run on, you can try either -xP to generate SSE3 instructions or -xW to generate SSE2 instructions. The Intel Compilers support many options to target different instruction sets, consult the user documentation for additional information.

The file bjam must be in directory that is part of your PATH environment variable, this can be verified by typing

$ which bjam

Untar Boost tarball and enter the directory with the Boost files: $ tar zxvf boost_1_33_1.tar.gz $ cd boost_1_33_1

To configure Boost with Intel C++ Compiler for Linux version 10.0, you need to edit the file boost_1_33_1/tools/build/v1/intel-linux-tools.jam and replace -KPIC with -fPIC. This is not required for Intel C++ Comiler for Linux version 9.1.

Boost getting started documentation is located at†  You can configure & build Boost using the Intel® C++ Compiler for Linux* by entering this command (be sure to enter the correct INTEL_PATH for the version of the compiler installed):

bjam "-sINTEL_PATH=/opt/intel/cce/10.0.014/" -sTOOLS=intel-linux -sINTEL_CC="icc -xT -O3 -no-prec-div " -sINTEL_CXX="icc -xT -O3 -no-prec-div" "-sBUILD=release <debug-symbols>on" >& bjam-build-icc-xT-O3-no-prec-div.log &

If you errors such as “ Error: no such instruction: `pshufb _2il0floatpacket.1(%rip),%xmm0'” in bjam-build-icc-xT-O3-no-prec-div.log, you need to either--

  1. update binutils to a recent version that supports SSSE3 instructions available with the Intel Core Micro-Architecture such as 2.17.50 or
  2. build with –xP or –xW option instead of –xT.

The following command will build the Boost libraries and collect them to a common directory: bjam "-sINTEL_PATH=/opt/intel/cce/10.0.014/" -sTOOLS=intel-linux -sINTEL_CC="icc -xT -O3 -no-prec-div " -sINTEL_CXX="icc -xT -O3 -no-prec-div" "-sBUILD=release <debug-symbols>on" stage

Quantlib Configuration and Set-up Information
The following steps will configure and build the Quantlib library:

tar zxvf QuantLib-0.3.13.tar.gz

cd Quantlib-0.3.13/

# set BDIR to point to the main Boost directory (replace XXX with correct directory name on your system) BDIR=/home/XXX/boost_1_33_1

./configure CC=icc CXX=icpc CXXFLAGS="-O3 -xT" CFLAGS="-O3 -xT" FFLAGS="-O2" --with-boost-lib=${BDIR}/stage/lib --with-boost-include=${BDIR}/ >& configure.log

# Build Quantlib library

make >& icc-build.log

Source Code Changes
None required.

Building Application
# Build BermudanSwaption benchmark
cd Examples
make BermudanSwaption

Running Application
# Run BermudanSwaption example
cd BermudanSwaption
time ./BermudanSwaption

Verifying Correctness
Not provided with application.

This article shows the steps on how to build Quantlib with Intel C++ Compiler for Linux.

Known Issues and Limitations
None. Contact Intel® Premier Support website if you encounter problems or want to provide feedback.

This link will take you off of the Intel Web site. Intel does not control the content of the destination Web Site.

For more complete information about compiler optimizations, see our Optimization Notice.