[Scipy-svn] r3579 - branches/scipy.scons/scipy/odr

scipy-svn@scip... scipy-svn@scip...
Sat Nov 24 03:46:17 CST 2007


Author: cdavid
Date: 2007-11-24 03:45:36 -0600 (Sat, 24 Nov 2007)
New Revision: 3579

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

Copied: branches/scipy.scons/scipy/odr/SConstruct (from rev 3576, branches/scipy.scons/scipy/lib/blas/SConstruct)
===================================================================
--- branches/scipy.scons/scipy/lib/blas/SConstruct	2007-11-24 08:05:42 UTC (rev 3576)
+++ branches/scipy.scons/scipy/odr/SConstruct	2007-11-24 09:45:36 UTC (rev 3579)
@@ -0,0 +1,55 @@
+# Last Change: Sat Nov 24 06:00 PM 2007 J
+# vim:syntax=python
+
+import os
+from os.path import join as pjoin, splitext
+
+from numpy.distutils.misc_util import get_numpy_include_dirs
+from numpy.distutils.scons import get_python_inc#, get_pythonlib_dir
+from numpy.distutils.scons import GetNumpyEnvironment
+from numpy.distutils.scons import CheckF77BLAS
+
+from numpy.distutils.scons.configuration import write_info
+
+env = GetNumpyEnvironment(ARGUMENTS)
+env.Append(CPPPATH = [get_python_inc(), get_numpy_include_dirs()])
+#if os.name == 'nt':
+#    # NT needs the pythonlib to run any code importing Python.h, including
+#    # simple code using only typedef and so on, so we need it for configuration
+#    # checks
+#    env.AppendUnique(LIBPATH = [get_pythonlib_dir()])
+
+#=======================
+# Starting Configuration
+#=======================
+config = env.NumpyConfigure(custom_tests = {'CheckBLAS' : CheckF77BLAS})
+
+#--------------
+# Checking Blas
+#--------------
+st = config.CheckBLAS()
+if not st:
+    has_blas = 0
+else:
+    has_blas = 1
+
+config.Finish()
+write_info(env)
+
+#==========
+#  Build
+#==========
+
+# odr lib
+libodr_src = [pjoin('odrpack', i) for i in ['d_odr.f', 'd_mprec.f', 'dlunoc.f']]
+if has_blas:
+    libodr_src.append(pjoin('odrpack', 'd_lpk.f'))
+else:
+    libodr_src.append(pjoin('odrpack', 'd_lpkbls.f'))
+
+env.NumpyStaticExtLibrary('odr', source = libodr_src)
+env.AppendUnique(LIBS = 'odr')
+env.AppendUnique(LIBPATH = env['build_dir'])
+
+# odr pyextension
+env.NumpyPythonExtension('__odrpack', '__odrpack.c')

Copied: branches/scipy.scons/scipy/odr/setupscons.py (from rev 3567, branches/scipy.scons/scipy/odr/setup.py)
===================================================================
--- branches/scipy.scons/scipy/odr/setup.py	2007-11-22 12:38:12 UTC (rev 3567)
+++ branches/scipy.scons/scipy/odr/setupscons.py	2007-11-24 09:45:36 UTC (rev 3579)
@@ -0,0 +1,17 @@
+#!/usr/bin/env python
+
+from os.path import join
+
+def configuration(parent_package='', top_path=None):
+    import warnings
+    from numpy.distutils.misc_util import Configuration
+    from numpy.distutils.system_info import get_info, BlasNotFoundError
+    config = Configuration('odr', parent_package, top_path)
+
+    config.add_sconscript('SConstruct')
+    config.add_data_dir('tests')
+    return config
+
+if __name__ == '__main__':
+    from numpy.distutils.core import setup
+    setup(**configuration(top_path='').todict())



More information about the Scipy-svn mailing list