Skip to content

Commit

Permalink
BLD: fix Bento build after umath_linalg move from core to linalg module.
Browse files Browse the repository at this point in the history
  • Loading branch information
rgommers committed May 4, 2013
1 parent 004ce27 commit 3d431ab
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 29 deletions.
28 changes: 28 additions & 0 deletions bscript
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ import subprocess
import __builtin__
__builtin__.__NUMPY_SETUP__ = True

import waflib

from numpy.distutils.conv_template \
import \
process_str as process_c_str

from bento.commands import hooks
from bento.utils.utils \
import \
Expand Down Expand Up @@ -81,3 +87,25 @@ def pre_sdist(context):
@hooks.options
def options(global_context):
blas_lapack.add_options(global_context)


class CTemplateTask(waflib.Task.Task):
color = 'BLUE'
before = ['c']
def run(self):
s = self.inputs[0]
cnt = s.read()
writestr = process_c_str(cnt)
o = self.outputs[0]
o.write(writestr)

@waflib.TaskGen.extension(".src")
def c_template(self, node):
outs = []
outs.append(node.change_ext(""))

tsk = self.create_task('CTemplateTask', node, outs)
if "c" in self.features:
self.source.append(outs[0])


22 changes: 0 additions & 22 deletions numpy/core/bscript
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ waflib.Logs.verbose = 1
# context.
import numpy.build_utils.waf

from numpy.distutils.conv_template \
import \
process_str as process_c_str
from code_generators.numpy_api \
import \
multiarray_api, ufunc_api
Expand Down Expand Up @@ -325,25 +322,6 @@ def post_configure(context):
# FIXME: Should be handled in bento context
conf.store()

class CTemplateTask(waflib.Task.Task):
color = 'BLUE'
before = ['c']
def run(self):
s = self.inputs[0]
cnt = s.read()
writestr = process_c_str(cnt)
o = self.outputs[0]
o.write(writestr)

@waflib.TaskGen.extension(".src")
def c_template(self, node):
outs = []
outs.append(node.change_ext(""))

tsk = self.create_task('CTemplateTask', node, outs)
if "c" in self.features:
self.source.append(outs[0])

class numpy_api_generator(Task):
vars = ["API_TUPLE"]
color = "BLUE"
Expand Down
2 changes: 1 addition & 1 deletion numpy/linalg/bento.info
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
HookFile: bscript

Library:
Extension: umath_linalg
Extension: _umath_linalg
Sources:
umath_linalg.c.src,
lapack_lite/blas_lite.c,
Expand Down
11 changes: 5 additions & 6 deletions numpy/linalg/bscript
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import os

from bento.commands.hooks \
import \
pre_build
Expand All @@ -10,18 +8,19 @@ def pbuild(context):

def build_lapack_lite(extension):
kw = {}
kw["uselib"] = "npymath"
kw["use"] = "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"
extension.sources.pop(extension.sources.index('lapack_lite/' + s))
kw["use"] = "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)
context.register_builder("_umath_linalg", build_lapack_lite)

0 comments on commit 3d431ab

Please sign in to comment.