[Numpy-svn] r4276 - in branches/numpy.scons/numpy: core distutils/scons

numpy-svn@scip... numpy-svn@scip...
Wed Oct 24 00:46:16 CDT 2007


Author: cdavid
Date: 2007-10-24 00:46:03 -0500 (Wed, 24 Oct 2007)
New Revision: 4276

Modified:
   branches/numpy.scons/numpy/core/SConstruct
   branches/numpy.scons/numpy/distutils/scons/custom_checkers.py
   branches/numpy.scons/numpy/distutils/scons/libinfo_scons.py
Log:
Cblas detection for numpy.core

Modified: branches/numpy.scons/numpy/core/SConstruct
===================================================================
--- branches/numpy.scons/numpy/core/SConstruct	2007-10-24 05:20:02 UTC (rev 4275)
+++ branches/numpy.scons/numpy/core/SConstruct	2007-10-24 05:46:03 UTC (rev 4276)
@@ -7,6 +7,7 @@
 
 from numpy.distutils.scons import get_python_inc, get_pythonlib_dir
 from numpy.distutils.scons import GetNumpyEnvironment
+from numpy.distutils.scons import NumpyCheckLib
 
 from scons_support import CheckBrokenMathlib, define_no_smp, \
     generate_config_header, generate_config_header_emitter, \
@@ -22,7 +23,8 @@
 #=======================
 # XXX: separate env for configuration
 config = env.NumpyConfigure(custom_tests = {'CheckBrokenMathlib' : CheckBrokenMathlib,
-    'CheckMathlib' : CheckMathlib})
+    'CheckMathlib' : CheckMathlib, 
+    'NumpyCheckLib' : NumpyCheckLib})
 
 # Convention: list of tuples (definition, value). value:
 # - 0: #undef definition
@@ -130,10 +132,13 @@
     print 'BUILD_ARCHITECTURE: %r, os.name=%r, sys.platform=%r' % (a, os.name, sys.platform)
     if a == 'AMD64':
         moredefs.append(('DISTUTILS_USE_SDK', 1))
+
 #--------------
 # Checking Blas
 #--------------
 # TODO
+config.NumpyCheckLib(libs = ['cblas'], symbols = ['cblas_dgemm'])
+config.NumpyCheckLib(libs = ['blas'], symbols = ['cblas_dgemm'])
 
 config.Finish()
 

Modified: branches/numpy.scons/numpy/distutils/scons/custom_checkers.py
===================================================================
--- branches/numpy.scons/numpy/distutils/scons/custom_checkers.py	2007-10-24 05:20:02 UTC (rev 4275)
+++ branches/numpy.scons/numpy/distutils/scons/custom_checkers.py	2007-10-24 05:46:03 UTC (rev 4276)
@@ -0,0 +1,4 @@
+from libinfo_scons import NumpyCheckLib
+
+def NumpyCheckCBlas(context, libs):
+    pass

Modified: branches/numpy.scons/numpy/distutils/scons/libinfo_scons.py
===================================================================
--- branches/numpy.scons/numpy/distutils/scons/libinfo_scons.py	2007-10-24 05:20:02 UTC (rev 4275)
+++ branches/numpy.scons/numpy/distutils/scons/libinfo_scons.py	2007-10-24 05:46:03 UTC (rev 4276)
@@ -25,7 +25,7 @@
 }\n """
 
 def _CheckLib(context, libs, symbols, header, language, section, siteconfig, 
-              libpath, cpppath):
+              libpath, cpppath, verbose):
     """Implementation for checking a list of symbols, with libs.
     
     Assumes that libs, symbol, header, libpath and cpppath are sequences (list
@@ -92,7 +92,7 @@
 
 
 def NumpyCheckLib(context, libs, symbols = None, header = None, 
-                  language = None, section = None, siteconfig = None, name = None):
+                  language = None, section = None, siteconfig = None, name = None, verbose = None):
     """Check for symbol in libs. 
     
     This is the general purpose replacement for numpy.distutils.system_info. It
@@ -119,7 +119,8 @@
     #+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     env = context.env
 
-    # XXX: would be nice for each extension to add an option to command line.
+    # XXX: would be nice for each extension to add an option to
+    # command line.
     # XXX: handle env var
     # XXX: handle language
     if language:
@@ -145,13 +146,14 @@
     libpath = None
     cpppath = None
     res = _CheckLib(context, libs, symbols, header, language, section,
-                    siteconfig, libpath, cpppath, )
+                    siteconfig, libpath, cpppath, verbose)
     context.Result(res)
     return res
 
 def _check_lib_section(context, siteconfig, section, src, libs, libpath, cpppath):
-    # Convention: if an option is found in site.cfg for the given section, it
-    # takes precedence on the arguments libs, libpath, cpppath.
+    # Convention: if an option is found in site.cfg for the given
+    # section, it takes precedence on the arguments libs, libpath,
+    # cpppath.
     res = 1
     try:
         newLIBPATH = get_paths(siteconfig.get(section, 'library_dirs'))



More information about the Numpy-svn mailing list