diff options
author | David Cournapeau <cournape@gmail.com> | 2011-03-15 13:23:26 -0400 |
---|---|---|
committer | David Cournapeau <cournape@gmail.com> | 2011-08-29 00:32:23 +0200 |
commit | 69af3d08e8a8cbaf35277c4b718237bf3f1a89c1 (patch) | |
tree | 5e858a243b2c4c0b47f300d0b1b611f3a6c6ef27 | |
parent | b6aeed33b7d24449d51fdece5a142b939d2743ed (diff) | |
download | numpy-69af3d08e8a8cbaf35277c4b718237bf3f1a89c1.tar.gz |
ENH: add fft/random support.
-rw-r--r-- | bento.info | 8 | ||||
-rw-r--r-- | numpy/fft/bento.info | 4 | ||||
-rw-r--r-- | numpy/fft/bscript | 28 | ||||
-rw-r--r-- | numpy/linalg/bscript | 5 | ||||
-rw-r--r-- | numpy/random/bento.info | 7 | ||||
-rw-r--r-- | numpy/random/bscript | 32 |
6 files changed, 79 insertions, 5 deletions
diff --git a/bento.info b/bento.info index f38664cd8..862f445c4 100644 --- a/bento.info +++ b/bento.info @@ -36,14 +36,18 @@ Classifiers: Recurse: numpy/core, + numpy/fft, numpy/lib, - numpy/linalg + numpy/linalg, + numpy/random HookFile: bscript, numpy/core/bscript, + numpy/fft/bscript, numpy/lib/bscript, - numpy/linalg/bscript + numpy/linalg/bscript, + numpy/random/bscript ExtraSourceFiles: numpy_templates.py, diff --git a/numpy/fft/bento.info b/numpy/fft/bento.info new file mode 100644 index 000000000..23ef8e84b --- /dev/null +++ b/numpy/fft/bento.info @@ -0,0 +1,4 @@ +Library: + Extension: fftpack_lite + Sources: + fftpack_litemodule.c, fftpack.c diff --git a/numpy/fft/bscript b/numpy/fft/bscript new file mode 100644 index 000000000..a0d969e02 --- /dev/null +++ b/numpy/fft/bscript @@ -0,0 +1,28 @@ +import os + +from bento.commands.hooks \ + import \ + pre_build + +@pre_build() +def build(context): + bld = context.waf_context + old_path = bld.path + bld.path = old_path.find_dir(context.local_node.path_from(context.top_node)) + assert bld.path.__class__ == old_path.__class__ + + # FIXME: there has to be a better way to refer to numpy/core include + includes = [ + os.path.join(bld.srcnode.path_from(bld.path), "numpy/core"), + os.path.join(bld.srcnode.path_from(bld.path), "numpy/core/include"), + os.path.join(bld.srcnode.path_from(bld.path), "numpy/core/include/numpy"), + os.path.join(bld.srcnode.path_from(bld.path), "numpy/core/src/private")] + + def build(bld, extension): + bld(features="c cshlib pyext", + target=extension.name, + source=extension.sources, + includes=includes) + context.register_builder("fftpack_lite", build) + + bld.path = old_path diff --git a/numpy/linalg/bscript b/numpy/linalg/bscript index 97c3eaec7..ade32a932 100644 --- a/numpy/linalg/bscript +++ b/numpy/linalg/bscript @@ -20,11 +20,10 @@ def pbuild(context): def build_lapack_lite(bld, extension): kw = {} - if not bld.env.HAS_LAPACK: + if bld.env.HAS_LAPACK: for s in ['python_xerbla.c', 'zlapack_lite.c', 'dlapack_lite.c', 'blas_lite.c', 'dlamch.c', 'f2c_lite.c']: - extension.sources.pop(s) - else: + extension.sources.pop(extension.sources.index(s)) kw["uselib"] = "LAPACK" bld(features="c cshlib pyext", diff --git a/numpy/random/bento.info b/numpy/random/bento.info new file mode 100644 index 000000000..37e651fa5 --- /dev/null +++ b/numpy/random/bento.info @@ -0,0 +1,7 @@ +Library: + Extension: mtrand + Sources: + mtrand/mtrand.c, + mtrand/randomkit.c, + mtrand/initarray.c, + mtrand/distributions.c diff --git a/numpy/random/bscript b/numpy/random/bscript new file mode 100644 index 000000000..3c0d2990b --- /dev/null +++ b/numpy/random/bscript @@ -0,0 +1,32 @@ +import os + +from bento.commands.hooks \ + import \ + pre_build + +@pre_build() +def build(context): + bld = context.waf_context + old_path = bld.path + bld.path = old_path.find_dir(context.local_node.path_from(context.top_node)) + assert bld.path.__class__ == old_path.__class__ + + + if os.name == 'nt': + raise NotImplementedError("Check for wincrypt stuff") + raise NotImplementedError("Check for mingw time workaround stuff") + + includes = [ + os.path.join(bld.srcnode.path_from(bld.path), "numpy/core"), + os.path.join(bld.srcnode.path_from(bld.path), "numpy/core/include"), + os.path.join(bld.srcnode.path_from(bld.path), "numpy/core/include/numpy"), + os.path.join(bld.srcnode.path_from(bld.path), "numpy/core/src/private")] + + def builder(bld, extension): + bld(features="c cshlib pyext", + target=extension.name, + source=extension.sources, + includes=includes) + context.register_builder("mtrand", builder) + + bld.path = old_path |