[Scipy-svn] r3978 - branches/build_with_scons/scipy/odr
scipy-svn@scip...
scipy-svn@scip...
Wed Mar 5 02:11:18 CST 2008
Author: cdavid
Date: 2008-03-05 02:11:09 -0600 (Wed, 05 Mar 2008)
New Revision: 3978
Added:
branches/build_with_scons/scipy/odr/SConstruct
branches/build_with_scons/scipy/odr/setupscons.py
Log:
odr now builds with numscons.
Added: branches/build_with_scons/scipy/odr/SConstruct
===================================================================
--- branches/build_with_scons/scipy/odr/SConstruct 2008-03-05 08:05:39 UTC (rev 3977)
+++ branches/build_with_scons/scipy/odr/SConstruct 2008-03-05 08:11:09 UTC (rev 3978)
@@ -0,0 +1,61 @@
+# Last Change: Wed Mar 05 04:00 PM 2008 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 numscons import get_python_inc#, get_pythonlib_dir
+from numscons import GetNumpyEnvironment
+from numscons import CheckF77BLAS, CheckF77Clib
+
+from numscons 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,
+ 'CheckF77Clib' : CheckF77Clib})
+
+if not config.CheckF77Clib():
+ raise RuntimeError("Could not check F/C runtime library for %s/%s, " \
+ "contact the maintainer" % (env['CC'], env['F77']))
+
+#--------------
+# 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('odrpack', source = libodr_src)
+env.AppendUnique(LIBS = 'odrpack')
+env.AppendUnique(LIBPATH = env['build_dir'])
+
+# odr pyextension
+env.NumpyPythonExtension('__odrpack', '__odrpack.c',
+ LINKFLAGSEND = env['F77_LDFLAGS'])
Copied: branches/build_with_scons/scipy/odr/setupscons.py (from rev 3975, branches/build_with_scons/scipy/odr/setup.py)
===================================================================
--- branches/build_with_scons/scipy/odr/setup.py 2008-03-05 07:28:08 UTC (rev 3975)
+++ branches/build_with_scons/scipy/odr/setupscons.py 2008-03-05 08:11:09 UTC (rev 3978)
@@ -0,0 +1,17 @@
+#!/usr/bin/env python
+
+from os.path import join
+
+def configuration(parent_package='', top_path=None):
+ from numpy.distutils.misc_util import Configuration
+
+ 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