[Scipy-svn] r3584 - branches/scipy.scons/scipy/sparse

scipy-svn@scip... scipy-svn@scip...
Sat Nov 24 05:07:09 CST 2007


Author: cdavid
Date: 2007-11-24 05:06:35 -0600 (Sat, 24 Nov 2007)
New Revision: 3584

Added:
   branches/scipy.scons/scipy/sparse/SConstruct
   branches/scipy.scons/scipy/sparse/setupscons.py
Log:
Sparse now builds with scons

Copied: branches/scipy.scons/scipy/sparse/SConstruct (from rev 3582, branches/scipy.scons/scipy/cluster/SConstruct)
===================================================================
--- branches/scipy.scons/scipy/cluster/SConstruct	2007-11-24 10:49:51 UTC (rev 3582)
+++ branches/scipy.scons/scipy/sparse/SConstruct	2007-11-24 11:06:35 UTC (rev 3584)
@@ -0,0 +1,18 @@
+# Last Change: Sat Nov 24 07:00 PM 2007 J
+# vim:syntax=python
+from os.path import join
+
+from numpy.distutils.misc_util import get_numpy_include_dirs
+from numpy.distutils.scons import GetNumpyEnvironment
+
+env = GetNumpyEnvironment(ARGUMENTS)
+
+env.AppendUnique(CPPPATH = get_numpy_include_dirs())
+
+env.NumpyPythonExtension('_sparsetools', 
+                         source = [join('sparsetools', 'sparsetools_wrap.cxx')])
+
+# Copy this python file into the distutils lib dir
+env.Command(join(env['distutils_installdir'], 'sparsetools.py'),
+            join('sparsetools', 'sparsetools.py'),
+            Copy('$TARGET', '$SOURCE'))

Copied: branches/scipy.scons/scipy/sparse/setupscons.py (from rev 3582, branches/scipy.scons/scipy/sparse/setup.py)
===================================================================
--- branches/scipy.scons/scipy/sparse/setup.py	2007-11-24 10:49:51 UTC (rev 3582)
+++ branches/scipy.scons/scipy/sparse/setupscons.py	2007-11-24 11:06:35 UTC (rev 3584)
@@ -0,0 +1,29 @@
+#!/usr/bin/env python
+
+from os.path import join
+import sys
+
+def configuration(parent_package='',top_path=None):
+    import numpy
+    from numpy.distutils.misc_util import Configuration
+
+    config = Configuration('sparse',parent_package,top_path)
+
+    config.add_sconscript('SConstruct')
+    config.add_data_dir('tests')
+
+##     sparsetools_i_file = config.paths(join('sparsetools','sparsetools.i'))[0]
+##     def sparsetools_i(ext, build_dir):
+##             return sparsetools_i_file
+##     config.add_extension('_sparsetools',
+##                          sources= [sparsetools_i_file],
+##                          include_dirs=['sparsetools'],
+##                          depends = [join('sparsetools', x) for x in
+##                                     ['sparsetools.i', 'sparsetools.h']]
+##                          )
+
+    return config
+
+if __name__ == '__main__':
+    from numpy.distutils.core import setup
+    setup(**configuration(top_path='').todict())



More information about the Scipy-svn mailing list