[ quantlib-Bugs-2797120 ] Failure to compile Python ext. - Visual C++ 2008, Boost 1.36

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[ quantlib-Bugs-2797120 ] Failure to compile Python ext. - Visual C++ 2008, Boost 1.36

SourceForge.net
Bugs item #2797120, was opened at 2009-05-27 02:16
Message generated for change (Tracker Item Submitted) made by pm13
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=112740&aid=2797120&group_id=12740

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: pm13 (pm13)
Assigned to: Nobody/Anonymous (nobody)
Summary: Failure to compile Python ext. - Visual C++ 2008, Boost 1.36

Initial Comment:
The whole title should be:
Failure to compile Python extensions with Visual C++ 2008 and Boost 1.36.0 without change in setup.py

(This is almost the same as an another bug, difference is in the version of Boost).

I tried to compile Python extensions for QuantLib in Windows XP SP3. I used Visual C++ 2008 Express Edition, Python 2.6.2, Boost 1.36.0, Boost Jam 3.1.16, QuantLib 0.9.7 and QuantLib-SWIG 0.9.7.

My steps:
1. Install Visual C++
2. Install Python
3. Extract Boost and Boost Jam, compile Boost (bjam.exe install)
4. Extract QuantLib, copy Boost headers and compiled libraries to the extracted directory, compile QuantLib in Visual Studio
5. Extract QuantLib-SWIG, set QL_DIR to the extracted directory, try to compile Python extensions (python.exe setup.py install)

I am not sure if it is the right procedure. But it could be - it works with a little patch.
In the last step (python.exe setup.py install) I got this exception (more in the first attachment):
C:\Program Files\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : warning C4530: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc

C:\Program Files\Microsoft Visual Studio 9.0\VC\BIN\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:C:\Python26\libs /LIBPATH:C:\Python26\PCbuild /LIBPATH:C:\QuantLib-0.9.7\lib /EXPORT:init_QuantLib build\temp.win32-2.6\Release\QuantLib/quantlib_wrap.obj /OUT:build\lib.win32-2.6\QuantLib\_QuantLib.pyd /IMPLIB:build\temp.win32-2.6\Release\QuantLib\_QuantLib.lib /MANIFESTFILE:build\temp.win32-2.6\Release\QuantLib\_QuantLib.pyd.manifest /subsystem:windows /machine:I386

   Creating library build\temp.win32-2.6\Release\QuantLib\_QuantLib.lib and object build\temp.win32-2.6\Release\QuantLib\_QuantLib.exp

quantlib_wrap.obj : error LNK2019: unresolved external symbol "void __cdecl boost::throw_exception(class std::exception const &)" (?throw_exception@boost@@YAXABVexception@std@@@Z) referenced in function "public: double __thiscall boost::function1<double,double>::operator()(double)const " (??R?$function1@NN@boost@@QBENN@Z)

build\lib.win32-2.6\QuantLib\_QuantLib.pyd : fatal error LNK1120: 1 unresolved externals

I used the advice and I added "/EHsc" to extra_compile_args:
extra_compile_args = ['/GR', '/FD', '/Zm250', '/EHsc']

With changed setup.py I was able to compile Python extensions (more in the second attachment) and tests passed (python.exe setup.py test).



----------------------------------------------------------------------

You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=112740&aid=2797120&group_id=12740

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp as they present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://p.sf.net/sfu/creativitycat-com 
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev