Cython Numpy warning about NPY_NO_DEPRECATED_API when using MemoryView

馋奶兔 提交于 2019-11-29 05:24:51

Just for a further reference, cython online docs says this is because Cython is using a deprecated Numpy API, and for the time being, it's just a warning that we can ignore.

I also get the same warnings, and I'd say it's normal.

With the numpy C API you need to put a line in front of the C script if you don't like this warning, but all it does is tell the compiler to ignore the "deprecated" message - it seems to work the same either way.

I'm guessing the Cython compiler doesn't put this line of code when it generates the C code, and I don't think that's important.

Thomas Riley

Assuming one wishes to hide the deprecation warning, the following compiler flag can be implemented with clang: extra_compile_args=['-Wno-#warnings'].

For gcc, extra_compile_args=['-Wno-cpp'] achieves the same.

Of course this also hides other preprocessor directive warnings.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!