summaryrefslogtreecommitdiff
path: root/numpy/linalg/bscript
blob: dc275f08592e02aa7eb3bdb37b0b864a1d720db3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import os

from bento.commands.hooks \
    import \
        pre_build

@pre_build
def pbuild(context):
    bld = context.waf_context

    def build_lapack_lite(extension):
        kw = {}
        kw["uselib"] = "npymath"
        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(extension.sources.index(s))
            kw["uselib"] = "npymath LAPACK"

        includes = ["../core/include", "../core/include/numpy", "../core",
                    "../core/src/private"]
        return context.default_builder(extension,
                                       includes=includes,
                                       **kw)
    context.register_builder("lapack_lite", build_lapack_lite)
    context.register_builder("umath_linalg", build_lapack_lite)