我想Cython通过使用将一些额外的选项传递给编译器extra_compile_args.
我的setup.py:
from distutils.core import setup
from Cython.Build import cythonize
setup(
name = 'Test app',
ext_modules = cythonize("test.pyx", language="c++", extra_compile_args=["-O3"]),
)
Run Code Online (Sandbox Code Playgroud)
但是,当我跑步时python setup.py build_ext --inplace,我收到以下警告:
UserWarning: got unknown compilation option, please remove: extra_compile_args
Run Code Online (Sandbox Code Playgroud)
问题:如何extra_compile_args正确使用?
我用Cython 0.23.4下了Ubuntu 14.04.3.
这个问题(在使用distutils构建时如何覆盖Cython的默认编译标志?)描述了在使用distutils时如何设置默认的Cython标志.
但是,如果我只使用pyximport,如何设置默认编译标志?
import pyximport
pyximport.install() # Pass compile flags here somehow?
Run Code Online (Sandbox Code Playgroud)