[Scipy-svn] r3580 - branches/scipy.scons/scipy/optimize

scipy-svn@scip... scipy-svn@scip...
Sat Nov 24 04:37:51 CST 2007


Author: cdavid
Date: 2007-11-24 04:37:35 -0600 (Sat, 24 Nov 2007)
New Revision: 3580

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

Copied: branches/scipy.scons/scipy/optimize/SConstruct (from rev 3579, branches/scipy.scons/scipy/odr/SConstruct)
===================================================================
--- branches/scipy.scons/scipy/odr/SConstruct	2007-11-24 09:45:36 UTC (rev 3579)
+++ branches/scipy.scons/scipy/optimize/SConstruct	2007-11-24 10:37:35 UTC (rev 3580)
@@ -0,0 +1,83 @@
+# Last Change: Sat Nov 24 07:00 PM 2007 J
+# vim:syntax=python
+
+import os
+from os.path import join as pjoin, splitext
+import glob
+
+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 CheckF77LAPACK
+
+from numpy.distutils.scons.configuration import write_info
+
+env = GetNumpyEnvironment(ARGUMENTS)
+env.Append(CPPPATH = get_numpy_include_dirs())
+env.Append(CPPPATH = env['F2PYINCLUDEDIR'])
+#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 = {'CheckLAPACK' : CheckF77LAPACK})
+
+#-----------------
+# Checking Lapack
+#-----------------
+st = config.CheckLAPACK()
+if not st:
+    has_lapack = 0
+else:
+    has_lapack = 1
+
+config.Finish()
+write_info(env)
+
+#==========
+#  Build
+#==========
+
+# minpack lib
+minpack_src = glob.glob(pjoin('minpack', '*.f'))
+env.NumpyStaticExtLibrary('minpack', source = minpack_src)
+
+# rootfind lib
+rootfind_src = glob.glob(pjoin('Zeros', '*.c'))
+env.NumpyStaticExtLibrary('rootfind', source = rootfind_src)
+
+env.AppendUnique(LIBS = ['minpack', 'rootfind'])
+env.AppendUnique(LIBPATH = env['build_dir'])
+
+# _minpack pyextension
+env.NumpyPythonExtension('_minpack', '_minpackmodule.c')
+
+# _zeros pyextension
+env.NumpyPythonExtension('_zeros', 'zeros.c')
+
+# _lbfgsb pyextension
+src = pjoin('lbfgsb', 'routines.f')
+lbfgsb_src = env.F2py(pjoin(env['build_dir'], '_lbfgsbmodule.c'), 
+                      pjoin(env['build_dir'], 'lbfgsb', 'lbfgsb.pyf'))
+env.NumpyPythonExtension('_lbfgsb', source = [src] + lbfgsb_src)
+
+# _cobyla pyextension
+src = [pjoin('cobyla', i) for i in ['cobyla2.f', 'trstlp.f']]
+wrap_src = env.F2py(pjoin(env['build_dir'], 'cobyla', '_cobylamodule.c'), 
+                    pjoin(env['build_dir'], 'cobyla', 'cobyla.pyf'))
+env.NumpyPythonExtension('_cobyla', source = src + wrap_src)
+
+# _minpack2 pyextension
+src = [pjoin('minpack2', i) for i in ['dcsrch.f', 'dcstep.f']]
+wrap_src = env.F2py(pjoin(env['build_dir'], 'minpack2', 'minpack2module.c'), 
+                    pjoin(env['build_dir'], 'minpack2', 'minpack2.pyf'))
+env.NumpyPythonExtension('minpack2', source = src + wrap_src)
+
+# moduleTNC pyextension
+env.NumpyPythonExtension('moduleTNC', 
+                         source = [pjoin('tnc', i) for i in \
+                                                   ['moduleTNC.c', 'tnc.c']])

Copied: branches/scipy.scons/scipy/optimize/setupscons.py (from rev 3567, branches/scipy.scons/scipy/optimize/setup.py)
===================================================================
--- branches/scipy.scons/scipy/optimize/setup.py	2007-11-22 12:38:12 UTC (rev 3567)
+++ branches/scipy.scons/scipy/optimize/setupscons.py	2007-11-24 10:37:35 UTC (rev 3580)
@@ -0,0 +1,16 @@
+#!/usr/bin/env python
+
+from os.path import join
+
+def configuration(parent_package='',top_path=None):
+    from numpy.distutils.misc_util import Configuration
+    from numpy.distutils.system_info import get_info
+    config = Configuration('optimize',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