• C++ Programming for Financial Engineering
    Highly recommended by thousands of MFE students. Covers essential C++ topics with applications to financial engineering. Learn more Join!
    Python for Finance with Intro to Data Science
    Gain practical understanding of Python to read, understand, and write professional Python code for your first day on the job. Learn more Join!
    An Intuition-Based Options Primer for FE
    Ideal for entry level positions interviews and graduate studies, specializing in options trading arbitrage and options valuation models. Learn more Join!

How to build Quantlib 1.1 on Visual Studio 2010

Joined
5/2/06
Messages
11,759
Points
273
Quantlib 1.1 was released a few days ago.
Download http://quantlib.org/download.shtml

Instruction on how to build QuantLib 1.1 with VS2010: (credit to a poster on NP)

1. Download QuantLib 1.1. and boost (I used v1.46.1), unpack to D:\sandbox
2. Open VS2010, choose Tools -> Visual Studio Command Prompt
3. >cd d:\sandbox\boost_1_46_1
4. >bootstrap.bat (this will build bjam.exe)
5. >bjam --build-type=complete --toolset=msvc install
6. ............ PATIENCE!..........................
7. Finally, bjam will create a folder c:\boost
8. In VS2010 open D:\Sandbox\QuantLib-1.1\QuantLib-1.1\QuantLib_vc10.sln
9. In Solution Explorer select all projects, goto configurations properties -> VC++ Directories and add
a) to Include Directories C:\Boost\include\boost-1_46_1
b) to Library Directories C:\Boost\lib
10. Build solution, have fun!
 
Andy,

I just switched over to Visual Studio from Embarcadero RAD Pro. I am having issues building Quantlib. It appears the compiling standards for VC10 do not support the syntax used in Quantlib build files? All 15 builds failed, and the errors are largely syntax related. (eg. C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include\new(99): error C2751: 'std::nothrow_t' : the name of a function parameter cannot be qualified)

Any ideas? I want to get this done ASAP as I only have free time until tomorrow night.

Thank You,
J
 
THANKS ANDY FOR YOUR GREAT LABOR,
I WISH YOU A VERY HAPPY CHRISTMAS AND A PROSPEROUS NEW YEAR !!!!
Sincerely
LRSA (ExSan)
 

On the first go, I attempted command prompt method. It did not work. I then used the automagic installer to get Boost. I tried using the .sln file for VC10 but, I could not get it to compile. I'm reinstalling VC right now, so hopefully that takes care of the problem. I have boost 1.37 for RAD C++ Builder XE (Embarcadero), do you think I can get all the exercises done with it? It lacks uBLAS and some other numeric files, but I'm not sure how much we will be using those.
 
Problem resolved.

Thanks for the help, Andy.
Happy holidays.
 
I had MinGW installed on my computer and one of its addins was interfering with the D compiler used by VC10. I uninstalled VC express, VC10 and removed all Program Files directories. I then got rid of MinGW and reinstalled VC10 from scratch. Seems to have cleared up the issue. It's still unable to run the debugger, but that's alright. I got both quantlib and boost to build correctly.
 
Hi @Andy Nguyen,
I noticed that there was a small error in the testing code of:http://quantlib.org/install/vc10.shtml. It says
Add the QuantLib path (C:\Program Files\QuantLib in this example) to the include directories
but actually we should add C:\QuantLib\QuantLib-0.9.7, since we are using
#include <ql/quantlib.hpp>
.

And I got a lot of warning like these:C:\Users\ruozhou\Documents\course\C++\quantlib\QuantLib-1.1\ql/currency.hpp : warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
1>C:\Users\ruozhou\Documents\course\C++\quantlib\QuantLib-1.1\ql/currency.hpp : warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
Actually I noticed these warning when I was building the Quantlib. I am not sure if you happen to know why this is happening.

Thanks,
Roger
 
Actually I noticed these warning when I was building the Quantlib. I am not sure if you happen to know why this is happening.

Thanks,
Roger

Roger,

Before building Quantlib I suggest you right click the project in the explorer and go to properties. Within the properties tab, go to C++ under Linker properties, and place the include path relevant to Quantlib within quotes. This may resolve the problem.

Regards,
J
 
Roger,

Before building Quantlib I suggest you right click the project in the explorer and go to properties. Within the properties tab, go to C++ under Linker properties, and place the include path relevant to Quantlib within quotes. This may resolve the problem.

Regards,
J
Hi J,

Thanks for helping. Well, do you mean c/C++ tab or Linker tab I should go? And could you specify where and what I should add there? Since there are 15 project, so I should go one by one? Uh... looks like I have to build this huge lib again..It took me almost 4 hours to do that.

Roger
 
Hi J,

Thanks for helping. Well, do you mean c/C++ tab or Linker tab I should go? And could you specify where and what I should add there? Since there are 15 project, so I should go one by one? Uh... looks like I have to build this huge lib again..It took me almost 4 hours to do that.

Roger

Roger,

Please visit this link for a step-by-step instructional: http://quantlib.org/install/vc10.shtml

As you read through the page, you will see that Step 6 is the following:
[In the property page window, click on VC++ Directories on the left pane and add the paths for the Boost directories in Include Directories and Library Directories in the right pane. If you installed Boost in C:\Program Files\boost\boost_1_47, you'll have to add C:\Program Files\boost\boost_1_47 to the include directories and C:\Program Files\boost\boost_1_47\lib to the library directories. Click the OK button to set your changes.]

When adding your own include directory (C:\Users\ruozhou\Documents\course\C++\quantlib\QuantLib-1.1) simply place the entire path in quotes:

"C:\Users\ruozhou\Documents\course\C++\quantlib\QuantLib-1.1"
 
Now that I reread your original post, warnings are not a big deal. You shouldn't worry about them too much unless the build fails. Since the only errors were in the testing code, I honestly wouldn't worry about any of it. Quantlib should work with no more manipulation.
 
Now that I reread your original post, warnings are not a big deal. You shouldn't worry about them too much unless the build fails. Since the only errors were in the testing code, I honestly wouldn't worry about any of it. Quantlib should work with no more manipulation.

Yeah, that's true. But anyway, I will give it shoot when my old-fashion lap-top is free to run. :)
Thanks,

Roger
 
Hi,@Andy Nguyen , I have a VC++ 6.0, where can I get the boost for my VC++?
It seems that most setups are for VC++ 7.0 or more update version
 
Hi,@Andy Nguyen , I have a VC++ 6.0, where can I get the boost for my VC++?
It seems that most setups are for VC++ 7.0 or more update version
VC++6 is more than 10 years old. I would highly recommend not to use it. It's well known that version is not very compliant with the ANSI C++ Standard
 
APalley, I really need some help with this. I downladed the boost, quantlib, and try to run the test program as explained in http://quantlib.org/install/vc10.shtml but It doesn't work. I believe I configure everything as explained in the tutorial. But I get several errors:


1>------ Build started: Project: QuantLib, Configuration: Debug Win32 ------
1> cpicoupon.cpp
1> cpicouponpricer.cpp
1> fdextoujumpvanillaengine.cpp
1> fdklugeextouspreadengine.cpp
1>c:\users\juan garat\desktop\c++\boost\boost_1_47\boost\config\select_stdlib_config.hpp(18): fatal error C1083: Cannot open include file: 'cstddef': No such file or directory
1> fdmextendedornsteinuhlenbeckop.cpp
1>c:\users\juan garat\desktop\c++\boost\boost_1_47\boost\config\select_stdlib_config.hpp(18): fatal error C1083: Cannot open include file: 'cstddef': No such file or directory
1>c:\users\juan garat\desktop\c++\boost\boost_1_47\boost\config\select_stdlib_config.hpp(18): fatal error C1083: Cannot open include file: 'cstddef': No such file or directory
1> fdmextoujumpop.cpp
1> fdmextoujumpsolver.cpp
1>c:\users\juan garat\desktop\c++\boost\boost_1_47\boost\config\select_stdlib_config.hpp(18): fatal error C1083: Cannot open include file: 'cstddef': No such file or directory
1> fdmklugeextouop.cpp
1>c:\users\juan garat\desktop\c++\boost\boost_1_47\boost\config\select_stdlib_config.hpp(18): fatal error C1083: Cannot open include file: 'cstddef': No such file or directory
1> fdmvppstepcondition.cpp
1>c:\users\juan garat\desktop\c++\boost\boost_1_47\boost\config\select_stdlib_config.hpp(18): fatal error C1083: Cannot open include file: 'cstddef': No such file or directory
.....
.....
.....
 
Similar to Juan Garat, I believe that I followed the directions, but keep getting fatal errors that it cannot open include files - No such file or directory. I've tried uninstalling both Boost and Quantlib and reinstalling but to no avail. Any tips?

Further, I tried following Andy's instructions above and the cmd prompt said that bootstrap.bat doesn't exist... Any ideas are much appreciated, thanks.
 
Back
Top