diff options
author | Travis Oliphant <oliphant@enthought.com> | 2006-07-08 03:04:28 +0000 |
---|---|---|
committer | Travis Oliphant <oliphant@enthought.com> | 2006-07-08 03:04:28 +0000 |
commit | 36c839a590e227fe2c5508b6bfd325a22f3cfafd (patch) | |
tree | 5c0a3e46a202f5cb99bda7529e80215a7d2cfaea /numpy/lib/utils.py | |
parent | 3655a56c37385ced20042c871a4dcefb21ba971f (diff) | |
download | numpy-36c839a590e227fe2c5508b6bfd325a22f3cfafd.tar.gz |
Add simple get_numarray_include() function and typedefs for completeness
Diffstat (limited to 'numpy/lib/utils.py')
-rw-r--r-- | numpy/lib/utils.py | 18 |
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: |