2012-10-23 110 views
0

我想编译一些Python/Numpy代码到Cython中以加速。我可以编译我的桌面上就好了 - 我抄我.pyx用Cython文件到我的笔记本电脑来运行它,并试图编译后,我得到以下错误:无法编译Cython代码 - 无法识别的命令行选项'-mno-cygwin'

C:\Python27\MATH7450>python setup.py build_ext --inplace 
running build_ext 
cythoning heat.pyx to heat.c 
building 'heat' extension 
C:\strawberry\c\bin\gcc.exe -mno-cygwin -mdll -O -Wall -IC:\Python27\lib\site-pa 
ckages\numpy\core\include -IC:\Python27\include -IC:\Python27\PC -c heat.c -o bu 
ild\temp.win32-2.7\Release\heat.o 
cc1.exe: error: unrecognized command line option '-mno-cygwin' 
error: command 'gcc' failed with exit status 1 

我运行Windows 7 64位。我看到它使用草莓perl。我有32位版本的草莓perl安装。再次,它在我的桌面上工作得很好,但是在移植到笔记本电脑时遇到这个奇怪的错误。

回答

2

根据Windows installation instructions of Cython,推荐的编译器是免费的Visual C++ 2008 Express,它可以从脱机安装Visual Studio 2008 Express iso安装。

或者Cython can use the MinGW and its gcc,虽然这是一个reportedly more difficult route

从包含在您的问题中的输出中,Cython试图使用包含在草莓Perl分发中的MinGW安装。

我的建议是安装Visual C++ 2008 Express,根据我的经验,它最适合编译Cython或其他Python C扩展模块。

相关问题