File tree Expand file tree Collapse file tree 4 files changed +34
-29
lines changed Expand file tree Collapse file tree 4 files changed +34
-29
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,12 @@ import subprocess
18
18
import __builtin__
19
19
__builtin__.__NUMPY_SETUP__ = True
20
20
21
+ import waflib
22
+
23
+ from numpy.distutils.conv_template \
24
+ import \
25
+ process_str as process_c_str
26
+
21
27
from bento.commands import hooks
22
28
from bento.utils.utils \
23
29
import \
@@ -81,3 +87,25 @@ def pre_sdist(context):
81
87
@hooks.options
82
88
def options(global_context):
83
89
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
+
Original file line number Diff line number Diff line change @@ -15,9 +15,6 @@ waflib.Logs.verbose = 1
15
15
# context.
16
16
import numpy.build_utils.waf
17
17
18
- from numpy.distutils.conv_template \
19
- import \
20
- process_str as process_c_str
21
18
from code_generators.numpy_api \
22
19
import \
23
20
multiarray_api, ufunc_api
@@ -325,25 +322,6 @@ def post_configure(context):
325
322
# FIXME: Should be handled in bento context
326
323
conf.store()
327
324
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
-
347
325
class numpy_api_generator(Task):
348
326
vars = ["API_TUPLE"]
349
327
color = "BLUE"
Original file line number Diff line number Diff line change 1
1
HookFile: bscript
2
2
3
3
Library:
4
- Extension: umath_linalg
4
+ Extension: _umath_linalg
5
5
Sources:
6
6
umath_linalg.c.src,
7
7
lapack_lite/blas_lite.c,
Original file line number Diff line number Diff line change 1
- import os
2
-
3
1
from bento.commands.hooks \
4
2
import \
5
3
pre_build
@@ -10,18 +8,19 @@ def pbuild(context):
10
8
11
9
def build_lapack_lite(extension):
12
10
kw = {}
13
- kw["uselib "] = "npymath"
11
+ kw["use "] = "npymath"
14
12
if bld.env.HAS_LAPACK:
15
13
for s in ['python_xerbla.c', 'zlapack_lite.c', 'dlapack_lite.c',
16
14
'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"
19
17
20
18
includes = ["../core/include", "../core/include/numpy", "../core",
21
19
"../core/src/private"]
22
20
return context.default_builder(extension,
23
21
includes=includes,
24
22
**kw)
23
+
25
24
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)
27
26
You can’t perform that action at this time.
0 commit comments