summaryrefslogtreecommitdiff
path: root/numpy/lib/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/lib/utils.py')
-rw-r--r--numpy/lib/utils.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/numpy/lib/utils.py b/numpy/lib/utils.py
index bd453f617..06c1252eb 100644
--- a/numpy/lib/utils.py
+++ b/numpy/lib/utils.py
@@ -3,7 +3,7 @@ from numpy.core.numerictypes import obj2sctype
from numpy.core.multiarray import dtype
__all__ = ['issubclass_', 'get_numpy_include', 'issubsctype',
- 'issubdtype', 'deprecate',
+ 'issubdtype', 'deprecate', 'get_numarray_include',
'get_include', 'ctypes_load_library']
def issubclass_(arg1, arg2):
@@ -34,6 +34,22 @@ def get_include():
assert len(include_dirs)==1,`include_dirs`
return include_dirs[0]
+def get_numarray_include():
+ """Return the directory in the package that contains the numpy/*.h header
+ files.
+
+ Extension modules that need to compile against numpy should use this
+ function to locate the appropriate include directory. Using distutils:
+
+ import numpy
+ Extension('extension_name', ...
+ include_dirs=[numpy.get_include()])
+ """
+ from numpy.numarray import get_numarray_include_dirs
+ include_dirs = get_numarray_include_dirs()
+ return include_dirs[0]
+
+
# Adapted from Albert Strasheim
def ctypes_load_library(libname, loader_path):
if '.' not in libname: