相关疑难解决方法(0)

Cython中的extra_compile_args

我想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.

cython

16
推荐指数
3
解决办法
7673
查看次数

使用pyximport时如何设置Cython编译器标志?

这个问题(在使用distutils构建时如何覆盖Cython的默认编译标志?)描述了在使用distutils时如何设置默认的Cython标志.

但是,如果我只使用pyximport,如何设置默认编译标志?

import pyximport
pyximport.install()  # Pass compile flags here somehow?
Run Code Online (Sandbox Code Playgroud)

python cython

7
推荐指数
1
解决办法
3480
查看次数

标签 统计

cython ×2

python ×1