My Cython code parses in C but does not compile. The first time you try to use external C code

I am trying to compile this code:

interp3d.pyx

together with the library provided here:

Interpolate3D

It goes past the cython → C level without any errors, but there are error krypton with gcc:

Compile-time errors --- dunno if this helps or not

Excerpt from compilation 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 can help me understand what I'm doing wrong here, that would be awesome. It's hard to figure out what C looks like and what makes it look like Python.

If this helps, I use Cython 0.14.1.

Thanks.

0
source share
2 answers

assuming you installed numpy on your system ...

in setup.py you should write:

 import numpy ... Extension(..., include_dirs = [numpy.get_include(), ... ] ) 
+2
source

It seems that the unsatisfied dependence on numpy , judging by the "No such files," errors.

0
source

All Articles