numpy headers in demo setup.py
authorRobert Bradshaw <robertwb@math.washington.edu>
Thu, 23 Jul 2009 20:02:28 +0000 (13:02 -0700)
committerRobert Bradshaw <robertwb@math.washington.edu>
Thu, 23 Jul 2009 20:02:28 +0000 (13:02 -0700)
Demos/setup.py

index 75b05af0fce37948d547cb1fb88ae7303ba7712c..60cbeb817a1bec070cdafdecae6c1c422e6c5c81 100644 (file)
@@ -4,6 +4,12 @@ from distutils.core import setup
 from distutils.extension import Extension
 from Cython.Distutils import build_ext
 
+try:
+    from numpy.distutils.misc_util import get_numpy_include_dirs
+    numpy_include_dirs = get_numpy_include_dirs()
+except:
+    numpy_include_dirs = []
+
 ext_modules=[ 
     Extension("primes",       ["primes.pyx"]),
     Extension("spam",         ["spam.pyx"]),
@@ -11,7 +17,7 @@ ext_modules=[
 
 for file in glob.glob("*.pyx"):
     if file != "numeric_demo.pyx":
-        ext_modules.append(Extension(file[:-4], [file]))
+        ext_modules.append(Extension(file[:-4], [file], include_dirs = numpy_include_dirs))
 
 setup(
   name = 'Demos',