我正在尝试获得 typed Memoryview
on Cython
(Ubuntu 11.10 64bit)的好处,但即使在这个教科书示例中也会出现编译错误。不使用Memoryview
生成的代码似乎可以编译。我正在使用 Python 2.7 从 Sage 工作并收到如下错误:
gcc -fno-strict-aliasing -fwrapv -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/home/sergey/Python/sage-5.5/local/include/csage -I/home/sergey/Python/sage-5.5/local/include -I/home/sergey/Python/sage-5.5/local/include/python2.7 -I/home/sergey/Python/sage-5.5/local/lib/python/site-packages/numpy/core/include -I/home/sergey/Python/sage-5.5/devel/sage/sage/ext -I/home/sergey/Python/sage-5.5/devel/sage -I/home/sergey/Python/sage-5.5/devel/sage/sage/gsl -I/home/sergey/.sage/sage_notebook.sagenb/home/admin/1/code -I/home/sergey/Python/sage-5.5/local/include/python2.7 -c _home_sergey__sage_sage_notebook_sagenb_home_admin_1_code_sage2_spyx_0.c -o build/temp.linux-x86_64-2.7/_home_sergey__sage_sage_notebook_sagenb_home_admin_1_code_sage2_spyx_0.o -w -O2
_home_sergey__sage_sage_notebook_sagenb_home_admin_1_code_sage2_spyx_0.c:2259:29: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘.’ token
_home_sergey__sage_sage_notebook_sagenb_home_admin_1_code_sage2_spyx_0.c:2261:44: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘<strong>attribute’ before ‘.’ token
建议的修复:
import os
os.environ['LDFLAGS'] = '-march=i486'
os.environ['CFLAGS'] = '-march=i486'
没有帮助 - 它给出了我的处理器不支持此类指令的错误。
在此先感谢,谢尔盖