Hi All,
I am porting some code which uses Cython and Numpy from Ubuntu to OS
X, and have run into some problems getting the Cython compilation
process working. I am using distutils with the following in my
setup.py file:
> from distutils.core import setup
> from distutils.extension import Extension
> from Cython.Distutils import build_ext
>
> setup(
> cmdclass = {'build_ext': build_ext},
> ext_modules = [Extension("neuralRoutines", ["neuralRoutines.pyx"])]
> )
neuralRoutines.pyx imports and cimports numpy, amongst other things. I
don't think the problem lies in there because it runs fine as it is
under Ubuntu.
When I run "python setup.py build_ext --inplace" I get the following
error messages:
> Yarletts-Computer:scorelineModels yarlett$ python setup.py build_ext
> --inplace
> running build_ext
> building 'neuralRoutines' extension
> creating build
> creating build/temp.macosx-10.3-i386-2.6
> gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -
> fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 -I/Library/
> Frameworks/Python.framework/Versions/2.6/include/python2.6 -c
> neuralRoutines.c -o build/temp.macosx-10.3-i386-2.6/neuralRoutines.o
> neuralRoutines.c:136:31: error: numpy/arrayobject.h: No such file or
> directory
> neuralRoutines.c:136:31: error: numpy/arrayobject.h: No such file or
> directory
> neuralRoutines.c:659: error: syntax error before
> ‘__pyx_t_5numpy_int8_t’neuralRoutines.c:659: error: syntax error
> before ‘__pyx_t_5numpy_int8_t’
> neuralRoutines.c:659: warning: data definition has no type or
> storage class
> neuralRoutines.c:661: error: syntax error before
> ‘__pyx_t_5numpy_int16_t’
> neuralRoutines.c:661: warning: data definition has no type or
> storage class
> neuralRoutines.c:663: error: syntax error before
> ‘__pyx_t_5numpy_int32_t’
> neuralRoutines.c:663: warning: data definition has no type or
> storage class
It looks like arrayobject.h is not being found, so do I need to modify
my setup.py file somehow? I'm afraid I'm not sure how to do this, so
any help would be greatly appreciated.
When I search for arrayobject.h it can be found in the following
places, amongst others, on my system:
> /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-
> packages/numpy/core/include/numpy/arrayobject.h
> /Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-
> packages/numpy-1.3.0.dev6308-py2.5-macosx-10.3-i386.egg/numpy/core/
> include/numpy/arrayobject.h
> /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-
> packages/numpy/core/include/numpy/arrayobject.h
> /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-
> packages/numpy-1.3.0.dev6308-py2.5-macosx-10.3-i386.egg/numpy/core/
> include/numpy/arrayobject.h
> /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-
> packages/numpy-1.4.0.dev6728-py2.5-macosx-10.3-i386.egg/numpy/core/
> include/numpy/arrayobject.h
Many thanks,
Dan.
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev