我的 Cython 代码解析为 C,但无法编译。第一次尝试使用外部C代码
我正在尝试编译此代码:
以及此处提供的库:
它通过了 cython -> C 阶段没有任何错误,但 gcc 存在大量错误:
编译错误摘录:
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -O2 -I/home/jordango/Desktop/epd-7.0-2-rh5-x86/include -fPIC -I/home/jordango/Desktop/epd-7.0-2-rh5-x86/include/python2.7 -c interp3d.c -o build/temp.linux-i686-2.7/interp3d.o
interp3d.c:225:31: error: numpy/arrayobject.h: No such file or directory
interp3d.c:226:31: error: numpy/ufuncobject.h: No such file or directory
如果有人可以帮助我找出我在这里做错了什么,那就太棒了。很难知道哪些内容应该像 C 语言,哪些内容应该像 Python 语言。
如果有帮助,我正在使用 Cython 0.14.1。
谢谢。
I am trying to compile this code:
along with the library provided here:
It gets past the cython -> C stage without any errors, but there's a crapton of errors with gcc:
Compile-time errors---dunno if this helps or not
Excerpt from compile errors:
gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -O2 -I/home/jordango/Desktop/epd-7.0-2-rh5-x86/include -fPIC -I/home/jordango/Desktop/epd-7.0-2-rh5-x86/include/python2.7 -c interp3d.c -o build/temp.linux-i686-2.7/interp3d.o
interp3d.c:225:31: error: numpy/arrayobject.h: No such file or directory
interp3d.c:226:31: error: numpy/ufuncobject.h: No such file or directory
If someone could help me figure out what I'm doing wrong here, that would be awesome. It's sort of hard to know what to make look like C and what to make look like Python.
If it helps, I'm using Cython 0.14.1.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
假设您已经在系统中安装了 numpy ...
在 setup.py 中您必须编写:
assuming you have installed numpy in your system ...
in your setup.py you have to write :
从“没有这样的文件”来看,似乎对 numpy 存在不满足的依赖关系
错误。
It looks like there's an unsatisfied dependency on
numpy
, judging by the "No such files"errors.