Skip to content

Commit 3d431ab

Browse files
author
Ralf Gommers
committed
BLD: fix Bento build after umath_linalg move from core to linalg module.
1 parent 004ce27 commit 3d431ab

File tree

4 files changed

+34
-29
lines changed

4 files changed

+34
-29
lines changed

bscript

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ import subprocess
1818
import __builtin__
1919
__builtin__.__NUMPY_SETUP__ = True
2020

21+
import waflib
22+
23+
from numpy.distutils.conv_template \
24+
import \
25+
process_str as process_c_str
26+
2127
from bento.commands import hooks
2228
from bento.utils.utils \
2329
import \
@@ -81,3 +87,25 @@ def pre_sdist(context):
8187
@hooks.options
8288
def options(global_context):
8389
blas_lapack.add_options(global_context)
90+
91+
92+
class CTemplateTask(waflib.Task.Task):
93+
color = 'BLUE'
94+
before = ['c']
95+
def run(self):
96+
s = self.inputs[0]
97+
cnt = s.read()
98+
writestr = process_c_str(cnt)
99+
o = self.outputs[0]
100+
o.write(writestr)
101+
102+
@waflib.TaskGen.extension(".src")
103+
def c_template(self, node):
104+
outs = []
105+
outs.append(node.change_ext(""))
106+
107+
tsk = self.create_task('CTemplateTask', node, outs)
108+
if "c" in self.features:
109+
self.source.append(outs[0])
110+
111+

numpy/core/bscript

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@ waflib.Logs.verbose = 1
1515
# context.
1616
import numpy.build_utils.waf
1717

18-
from numpy.distutils.conv_template \
19-
import \
20-
process_str as process_c_str
2118
from code_generators.numpy_api \
2219
import \
2320
multiarray_api, ufunc_api
@@ -325,25 +322,6 @@ def post_configure(context):
325322
# FIXME: Should be handled in bento context
326323
conf.store()
327324

328-
class CTemplateTask(waflib.Task.Task):
329-
color = 'BLUE'
330-
before = ['c']
331-
def run(self):
332-
s = self.inputs[0]
333-
cnt = s.read()
334-
writestr = process_c_str(cnt)
335-
o = self.outputs[0]
336-
o.write(writestr)
337-
338-
@waflib.TaskGen.extension(".src")
339-
def c_template(self, node):
340-
outs = []
341-
outs.append(node.change_ext(""))
342-
343-
tsk = self.create_task('CTemplateTask', node, outs)
344-
if "c" in self.features:
345-
self.source.append(outs[0])
346-
347325
class numpy_api_generator(Task):
348326
vars = ["API_TUPLE"]
349327
color = "BLUE"

numpy/linalg/bento.info

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
HookFile: bscript
22

33
Library:
4-
Extension: umath_linalg
4+
Extension: _umath_linalg
55
Sources:
66
umath_linalg.c.src,
77
lapack_lite/blas_lite.c,

numpy/linalg/bscript

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import os
2-
31
from bento.commands.hooks \
42
import \
53
pre_build
@@ -10,18 +8,19 @@ def pbuild(context):
108

119
def build_lapack_lite(extension):
1210
kw = {}
13-
kw["uselib"] = "npymath"
11+
kw["use"] = "npymath"
1412
if bld.env.HAS_LAPACK:
1513
for s in ['python_xerbla.c', 'zlapack_lite.c', 'dlapack_lite.c',
1614
'blas_lite.c', 'dlamch.c', 'f2c_lite.c']:
17-
extension.sources.pop(extension.sources.index(s))
18-
kw["uselib"] = "npymath LAPACK"
15+
extension.sources.pop(extension.sources.index('lapack_lite/' + s))
16+
kw["use"] = "npymath LAPACK"
1917

2018
includes = ["../core/include", "../core/include/numpy", "../core",
2119
"../core/src/private"]
2220
return context.default_builder(extension,
2321
includes=includes,
2422
**kw)
23+
2524
context.register_builder("lapack_lite", build_lapack_lite)
26-
context.register_builder("umath_linalg", build_lapack_lite)
25+
context.register_builder("_umath_linalg", build_lapack_lite)
2726

0 commit comments

Comments
 (0)