[Scipy-svn] r3576 - branches/scipy.scons/scipy/lib/blas

scipy-svn@scip... scipy-svn@scip...
Sat Nov 24 02:08:19 CST 2007


Author: cdavid
Date: 2007-11-24 02:05:42 -0600 (Sat, 24 Nov 2007)
New Revision: 3576

Added:
   branches/scipy.scons/scipy/lib/blas/scons_support.py
Modified:
   branches/scipy.scons/scipy/lib/blas/SConstruct
Log:
Handle missing cblas in scipy/lib/blas scons build

Modified: branches/scipy.scons/scipy/lib/blas/SConstruct
===================================================================
--- branches/scipy.scons/scipy/lib/blas/SConstruct	2007-11-24 07:49:23 UTC (rev 3575)
+++ branches/scipy.scons/scipy/lib/blas/SConstruct	2007-11-24 08:05:42 UTC (rev 3576)
@@ -13,6 +13,8 @@
 
 from numpy.distutils.scons.configuration import write_info
 
+from scons_support import do_generate_fake_interface, generate_interface_emitter
+
 env = GetNumpyEnvironment(ARGUMENTS)
 env.Append(CPPPATH = [get_python_inc(), get_numpy_include_dirs()])
 #if os.name == 'nt':
@@ -21,6 +23,9 @@
 #    # checks
 #    env.AppendUnique(LIBPATH = [get_pythonlib_dir()])
 
+env['BUILDERS']['GenerateFakePyf'] = Builder(action = do_generate_fake_interface,
+                                             emitter = generate_interface_emitter)
+
 #=======================
 # Starting Configuration
 #=======================
@@ -74,8 +79,6 @@
 source = ['cblas.pyf']
 if has_cblas:
     env.NumpyFromFTemplate('cblas.pyf', 'cblas.pyf.src')
+else:
+    print env.GenerateFakePyf('cblas', 'cblas.pyf.src')
 env.NumpyPythonExtension('cblas', source)
-#     env.haha('cblas', 'generic_cblas.pyf')
-# else:
-#     env.hihi('cblas', 'generic_cblas.pyf')
-# env.NumpyPythonExtension('cblas', source = 'cblas.pyf')

Copied: branches/scipy.scons/scipy/lib/blas/scons_support.py (from rev 3567, branches/scipy.scons/scipy/linalg/scons_support.py)
===================================================================
--- branches/scipy.scons/scipy/linalg/scons_support.py	2007-11-22 12:38:12 UTC (rev 3567)
+++ branches/scipy.scons/scipy/lib/blas/scons_support.py	2007-11-24 08:05:42 UTC (rev 3576)
@@ -0,0 +1,30 @@
+from os.path import join as pjoin, splitext, basename as pbasename
+
+def generate_interface_emitter(target, source, env):
+    source = [pjoin(env['build_dir'], str(i)) for i in source]
+    target = [pjoin(env['build_dir'], str(i)) for i in target]
+    base = str(target[0])
+    return (['%s.pyf' % base], source)
+
+def do_generate_fake_interface(target, source, env):
+    """Generate a (fake) .pyf file from another pyf file (!)."""
+    # XXX: do this correctly
+    target_name = str(target[0])
+    source_name = str(source[0])
+
+    # XXX handle skip names
+    name = splitext(pbasename(target_name))[0]
+    #generate_interface(name, source_name, target_name)
+        
+    f = open(target_name, 'w')
+    f.write('python module '+name+'\n')
+    f.write('usercode void empty_module(void) {}\n')
+    f.write('interface\n')
+    f.write('subroutine empty_module()\n')
+    f.write('intent(c) empty_module\n')
+    f.write('end subroutine empty_module\n')
+    f.write('end interface\nend python module'+name+'\n')
+    f.close()
+
+    return 0
+



More information about the Scipy-svn mailing list