1
votes

I'm trying to build the QuantLib Python bindings. I managed to build QuantLib using these instructions (I found the libboost_serialization files here). When I try python setup.py build, I get the following error

python setup.py build
running build
running build_py
running build_ext
building 'QuantLib._QuantLib' extension
C:\mingw\bin\gcc.exe -mno-cygwin -mdll -O -Wall -IC:\Python26\include -IC:\Python26\PC -c QuantLib/quantlib_wrap.cpp -o build\temp.win32-2.6\Release\quantlib\quantlib_wrap.o
cc1plus: error: unrecognized command line option '-mno-cygwin'
error: command 'gcc' failed with exit status 1 

I've heard that the mno-cygwin option is no longer supported and I've seen it removed from numpy distutils, but as far as I can tell this is only using python distutils. Any hints on what I should look at?

  • windows 7
  • python 2.6
  • numpy 1.5.1
  • QuantLib 1.46.1
2
The instructions you linked mention using Visual C++ Express, yet your output tells that distutils tries to use gcc. What are you actually using?Luigi Ballabio
I thought VC express was for compiling QuantLib not for the QuantLib bindings. I already successfully built QuantLib itself. Do you interpret the instructions differently?John Salvatier
Well, I don't see mingw or gcc mentioned anywhere in the instructions, and I do build the bindings with VC++9. Distutils works rather well with it, since Python itself is built with the VC++ compiler on Windows. Also, I don't know that a library compiled with VC++ and bindings compiled with gcc are binary compatible...Luigi Ballabio

2 Answers

3
votes

I've done a tutorial that builds Quantlib Python bindings on Windows (Vista and XP). This probably will work with Windows 7 as well and you don't need Visual Studio. here

1
votes

The answer is that Python 2.6 distutils hasn't caught up with MinGW (source). I now get another error, but that's for another question.