I have been trying to get Python binding for QuantLib working for a while now but without any success so far.
I did follow QuantLib installation guidelines and wiki. That is to build QuantLib using VC9 and not VC10 which works fine for me.
When I try to build Python setup file, I am being told that MSVC cannot detect QuantLib installation.
Please could someone be kind enough to advise what I am missing here. As you would have realized by now, I am much of a beginner with this and apologize if question has been asked over and over in the past but I couldn't find any answer to my question in the different forums: wilmott, sourceforge, stack overflow,quant exchange.
Any help would be greatly appreciated.
Best regards
Here is the log:
c:\QuantLib\QuantLib-SWIG-1.2\Python>set INCLUDE = C:\boost\boost_1_51
c:\QuantLib\QuantLib-SWIG-1.2\Python>set QL_DIR = C:\QuantLib\QuantLib-1.2.1
c:\QuantLib\QuantLib-SWIG-1.2\Python>set LIB= C:\boost\boost_1_51\lib;C:\QuantLi
b\QuantLib-1.2.1\lib
c:\QuantLib\QuantLib-SWIG-1.2\Python>setup.py build
running build
running build_py
running build_ext
warning: unable to detect QuantLib installation
building 'QuantLib._QuantLib' extension
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox
/MD /W3 /GS- /DNDEBUG -D_WIN32_ -DWIN32 -DNDEBUG -D_WINDOWS -DNOMINMAX -IC:\Py thon27\include -IC:\Python27\PC "-IC:\Program Files (x86)\Microsoft Visual Studi o 9.0\VC\INCLUDE" "-IC:\Program Files\Microsoft SDKs\Windows\v6.0A\include" -I / TpQuantLib/quantlib_wrap.cpp /Fobuild\temp.win32-2.7\Release\QuantLib/quantlib_w rap.obj /GR /FD /Zm250 /EHsc /MD cl : Command line error D8003 : missing source filename error: command '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\cl.ex e"' failed with exit status 2
Remove the spaces around the = sign when you set the environment variables, or Python won't find them. Here is what happens on a WinXP box I still have around at the office:
FOO (set without spaces) is found; BAR (with) is not.
Not finding the QL_DIR, INCLUDE or LIB variables causes the other errors in cascade.