Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can`t generate c code files. Cython-0.21.1 Python2.6 QuantLib-1.4 #71

Closed
Hardy5012 opened this issue Nov 3, 2014 · 15 comments
Closed

Comments

@Hardy5012
Copy link

D:\sourcefile\python\pyql\pyql-master>setup.py build
C:\Python26\lib\distutils\extension.py:133: UserWarning: Unknown Extension options: 'cython_directiv
es'
warnings.warn(msg)
running build
running build_py
running build_ext
building '' extension
creating build\temp.win32-2.6
creating build\temp.win32-2.6\Release
creating build\temp.win32-2.6\Release\quantlib
d:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBU
G -D__WIN32__ -DWIN32 -DNDEBUG -D_WINDOWS -DNOMINMAX -DWINNT -D_WINDLL -D_SCL_SECURE_NO_DEPRECATE -D
CRT_SECURE_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS -IE:\share\workplace\code\QuantLib-1.4 -ID:\boost
\include\boost-1_53 -I. -I./cpp_layer -IC:\Python26\lib\site-packages\numpy\core\include -IC:\Python
26\include -IC:\Python26\PC /Tcquantlib/
.c /Fobuild\temp.win32-2.6\Release\quantlib/
.obj /GR /FD /
Zm250 /EHsc /Z7
*.c
c1 : fatal error C1083: 无法打开源文件:“quantlib/_.c”: Invalid argument
error: command '"d:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN\cl.exe"' failed with exit
status 2

@dpinte
Copy link
Member

dpinte commented Nov 3, 2014

Sounds like an issue with Cython as they are no .c files. You should only have cpp files. Are you sure Cython is installed correctly? What is the output of cython --version on the command line?

@Hardy5012
Copy link
Author

C:\Users\think>cython --version
Cython version 0.21.1

C:\Users\think>

@dpinte
Copy link
Member

dpinte commented Nov 3, 2014

Do you have setuptools installed?

@Hardy5012
Copy link
Author

I install it used source zip package

@Hardy5012
Copy link
Author

D:\sourcefile\python\Cython-0.21.1>setup.py install
running install
running bdist_egg
running egg_info
writing Cython.egg-info\PKG-INFO
....

Installed c:\python26\lib\site-packages\cython-0.21.1-py2.6-win32.egg
Processing dependencies for Cython==0.21.1
Finished processing dependencies for Cython==0.21.1

@dpinte
Copy link
Member

dpinte commented Nov 3, 2014

Can you confirm that you have either setuptools or distribute installed?

@Hardy5012
Copy link
Author

Thank you for your help, I found the cause of the problem.The install cmd must run with administrator rights in window7.

@Hardy5012
Copy link
Author

But I encountered another problem.
cashflow.obj : error LNK2019: 无法解析的外部符号 "public: thiscall QuantLib::Date::Date(void)" (??0Date@QuantLib@@QAE@XZ),
该符号在函数 "struct _object * __cdecl __pyx_pf_8quantlib_8cashflow_8CashFlow_4date___get
(struct *pyx_obj_8quantlib_8cashflow_CashFlow )"
(__pyx_pf_8quantlib_8cashflow_8CashFlow_4date___get
@@YAPAU_object@@PAU__pyx_obj_8quantlib_8cashflow_CashFlow@@@z) 中被引用

@dpinte
Copy link
Member

dpinte commented Nov 3, 2014

Have you generated the .def file? And build the .dll with it?

@dpinte
Copy link
Member

dpinte commented Nov 3, 2014

By the way, you can't build pyql for Python 2.6 using VC10, you need VC 2008!

@Hardy5012
Copy link
Author

I use VC 2008 to buid QuantLib.lib, has passed the aforementioned problems.But raising an another exception.

ql_settings.obj : error LNK2019: 无法解析的外部符号 "__declspec(dllimport) public: static class Quan
tLib::Settings & __cdecl QuantLib::Singleton::instance(void)" (_imp?inst
ance@?$Singleton@VSettings@QuantLib@@@quantlib@@SAAAVSettings@2@XZ),该符号在函数 "class QuantLib::Date __cdecl QuantLib::get_evaluation_date(void)" (?get_evaluation_date@QuantLib@@ya?AVDate@1@XZ) 中
被引用

@dpinte
Copy link
Member

dpinte commented Nov 3, 2014

Have you patched the ql\settings.hpp file as mentioned in the documentation?
( https://github.com/enthought/pyql/blob/master/docs/source/getting_started.rst#installation-from-source-on-windows)

@Hardy5012
Copy link
Author

Yes ,I have patched.
I run generate_symbols.py scripts there raising an exception. python2.6 subprocess don`t have both STARTF_USESHOWWINDOW and check_output attribute.

File "D:\sourcefile\python\pyql\pyql-master\scripts\generate_symbols.py", line 12, in symbol_generator_from_obj_file
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
AttributeError: 'module' object has no attribute 'STARTF_USESHOWWINDOW'

@dpinte
Copy link
Member

dpinte commented Dec 25, 2014

@Hardy5012 sorry for the slow answer. I can't see any obvious reason why your build does not pass. I can provide you with my .def and .lib files if that can help.

FYI: we've dropped the support for Python 2.6 (meaning that we won't invest much time in supporting it in the future).

@dpinte
Copy link
Member

dpinte commented Apr 15, 2015

Closing this issue for now. 2.6 is deprecated.

@dpinte dpinte closed this as completed Apr 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants