Permalink
Browse files

ENH: spatial/qhull: use qh_QHpointer

  • Loading branch information...
1 parent 3c03c49 commit 4e52583588a77f26ea8dcf9df1e008f61d462903 @pv pv committed Dec 8, 2012
Showing with 12 additions and 19 deletions.
  1. +2 −1 scipy/spatial/SConscript
  2. +2 −1 scipy/spatial/bscript
  3. +1 −1 scipy/spatial/qhull.pyx
  4. +7 −16 scipy/spatial/setup.py
View
@@ -48,4 +48,5 @@ src = [join('qhull', 'src', s) for s in [
'random.c', 'rboxlib.c', 'stat.c', 'user.c', 'usermem.c',
'userprintf.c']]
-env.NumpyPythonExtension('qhull', source = ['qhull.c'] + src)
+env.NumpyPythonExtension('qhull', source = ['qhull.c'] + src,
+ CDEFINES={'qh_QHpointer': '1'})
View
@@ -2,4 +2,5 @@ from bento.commands import hooks
@hooks.pre_build
def pre_build(context):
- context.tweak_extension("qhull", use="FLAPACK CLIB")
+ context.tweak_extension("qhull", use="FLAPACK CLIB",
+ defines=['qh_QHpointer=1'])
View
@@ -106,7 +106,7 @@ cdef extern from "qhull/src/qhull.h":
realT MINoutside
realT DISTround
- extern qhT qh_qh
+ extern qhT *qh_qh
extern int qh_PRINToff
extern int qh_ALL
View
@@ -15,29 +15,20 @@ def configuration(parent_package = '', top_path = None):
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']
+ 'userprintf.c', 'userprintf_rbox.c']
+ qhull_src = [join('qhull', 'src', x) for x in qhull_src]
inc_dirs = [get_python_inc()]
if inc_dirs[0] != get_python_inc(plat_specific=1):
inc_dirs.append(get_python_inc(plat_specific=1))
inc_dirs.append(get_numpy_include_dirs())
- config.add_library('qhull',
- sources=[join('qhull', 'src', x) for x in qhull_src],
- include_dirs=inc_dirs,
- # XXX: GCC dependency!
- #extra_compiler_args=['-fno-strict-aliasing'],
- )
-
- lapack = dict(get_info('lapack_opt'))
- try:
- libs = ['qhull'] + lapack.pop('libraries')
- except KeyError:
- libs = ['qhull']
+ cfg = dict(get_info('lapack_opt'))
+ cfg.setdefault('include_dirs', []).extend(inc_dirs)
+ cfg.setdefault('define_macros', []).append(('qh_QHpointer','1'))
config.add_extension('qhull',
- sources=['qhull.c'],
- libraries=libs,
- **lapack)
+ sources=['qhull.c'] + qhull_src,
+ **cfg)
config.add_extension('ckdtree', sources=['ckdtree.c']) # FIXME: cython

0 comments on commit 4e52583

Please sign in to comment.