加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
setup_profile.py 1.29 KB
一键复制 编辑 原始数据 按行查看 历史
from distutils.core import setup,Extension
import numpy
from Cython.Build import cythonize
from Cython.Compiler.Options import _directive_defaults
_directive_defaults['linetrace'] = True
_directive_defaults['binding'] = True
extensions = [Extension("factor_graph", ["graph_learning/cython/factor_graph.pyx"],include_dirs = [numpy.get_include()],
# libraries=["m"],
# extra_compile_args = ["-O3", "-ffast-math", "-march=native", ],
language='c',
define_macros=[('CYTHON_TRACE', '1')]
),
Extension("open_crf",['graph_learning/cython/open_crf.pyx'], include_dirs = [numpy.get_include()],
# extra_compile_args=["-fPIC", "-O3"],
# extra_link_args=["-fPIC", "-O3"],
# libraries=["m"],
# extra_compile_args = ["-O3", "-ffast-math", "-march=native", ],
language='c',
define_macros=[('CYTHON_TRACE', '1')]
),
]
setup(
name = 'open_crf cython',
package_data = {
'graph_learning/cython': ['*.pxd'],
},
ext_modules=cythonize(extensions,include_path=[numpy.get_include()],)
)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化