problem with Python Bindings for QuantLib

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

problem with Python Bindings for QuantLib

Laughing Man-2
Hi, 

I hope someone can help me with this: I've got a problem building the Python Bindings for QuantLib, I get stack in the build process...
I have tried to follow the instructions I had found on another site: http://www.wilmott.com/messageview.cfm?catid=10&threadid=34537


However I'm running into trouble, most likely due to some compiler versions incompatibility.
If I just type:

python setup.py build 

then I have the following error messages (truncated):

C:\build_ql_1_0_1\QuantLib-SWIG-1.0\Python>python setup.py build
running build
running build_py
running build_ext
building 'QuantLib._QuantLib' extension
C:\Program Files\pythonxy\mingw\bin\gcc.exe -mno-cygwin -mdll -O -Wall -IC:\Python25\include -IC:\Python25\PC -c QuantLib/quantlib_wrap.cpp -o build\temp.win32-2.5\Release\qu
\quantlib_wrap.o
QuantLib/quantlib_wrap.cpp:3370:26: ql/version.hpp: No such file or directory
QuantLib/quantlib_wrap.cpp:3371: error: `QL_HEX_VERSION' was not declared in this scope
QuantLib/quantlib_wrap.cpp:3372: error: `QL_VERSION' was not declared in this scope
QuantLib/quantlib_wrap.cpp:3431:27: ql/quantlib.hpp: No such file or directory
QuantLib/quantlib_wrap.cpp:3434:6: #error using an old version of QuantLib, please update
QuantLib/quantlib_wrap.cpp:3821:48: boost/algorithm/string/case_conv.hpp: No such file or directory
QuantLib/quantlib_wrap.cpp:3825: error: `QuantLib' has not been declared
QuantLib/quantlib_wrap.cpp:3825: error: expected nested-name-specifier before "Error"
QuantLib/quantlib_wrap.cpp:3825: error: `Error' has not been declared
QuantLib/quantlib_wrap.cpp:3826: error: `QuantLib' has not been declared


After having guessed that probably distutils was not happy because it was not using the same compiler with which I built QuantLib (VC 9.0) I tried to type this:

python setup.py build  --compiler=msvc

but had no better luck:

C:\build_ql_1_0_1\QuantLib-SWIG-1.0\Python>python setup.py build --compiler=msvc
running build
running build_py
running build_ext
warning: unable to detect QuantLib installation
error: Python was built with Visual Studio 2003;
extensions must be built with a compiler than can generate compatible binaries.
Visual Studio 2003 was not found on this system. If you have Cygwin installed,
you can try compiling with MingW32, by passing "-c mingw32" to setup.py.

Stepping through the python code for distutils, I realized that there is some kind of incompatibility with the Microsoft SDK versions. Indeed distutils (I use Python 2.5 from a PythonXY distribution) expects to work with SDK 1.1, but my SDK is 2.0. I actually also happen to have Visual Studio 8 on my computer -along with Visual Studio 9 and also 6- and for some reason distutils seems to pick VStudio 8 as default Microsoft compiler.

Could anyone please help me fixing this issue or suggest an alternative way to use Python with QuantLib? Isn't there any pre-compiled Python Bindings available?

Many thanks in advance.

LM











------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: problem with Python Bindings for QuantLib

Luigi Ballabio
On Thu, 2011-02-10 at 13:30 +0000, Laughing Man wrote:
> Indeed distutils (I use Python 2.5 from a PythonXY distribution)
> expects to work with SDK 1.1, but my SDK is 2.0. I actually also
> happen to have Visual Studio 8 on my computer -along with Visual
> Studio 9 and also 6- and for some reason distutils seems to pick
> VStudio 8 as default Microsoft compiler.

No luck.  If you're using Python2.5, it expects VC++7.
Is there any chance you can upgrade to Python 2.6 or 2.7?

Luigi


--

Testing can never demonstrate the absence of errors in software, only
their presence.
-- W.E. Dijkstra



------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in
Real-Time with Splunk. Collect, index and harness all the fast moving IT data
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: problem with Python Bindings for QuantLib

Laughing Man-3
Thanks Luigi,

I'm pretty much tied to Python 2.5, as it is part of the PythonXY distribution I'm currently using (not the latest one, but I can't upgrade to the newest since there are some incompatibilities between Matplotlib and PyXll, which I'm also using). Although I use Python quite a lot I'm not a Python wizard, especially when it comes to setting up the different distributions and packages.
I would like to start using the Python bindings of QuantLib along with my Python code, but so far it looks like it is not that straightforward. Thanks all the same.

LM



2011/2/23 Luigi Ballabio <[hidden email]>
On Thu, 2011-02-10 at 13:30 +0000, Laughing Man wrote:
> Indeed distutils (I use Python 2.5 from a PythonXY distribution)
> expects to work with SDK 1.1, but my SDK is 2.0. I actually also
> happen to have Visual Studio 8 on my computer -along with Visual
> Studio 9 and also 6- and for some reason distutils seems to pick
> VStudio 8 as default Microsoft compiler.

No luck.  If you're using Python2.5, it expects VC++7.
Is there any chance you can upgrade to Python 2.6 or 2.7?

Luigi


--

Testing can never demonstrate the absence of errors in software, only
their presence.
-- W.E. Dijkstra




------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in
Real-Time with Splunk. Collect, index and harness all the fast moving IT data
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users