[Numpy-svn] r4300 - in branches/numpy.scons/numpy: core distutils/scons scons_fake/checkers

numpy-svn at scipy.org numpy-svn at scipy.org
Fri Oct 26 01:46:29 EDT 2007


Author: cdavid
Date: 2007-10-26 00:46:19 -0500 (Fri, 26 Oct 2007)
New Revision: 4300

Modified:
   branches/numpy.scons/numpy/core/SConstruct
   branches/numpy.scons/numpy/distutils/scons/__init__.py
   branches/numpy.scons/numpy/distutils/scons/custom_checkers.py
   branches/numpy.scons/numpy/scons_fake/checkers/SConstruct
Log:
Add veclib check for cblas check on darwin; small fixes.

Modified: branches/numpy.scons/numpy/core/SConstruct
===================================================================
--- branches/numpy.scons/numpy/core/SConstruct	2007-10-26 04:53:31 UTC (rev 4299)
+++ branches/numpy.scons/numpy/core/SConstruct	2007-10-26 05:46:19 UTC (rev 4300)
@@ -1,4 +1,4 @@
-# Last Change: Fri Oct 26 11:00 AM 2007 J
+# Last Change: Fri Oct 26 02:00 PM 2007 J
 # vim:syntax=python
 import os
 import sys
@@ -146,11 +146,11 @@
     build_blasdot = 0
 
 config.Finish()
-config_f = open('config.log', 'r')
-print "++++++++++ config.log dump ++++++++++++++++++"
-for i in config_f:
-    print i.strip('\n')
-print "+++++++++++++++++++++++++++++++++++++++++++++"
+#config_f = open('config.log', 'r')
+#print "++++++++++ config.log dump ++++++++++++++++++"
+#for i in config_f:
+#    print i.strip('\n')
+#print "+++++++++++++++++++++++++++++++++++++++++++++"
 
 #==========
 #  Build

Modified: branches/numpy.scons/numpy/distutils/scons/__init__.py
===================================================================
--- branches/numpy.scons/numpy/distutils/scons/__init__.py	2007-10-26 04:53:31 UTC (rev 4299)
+++ branches/numpy.scons/numpy/distutils/scons/__init__.py	2007-10-26 05:46:19 UTC (rev 4300)
@@ -2,6 +2,6 @@
 from libinfo_scons import NumpyCheckLib
 from libinfo import get_paths as scons_get_paths
 from custom_checkers import CheckMKL, CheckATLAS, CheckCBLAS, \
-        CheckAccelerate, CheckMKL2, CheckSunperf
+        CheckAccelerate, CheckMKL, CheckSunperf
 from extension import get_python_inc, get_pythonlib_dir
 from utils import isstring

Modified: branches/numpy.scons/numpy/distutils/scons/custom_checkers.py
===================================================================
--- branches/numpy.scons/numpy/distutils/scons/custom_checkers.py	2007-10-26 04:53:31 UTC (rev 4299)
+++ branches/numpy.scons/numpy/distutils/scons/custom_checkers.py	2007-10-26 05:46:19 UTC (rev 4300)
@@ -1,5 +1,5 @@
 #! /usr/bin/env python
-# Last Change: Fri Oct 26 11:00 AM 2007 J
+# Last Change: Fri Oct 26 02:00 PM 2007 J
 
 # Module for custom, common checkers for numpy (and scipy)
 import sys
@@ -87,18 +87,18 @@
     context.Result(ret)
     return ret
      
-def CheckMKL(context, mkl_dir, nb):
-    """mkl_lib is the root path of MKL (the one which contains include, lib,
-    etc...). nb is 32, 64, emt, etc..."""
+#def CheckMKL(context, mkl_dir, nb):
+#    """mkl_lib is the root path of MKL (the one which contains include, lib,
+#    etc...). nb is 32, 64, emt, etc..."""
+#
+#    libs = ['mkl']
+#    cpppath = os.path.join(mkl_dir, 'include')
+#    libpath = os.path.join(mkl_dir, 'lib', nb)
+#
+#    return _check_include_and_run(context, 'MKL', cpppath, ['mkl.h'],
+#                                  cblas_src, libs, libpath, [], [], autoadd)
 
-    libs = ['mkl']
-    cpppath = os.path.join(mkl_dir, 'include')
-    libpath = os.path.join(mkl_dir, 'lib', nb)
-
-    return _check_include_and_run(context, 'MKL', cpppath, ['mkl.h'],
-                                  cblas_src, libs, libpath, [], [], autoadd)
-
-def CheckMKL2(context, autoadd = 1):
+def CheckMKL(context, autoadd = 1):
     """Check MKL is usable using a simple cblas example."""
     section = "mkl"
     siteconfig, cfgfiles = get_config()
@@ -118,14 +118,41 @@
                                   cblas_src, libs, libpath, [], [], autoadd)
 
 def CheckAccelerate(context, autoadd = 1):
-    """Checker for Accelerate framework (on Mac OS X >= 10.3)."""
+    """Checker for Accelerate framework (on Mac OS X >= 10.3). Only test from
+    C."""
+    # According to
+    # http://developer.apple.com/hardwaredrivers/ve/vector_libraries.html:
+    #
+    #   This page contains a continually expanding set of vector libraries
+    #   that are available to the AltiVec programmer through the Accelerate
+    #   framework on MacOS X.3, Panther. On earlier versions of MacOS X,
+    #   these were available in vecLib.framework. The currently available
+    #   libraries are described below.
 
+    #XXX: get_platform does not seem to work...
+    #if get_platform()[-4:] == 'i386':
+    #    is_intel = 1
+    #    cflags.append('-msse3')
+    #else:
+    #    is_intel = 0
+    #    cflags.append('-faltivec')
+
+    # XXX: This double append is not good, any other way ?
     linkflags = ['-framework', 'Accelerate']
 
     return _check_include_and_run(context, 'FRAMEWORK: Accelerate', None, 
                                   ['Accelerate/Accelerate.h'], cblas_src, [], 
                                   [], linkflags, [], autoadd)
 
+def CheckVeclib(context, autoadd = 1):
+    """Checker for Veclib framework (on Mac OS X < 10.3)."""
+    # XXX: This double append is not good, any other way ?
+    linkflags = ['-framework', 'vecLib']
+
+    return _check_include_and_run(context, 'FRAMEWORK: veclib', None, 
+                                  ['vecLib/vecLib.h'], cblas_src, [], 
+                                  [], linkflags, [], autoadd)
+
 def CheckSunperf(context, autoadd = 1):
     """Checker for sunperf using a simple sunperf example"""
 
@@ -147,37 +174,23 @@
         headers = ['cblas.h']
         linkflags = []
         cflags = []
+        return _check_include_and_run(context, 'CBLAS', [], headers, cblas_src,
+                                      libs, libpath, linkflags, cflags, autoadd)
     else:
-        cflags = []
-        linkflags = []
-        libs = []
-        libpath = []
-        headers = []
         if sys.platform == 'darwin':
-            # According to
-            # http://developer.apple.com/hardwaredrivers/ve/vector_libraries.html:
-            #
-            #   This page contains a continually expanding set of vector libraries
-            #   that are available to the AltiVec programmer through the Accelerate
-            #   framework on MacOS X.3, Panther. On earlier versions of MacOS X,
-            #   these were available in vecLib.framework. The currently available
-            #   libraries are described below.
-
-            #if get_platform()[-4:] == 'i386':
-            #    is_intel = 1
-            #    cflags.append('-msse3')
-            #else:
-            #    is_intel = 0
-            #    cflags.append('-faltivec')
-
-            # TODO: we should have a small test code to test Accelerate vs veclib
-            # XXX: This double append is not good, any other way ?
-            linkflags.append('-framework')
-            linkflags.append('Accelerate')
-            headers.append('Accelerate/Accelerate.h')
+            st = CheckAccelerate(context, autoadd)
+            if st:
+                return st
+            st = CheckVeclib(context, autoadd)
+            return st
+            
         else:
-            headers.append('cblas.h')
-            libs.append('cblas')
-
-    return _check_include_and_run(context, 'CBLAS', [], headers, cblas_src,
-                                  libs, libpath, linkflags, cflags, autoadd)
+            # Check MKL, then ATLAS, then Sunperf
+            st = CheckMKL(context, autoadd)
+            if st:
+                return st
+            st = CheckATLAS(context, autoadd)
+            if st:
+                return st
+            st = CheckSunperf(context, autoadd)
+            return st

Modified: branches/numpy.scons/numpy/scons_fake/checkers/SConstruct
===================================================================
--- branches/numpy.scons/numpy/scons_fake/checkers/SConstruct	2007-10-26 04:53:31 UTC (rev 4299)
+++ branches/numpy.scons/numpy/scons_fake/checkers/SConstruct	2007-10-26 05:46:19 UTC (rev 4300)
@@ -1,22 +1,22 @@
 # vim:syntax=python
 from numpy.distutils.scons import GetNumpyEnvironment, CheckATLAS, \
-                                  CheckAccelerate, CheckMKL2, CheckCBLAS, \
+                                  CheckAccelerate, CheckMKL, CheckCBLAS, \
 				  CheckSunperf
 
 env = GetNumpyEnvironment(ARGUMENTS)
 
 config = env.NumpyConfigure(custom_tests = 
     {'CheckATLAS' : CheckATLAS,
-    'CheckMKL' : CheckMKL2,
+    'CheckMKL' : CheckMKL,
     'CheckAccelerate' : CheckAccelerate,
     'CheckSunperf' : CheckSunperf,
     'CheckCBLAS' : CheckCBLAS})
 
-config.CheckATLAS(autoadd = 0)
-config.CheckMKL(autoadd = 0)
-config.CheckAccelerate(autoadd = 0)
-config.CheckSunperf(autoadd = 0)
-config.CheckCBLAS(autoadd = 0)
+#config.CheckATLAS(autoadd = 0)
+#config.CheckMKL(autoadd = 0)
+#config.CheckAccelerate(autoadd = 0)
+#config.CheckSunperf(autoadd = 0)
+#config.CheckCBLAS(autoadd = 0)
 
 config.Finish()
 




More information about the Numpy-svn mailing list