Skip to content

Commit

Permalink
FEAT: add numpy.linalg.
Browse files Browse the repository at this point in the history
  • Loading branch information
cournape committed Aug 28, 2011
1 parent aa7e9bd commit b6aeed3
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bento.info
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,14 @@ Classifiers:

Recurse:
numpy/core,
numpy/lib
numpy/lib,
numpy/linalg

HookFile:
bscript,
numpy/core/bscript,
numpy/lib/bscript
numpy/lib/bscript,
numpy/linalg/bscript

ExtraSourceFiles:
numpy_templates.py,
Expand Down
10 changes: 10 additions & 0 deletions numpy/linalg/bento.info
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Library:
Extension: lapack_lite
Sources:
blas_lite.c,
dlamch.c,
dlapack_lite.c,
f2c_lite.c,
lapack_litemodule.c,
python_xerbla.c,
zlapack_lite.c
36 changes: 36 additions & 0 deletions numpy/linalg/bscript
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import os

from bento.commands.hooks \
import \
pre_build

@pre_build()
def pbuild(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_lapack_lite(bld, extension):
kw = {}
if not 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:
kw["uselib"] = "LAPACK"

bld(features="c cshlib pyext",
target=extension.name,
source=extension.sources,
includes=includes, **kw)
context.register_builder("lapack_lite", build_lapack_lite)

bld.path = old_path

0 comments on commit b6aeed3

Please sign in to comment.