Quant development: How to build QuantLib on Linux and Ubuntu?

(Last Updated On: April 14, 2014)
Learn the Secret

Get  our 2 Free Books

Get these now which land directly to their inbox.
Invalid email address

Quant development: How to build QuantLib on Linux and Ubuntu?

I thought this might be useful for people trying to installing QuantLib-1.0.1 on Ubuntu 10.10 DE 32bit

Join my FREE newsletter if you like these sort of articles 

Cheers

 

John Willoughby

____________________________________________________________________________________________________

 

QUANTLIB-1.0.1 INSTALL ROUGH GUIDE FOR UBUNTU 10.10 32bit DESKTOP EDITION (RUNNING ON DELL MINI 9 8GB SSD)

 

I first off I used Synaptic Package Manager to install boost:

libboost1.42-doc

libboost1.42-all-dev

libboost1.42-dev

 

QuantLib-1.0.1 can also be successfully installed using synaptic however I found that I didn’t get the associated cpp source files in ./ql/… etc. Therefore, to install QuantLib-1.0.1 I undertook the following steps:

 

Downloaded QuantLib-1.0.1.tar.gz from http://www.quantlib.org

 

Copied this tar from /home/XYZ/Downloads to /opt

 

sudo cp QuantLib-1.0.1.tar.gz /opt

 

(why opt: http://ubuntuforums.org/archive/index.php/t-686282.html ).

 

Extracted tar in /opt using:

 

sudo tar xzvf QuantLib-1.0.1.tar.gz

 

Removed the tar file copy

 

sudo rm QuantLib-1.0.1.tar.gz

 

Configured Quantlib:

./configure –disable-static CXXFLAGS=-O2

 

The switches where needed to fix code bloat which filled up my 8GB SSD and  were suggested in an old thread by Luigi (see: http://old.nabble.com/Compilation-and-disk-space-td29830549.html)

 

Now ran make:

 

make && sudo make install

Next used:

sudo ldconfig

 

(why ldconfig: http://old.nabble.com/error-while-loading-shared-libraries%3A-libQuantLib-0.9.9.so-td26545177.html )

 

Done.

 

Now try to run

quantlib-test-suite

Which gave me

Tests completed in 26 m 44 s

***No errors detected

 

and another example like FRA:

cd /opt/QuantLib-1.0.1/Examples/FRA

sudo g++ -g -Wall -o a.out -I/usr/local/include/boost-1_38 FRA.cpp -lQuantLib

sudo ./a.out

 

From The QuantLib mailing list

 

NOTE I now post my TRADING ALERTS into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!
This entry was posted in Featured, Quant Development and tagged , , , , , on by .

About caustic

Hi i there My name is Bryan Downing. I am part of a company called QuantLabs.Net This is specifically a company with a high profile blog about technology, trading, financial, investment, quant, etc. It posts things on how to do job interviews with large companies like Morgan Stanley, Bloomberg, Citibank, and IBM. It also posts different unique tips and tricks on Java, C++, or C programming. It posts about different techniques in learning about Matlab and building models or strategies. There is a lot here if you are into venturing into the financial world like quant or technical analysis. It also discusses the future generation of trading and programming Specialties: C++, Java, C#, Matlab, quant, models, strategies, technical analysis, linux, windows P.S. I have been known to be the worst typist. Do not be offended by it as I like to bang stuff out and put priorty of what I do over typing. Maybe one day I can get a full time copy editor to help out. Do note I prefer videos as they are much easier to produce so check out my many video at youtube.com/quantlabs