В моей установке numpy arrayobject.h
находится в …/site-packages/numpy/core/include/numpy/arrayobject.h
. Я написал тривиальный Cython script, который использует numpy:
cimport numpy as np
def say_hello_to(name):
print("Hello %s!" % name)
У меня также есть следующие distutils setup.py
(скопировано из Руководство пользователя Cython):
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
ext_modules = [Extension("hello", ["hello.pyx"])]
setup(
name = 'Hello world app',
cmdclass = {'build_ext': build_ext},
ext_modules = ext_modules
)
Когда я пытаюсь построить с помощью python setup.py build_ext --inplace
, Cython пытается сделать следующее:
gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp -mno-fused-madd \
-fno-common -dynamic -DNDEBUG -g -Os -Wall -Wstrict-prototypes -DMACOSX \
-I/usr/include/ffi -DENABLE_DTRACE -arch i386 -arch ppc -pipe \
-I/System/Library/Frameworks/Python.framework/Versions/2.5/include/python2.5 \
-c hello.c -o build/temp.macosx-10.5-i386-2.5/hello.o
Как и ожидалось, это не находит arrayobject.h
. Как я могу заставить distutils использовать правильное расположение файлов с включенным numpy (без указания пользователем $CFLAGS)?