1

I downloaded tarbals for both quantlib 1.14 and quantlib 1.14-swig. The quantlib folder under SWIG does contain the quantlib_wrap.cpp. But the setup complains the the MSC version. Here is the new error. This post is associated with another post on missing quantlib_wrap.cpp error message.

C:\Users\Public\3rdParty\Libraries\QuantLib-1.14\ql/config.msvc.hpp(29) : fatal error C1189: #error :  "versions of Visual C++ prior to VC++10 (2010) are no longer supported"
error: command 'C:\\Users\\U435169\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe' failed with exit status 2.

Use 1.13. VC9 is no longer supported. – Luigi Ballabio

I will try 1.13 also. But actually, I do have VC++ 14.0 installed. I am using VS2015 to compile the quantlib. Not sure the true reason.

I did try the 1.13 and run into linking error. I think it might be from the inconsistency between the compile of quantlib-swig (VC9.0) and quantlib(VC14). If that is the case, how do we control the compiling version of quantlib-swig? Is there an option to control that?

C:\Users\U435169\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -D__WIN32__ -DWIN32 -DNDEBUG -D_WINDOWS -DNOMINMAX -ID:\packages\Python27\include -ID:\packages\Python27\PC -IC:\Users\Public\3rdParty\Libraries\QuantLib-1.13 -IC:\Users\Public\MSYS2\mingw32\include /TpQuantLib/quantlib_wrap.cpp /Fobuild\temp.win32-2.7\Release\QuantLib/quantlib_wrap.obj /GR /FD /Zm250 /EHsc /bigobj /MD
quantlib_wrap.cpp
C:\Users\U435169\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:D:\packages\Python27\libs /LIBPATH:D:\packages\Python27\PCbuild /LIBPATH:D:\packages\Python27\PC\VS9.0 /LIBPATH:C:\Users\Public\3rdParty\Libraries\QuantLib-1.13\lib /EXPORT:init_QuantLib build\temp.win32-2.7\Release\QuantLib/quantlib_wrap.obj /OUT:build\lib.win32-2.7\QuantLib\_QuantLib.pyd /IMPLIB:build\temp.win32-2.7\Release\QuantLib\_QuantLib.lib /MANIFESTFILE:build\temp.win32-2.7\Release\QuantLib\_QuantLib.pyd.manifest /subsystem:windows /machine:x86
LINK : fatal error LNK1104: cannot open file 'QuantLib-vc90-mt.lib'
error: command 'C:\\Users\\U435169\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\link.exe' failed with exit status 1104
MagicFatto
  • 21
  • 4
  • What is the question? What version of MSVC are your using? – NathanOliver Nov 20 '18 at 20:26
  • Welcome to Stack Overflow! Please take the [tour] and in particular read [ask]. It's very unclear what your question is or what you expect from a solution. After all, the error message is pretty clear. – Ulrich Eckhardt Nov 20 '18 at 20:33
  • Wasn't finishing the question and browser was terminated unexpected. Re-edit it for clarity. – MagicFatto Nov 20 '18 at 20:46

1 Answers1

1

I'm guessing you're compiling the module for Python 2.7?

Python 2.7 for Windows is compiled with VC++ 2008 and uses it for compiling external modules as well. If you can switch to Python 3.5 or later instead, it will use your VC++ 2015 installation.

Luigi Ballabio
  • 4,128
  • 21
  • 29
  • You are right! When try 3.6.1, ran into indentation error. I saw similar problems posted 10 month ago and you suggested him writing email to the related developers. Not sure how his problem was resolved. (C:\ProgramData\Anaconda3) C:\Users\Public\3rdParty\Libraries\QuantLib-SWIG-1.14\Python>python setup.py build File "setup.py", line 2 Copyright (C) 2000, 2001, 2002, 2003 RiskMap srl ^ IndentationError: unexpected indent – MagicFatto Nov 21 '18 at 01:24
  • By the way, Python 2.7.3 doesn't have this issue and I have never modified the `setup.py`. The first three lines are: `# -*- coding: iso-8859-1 -*- """ Copyright (C) 2000, 2001, 2002, 2003 RiskMap srl` – MagicFatto Nov 21 '18 at 01:40
  • It seems that Python doesn't recognize the second line (it reports line 3 as line 2). Please try adding a blank line between line 1 and 2. – Luigi Ballabio Nov 21 '18 at 13:41
  • And anyway: did you try running `pip install QuantLib-Python` as I suggested in your other question, instead of compiling? – Luigi Ballabio Nov 21 '18 at 13:43
  • Thanks Luigi for staying with me all this time!!! I did try `pip install QuantLib-Python` and it didn't work out. If that worked, it would make life easier :). Once I inserted one blank line between the original first line and second line in the `setup.py`, the problem went away. The build went well and finished generating code!!! Didn't expect this to be this hard but lucky to have your guidance. – MagicFatto Nov 21 '18 at 14:17