Permalink
Browse files

ENH: scipy.lib is implemented.

  • Loading branch information...
1 parent 513d050 commit 06ef74c4d656428a03e6088c84c57a777a3a4b2a @cournape cournape committed Jun 10, 2011
Showing with 305 additions and 115 deletions.
  1. +6 −0 bento.info
  2. +41 −12 bscript
  3. +146 −93 f2py.py
  4. +8 −0 scipy/lib/bento.info
  5. +8 −0 scipy/lib/blas/bento.info
  6. +32 −0 scipy/lib/blas/bscript
  7. +5 −0 scipy/lib/lapack/bento.info
  8. +27 −0 scipy/lib/lapack/bscript
  9. +16 −0 scipy/lib/lapack/dummy_clapack.pyf
  10. +16 −10 scipy/linalg/bscript
View
@@ -36,6 +36,8 @@ Classifiers:
HookFile:
bscript,
scipy/fftpack/bscript,
+ scipy/lib/blas/bscript,
+ scipy/lib/lapack/bscript,
scipy/linalg/bscript,
scipy/optimize/bscript,
scipy/signal/bscript,
@@ -44,6 +46,7 @@ HookFile:
Recurse:
scipy/cluster,
scipy/fftpack,
+ scipy/lib,
scipy/linalg,
scipy/optimize,
scipy/signal,
@@ -56,6 +59,8 @@ DataFiles: tests
constants/tests/*.py,
fftpack/tests/*.py,
fftpack/tests/*.npz,
+ lib/blas/tests/*.py,
+ lib/lapack/tests/*.py,
linalg/tests/*.py,
misc/tests/*.py,
optimize/tests/*.py,
@@ -70,6 +75,7 @@ Library:
scipy.cluster,
scipy.constants,
scipy.fftpack,
+ scipy.lib,
scipy.linalg,
scipy.misc,
scipy.optimize,
View
53 bscript
@@ -1,3 +1,4 @@
+import os
import sys
import os.path as op
@@ -7,6 +8,9 @@ from numpy.distutils.misc_util \
from numpy.distutils.conv_template \
import \
process_str as process_c_str
+from numpy.distutils.from_template \
+ import \
+ process_str as process_f_str, resolve_includes
from bento.commands import hooks
from bento.commands.extras.waf \
@@ -22,23 +26,46 @@ from waflib import Options
# FIXME: add this to numpy so that we can reuse it
class CTemplateTask(waflib.Task.Task):
color = 'BLUE'
- before = ['c']
+ #ext_out = ['.c', '.pyf']
def run(self):
s = self.inputs[0]
cnt = s.read()
writestr = process_c_str(cnt)
o = self.outputs[0]
o.write(writestr)
-@waflib.TaskGen.feature("c_template")
+class FTemplateTask(waflib.Task.Task):
+ color = 'BLUE'
+ ext_out = ['.pyf']
+ def run(self):
+ s = self.inputs[0]
+ lines = resolve_includes(s.abspath())
+ writestr = process_f_str("".join(lines))
+ o = self.outputs[0]
+ o.write(writestr)
+ return 0
+
@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])
+ output_name = node.name.rsplit(".", 1)[0]
+ output = node.parent.find_or_declare(output_name)
+ assert output.is_bld()
+
+ ext = output.name.rsplit(".")[1]
+ if ext in ["f", "pyf", "ipyf"]:
+ tsk = self.create_task('FTemplateTask', node, output)
+ if "fc" in self.features:
+ self.source.append(output)
+ else:
+ raise ValueError("FTemplateTask without feature 'fc' ?")
+ elif ext in ["c"]:
+ tsk = self.create_task('CTemplateTask', node, output)
+ if "c" in self.features:
+ self.source.append(output)
+ else:
+ raise ValueError("FTemplateTask without feature 'c' ?")
+ else:
+ raise ValueError("Unknown extension in templating: %r" % ext)
# FIXME: abstract those module gen tasks...
class write_module(waflib.Task.Task):
@@ -78,11 +105,14 @@ def options(context):
@hooks.pre_configure()
def pre_configure(context):
opts = context.waf_options_context
+ opts.load("compiler_cxx")
opts.load("compiler_fc")
opts.load("f2py")
Options.options.check_fc = "gfortran"
+ Options.options.check_cxx_compiler = "g++"
conf = context.waf_context
+ conf.load("compiler_cxx")
conf.load("compiler_fc")
conf.load("f2py")
@@ -133,17 +163,16 @@ def post_configure(context):
# (cause crashes when importing the extension)
name = "python%s" % ".".join([str(i) for i in sys.version_info[:2]])
remove_flag(name, conf.env.LIB_PYEXT)
- remove_flag("-dynamiclib", conf.env.LINKFLAGS_cshlib)
remove_flag_postvalue("-compatibility_version", conf.env.CFLAGS_cshlib)
remove_flag_postvalue("-current_version", conf.env.CFLAGS_cshlib)
for flag in [conf.env.CFLAGS_PYEXT, conf.env.LINKFLAGS_PYEXT,
conf.env.CXXFLAGS_PYEXT, conf.env.FCFLAGS]:
remove_flag_prevalue("ppc", flag)
- conf.env.LINKFLAGS_cshlib.extend(["-undefined", "dynamic_lookup", "-bundle"])
+ for f in [conf.env.LINKFLAGS_cxxshlib, conf.env.LINKFLAGS_cshlib]:
+ remove_flag("-dynamiclib", f)
+ f.extend(["-undefined", "dynamic_lookup", "-bundle"])
conf.env["MACOSX_DEPLOYMENT_TARGET"] = "10.4"
- conf.env.MACOSX_DEPLOYMENT_TARGET = "10.4"
-
conf.env.HAS_FBLAS = False
conf.env.HAS_CBLAS = False
conf.env.HAS_FLAPACK = False
Oops, something went wrong.

0 comments on commit 06ef74c

Please sign in to comment.