From 6519d71eaa3f5b22bef3b0ea7b2cfba2348783ad Mon Sep 17 00:00:00 2001 From: Xon Date: Wed, 9 Mar 2011 19:10:35 -0500 Subject: [PATCH] changed setup.py to include numpy include paths from --- setup.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 1f5c93a..059631d 100644 --- a/setup.py +++ b/setup.py @@ -35,8 +35,17 @@ if py2exe != None: # c_overviewer extension # +# Third-party modules - we depend on numpy for everything +import numpy +# Obtain the numpy include directory. This logic works across numpy versions. +try: + numpy_include = numpy.get_include() +except AttributeError: + numpy_include = numpy.get_numpy_include() + + c_overviewer_files = ['src/main.c', 'src/composite.c', 'src/iterate.c'] -setup_kwargs['ext_modules'].append(Extension('c_overviewer', c_overviewer_files, include_dirs=['.'], extra_link_args=["/MANIFEST"] if platform.system() == "Windows" else [])) +setup_kwargs['ext_modules'].append(Extension('c_overviewer', c_overviewer_files, include_dirs=['.', numpy_include], extra_link_args=["/MANIFEST"] if platform.system() == "Windows" else [])) # tell build_ext to build the extension in-place # (NOT in build/) setup_kwargs['options']['build_ext'] = {'inplace' : 1}