Permalink
Browse files

BUG: spatial/qhull: define ptr_intT correctly in Qhull

  • Loading branch information...
1 parent 6148526 commit 666f6ad297b6a53eb6ec3b1115bbe1f39625ec21 @pv pv committed Dec 13, 2010
Showing with 17 additions and 7 deletions.
  1. +7 −3 scipy/spatial/SConscript
  2. +5 −2 scipy/spatial/qhull/src/mem.h
  3. +5 −2 scipy/spatial/setup.py
View
@@ -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 @@ write_info(env)
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']]
@@ -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 @@ Trace short and quick memory allocations at T5
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>
View
@@ -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'],
)

0 comments on commit 666f6ad

Please sign in to comment.