[Scipy-svn] r7013 - in trunk/scipy/spatial: . qhull/src

scipy-svn@scip... scipy-svn@scip...
Mon Dec 13 15:29:12 CST 2010


Author: ptvirtan
Date: 2010-12-13 15:29:11 -0600 (Mon, 13 Dec 2010)
New Revision: 7013

Modified:
   trunk/scipy/spatial/SConscript
   trunk/scipy/spatial/qhull/src/mem.h
   trunk/scipy/spatial/setup.py
Log:
BUG: spatial/qhull: define ptr_intT correctly in Qhull

Modified: trunk/scipy/spatial/SConscript
===================================================================
--- trunk/scipy/spatial/SConscript	2010-12-12 19:59:08 UTC (rev 7012)
+++ trunk/scipy/spatial/SConscript	2010-12-13 21:29:11 UTC (rev 7013)
@@ -1,10 +1,14 @@
 # Last Change: Mon Nov 03 06:00 PM 2008 J
 # vim:syntax=python
 from os.path import join
+from numpy.distutils.misc_util import get_numpy_include_dirs, get_pkg_info
+from distutils.sysconfig import get_python_inc
 from numscons import GetNumpyEnvironment, CheckF77LAPACK, CheckF77Clib
 from numscons import write_info
 
 env = GetNumpyEnvironment(ARGUMENTS)
+env.PrependUnique(CPPPATH=[get_numpy_include_dirs(), get_python_inc(),
+                           env["PYEXTCPPPATH"]])
 
 #=======================
 # Starting Configuration
@@ -30,14 +34,14 @@
 
 env.NumpyPythonExtension('ckdtree', source = ['ckdtree.c'])
 
-env.NumpyPythonExtension('_distance_wrap', 
+env.NumpyPythonExtension('_distance_wrap',
                          source = [join('src', 'distance_wrap.c'),
                                    join('src', 'distance.c')])
 
 # Build qhull
 src = [join('qhull', 'src', s) for s in [
-    'geom2.c', 'geom.c', 'global.c', 'io.c', 'libqhull.c', 
-    'mem.c', 'merge.c', 'poly2.c', 'poly.c', 'qset.c', 
+    'geom2.c', 'geom.c', 'global.c', 'io.c', 'libqhull.c',
+    'mem.c', 'merge.c', 'poly2.c', 'poly.c', 'qset.c',
     'random.c', 'rboxlib.c', 'stat.c', 'user.c', 'usermem.c',
     'userprintf.c']]
 

Modified: trunk/scipy/spatial/qhull/src/mem.h
===================================================================
--- trunk/scipy/spatial/qhull/src/mem.h	2010-12-12 19:59:08 UTC (rev 7012)
+++ trunk/scipy/spatial/qhull/src/mem.h	2010-12-13 21:29:11 UTC (rev 7013)
@@ -19,6 +19,9 @@
 #ifndef qhDEFmem
 #define qhDEFmem 1
 
+#include <Python.h>
+#include <numpy/ndarraytypes.h>
+
 #include <stdio.h>
 
 /*-<a                             href="qh-mem.htm#TOC"
@@ -77,9 +80,9 @@
     ptr_intT is typically a signed value, but not necessarily so
     size_t is typically unsigned, but should match the parameter type
     Qhull uses int instead of size_t except for system calls such as malloc, qsort, qh_malloc, etc.
-    This matches Qt convention and is easier to work with.  
+    This matches Qt convention and is easier to work with.
 */
-typedef long ptr_intT;
+typedef npy_intp ptr_intT;
 
 /*-<a                             href="qh-mem.htm#TOC"
   >--------------------------------</a><a name="qhmemT">-</a>

Modified: trunk/scipy/spatial/setup.py
===================================================================
--- trunk/scipy/spatial/setup.py	2010-12-12 19:59:08 UTC (rev 7012)
+++ trunk/scipy/spatial/setup.py	2010-12-13 21:29:11 UTC (rev 7013)
@@ -5,18 +5,21 @@
 def configuration(parent_package = '', top_path = None):
     from numpy.distutils.misc_util import Configuration, get_numpy_include_dirs
     from numpy.distutils.system_info import get_info
+    from distutils.sysconfig import get_python_inc
 
     config = Configuration('spatial', parent_package, top_path)
 
     config.add_data_dir('tests')
 
-    qhull_src = ['geom2.c', 'geom.c', 'global.c', 'io.c', 'libqhull.c', 
-                 'mem.c', 'merge.c', 'poly2.c', 'poly.c', 'qset.c', 
+    qhull_src = ['geom2.c', 'geom.c', 'global.c', 'io.c', 'libqhull.c',
+                 'mem.c', 'merge.c', 'poly2.c', 'poly.c', 'qset.c',
                  'random.c', 'rboxlib.c', 'stat.c', 'user.c', 'usermem.c',
                  'userprintf.c']
 
     config.add_library('qhull',
                        sources=[join('qhull', 'src', x) for x in qhull_src],
+                       include_dirs=[get_python_inc(),
+                                     get_numpy_include_dirs()],
                        # XXX: GCC dependency!
                        #extra_compiler_args=['-fno-strict-aliasing'],
                        )



More information about the Scipy-svn mailing list