我正在编写一个小的 C 函数,它应该加速我在 Python 中拥有的较大应用程序的一些计算密集型部分。自然地,我编写了一个包装器来确保我的 C 代码可以与我的 Python numpy 数组无缝对话。一切都很好,我正在使用以下内容setup.py
from distutils.core import setup, Extension
import numpy
module1 = Extension('my_wrapper',
sources = ['my_c_file.c'],
include_dirs=[numpy.get_include()],
extra_compile_args = ['-fopenmp'],
extra_link_args = ['-lgomp'])
setup(name = 'my_wrapper',
version = '1.0',
description = 'Some description here',
ext_modules = [module1])
当我用命令编译它时一切正常python3 setup.py install,代码行为如预期,但我收到以下警告,
warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
#warning "Using deprecated NumPy API, disable it by " \
^
虽然这只是一个警告,但如果可以的话,我仍然想避免这种情况。关于如何做到这一点的任何想法?
qq_遁去的一_1
相关分类