[Numpy-svn] r4452 - in branches/numpy.scons/numpy: distutils distutils/scons linalg random

numpy-svn@scip... numpy-svn@scip...
Tue Nov 13 08:37:36 CST 2007


Author: cdavid
Date: 2007-11-13 08:37:25 -0600 (Tue, 13 Nov 2007)
New Revision: 4452

Modified:
   branches/numpy.scons/numpy/distutils/misc_util.py
   branches/numpy.scons/numpy/distutils/scons/__init__.py
   branches/numpy.scons/numpy/linalg/SConstruct
   branches/numpy.scons/numpy/random/SConstruct
Log:
Fix get_mathlib for sconscripts (subpackage build finally work)

Modified: branches/numpy.scons/numpy/distutils/misc_util.py
===================================================================
--- branches/numpy.scons/numpy/distutils/misc_util.py	2007-11-13 13:51:35 UTC (rev 4451)
+++ branches/numpy.scons/numpy/distutils/misc_util.py	2007-11-13 14:37:25 UTC (rev 4452)
@@ -113,11 +113,11 @@
     return minrelpath(joined)
 
 def get_mathlibs(path=None):
-    """Return the MATHLIB line from config.h
+    """Return the MATHLIB line from numpyconfig.h
     """
     if path is None:
         path = os.path.join(get_numpy_include_dirs()[0], 'numpy')
-    config_file = os.path.join(path,'config.h')
+    config_file = os.path.join(path,'numpyconfig.h')
     fid = open(config_file)
     mathlibs = []
     s = '#define MATHLIB'

Modified: branches/numpy.scons/numpy/distutils/scons/__init__.py
===================================================================
--- branches/numpy.scons/numpy/distutils/scons/__init__.py	2007-11-13 13:51:35 UTC (rev 4451)
+++ branches/numpy.scons/numpy/distutils/scons/__init__.py	2007-11-13 14:37:25 UTC (rev 4452)
@@ -7,6 +7,19 @@
 from checkers import CheckCBLAS, CheckLAPACK
 from fortran_scons import CheckF77Verbose, CheckF77Clib, CheckF77Mangling
 
+# XXX: this is ugly, better find the mathlibs with a checker 
+# XXX: this had nothing to do here, too...
+def scons_get_mathlib(env):
+    from numpy.distutils.misc_util import get_mathlibs
+    path_list = scons_get_paths(env['include_bootstrap']) + [None]
+    for i in path_list:
+        try:
+            mlib =  get_mathlibs(i)
+            return mlib
+        except IOError:
+            pass
+    raise RuntimeError("FIXME: no mlib found ?")
+
 def test(level=1, verbosity=1):
     from numpy.testing import NumpyTest
     return NumpyTest().test(level, verbosity)

Modified: branches/numpy.scons/numpy/linalg/SConstruct
===================================================================
--- branches/numpy.scons/numpy/linalg/SConstruct	2007-11-13 13:51:35 UTC (rev 4451)
+++ branches/numpy.scons/numpy/linalg/SConstruct	2007-11-13 14:37:25 UTC (rev 4452)
@@ -1,9 +1,10 @@
-# Last Change: Tue Nov 13 10:00 PM 2007 J
+# Last Change: Tue Nov 13 11:00 PM 2007 J
 # vim:syntax=python
 import os.path
 
 from numpy.distutils.misc_util import get_numpy_include_dirs, get_mathlibs
-from numpy.distutils.scons import GetNumpyEnvironment, scons_get_paths
+from numpy.distutils.scons import GetNumpyEnvironment, scons_get_paths, \
+                                  scons_get_mathlib
 from numpy.distutils.scons import CheckLAPACK
 from numpy.distutils.scons.configuration import write_info
 
@@ -15,16 +16,7 @@
 
 use_lapack = config.CheckLAPACK()
 
-# XXX: this is ugly, better find the mathlibs with a checker 
-def custom_get_mathlib():
-    for i in scons_get_paths(env['include_bootstrap']):
-        try:
-            mlib =  get_mathlibs(i)
-            return mlib
-        except IOError:
-            pass
-    raise RuntimeError("FIXME: no mlib found ?")
-mlib = custom_get_mathlib()
+mlib = scons_get_mathlib(env)
 env.AppendUnique(LIBS = mlib)
 
 config.Finish()

Modified: branches/numpy.scons/numpy/random/SConstruct
===================================================================
--- branches/numpy.scons/numpy/random/SConstruct	2007-11-13 13:51:35 UTC (rev 4451)
+++ branches/numpy.scons/numpy/random/SConstruct	2007-11-13 14:37:25 UTC (rev 4452)
@@ -1,9 +1,10 @@
-# Last Change: Sun Oct 21 10:00 PM 2007 J
+# Last Change: Tue Nov 13 11:00 PM 2007 J
 # vim:syntax=python
 import os
 
 from numpy.distutils.misc_util import get_numpy_include_dirs, get_mathlibs
-from numpy.distutils.scons import GetNumpyEnvironment, scons_get_paths
+from numpy.distutils.scons import GetNumpyEnvironment, scons_get_paths, \
+                                  scons_get_mathlib
 
 def CheckWincrypt(context):
     from copy import deepcopy
@@ -30,13 +31,7 @@
 env = GetNumpyEnvironment(ARGUMENTS)
 env.Append(CPPPATH = scons_get_paths(env['include_bootstrap']))
 
-# XXX: this is ugly, better find the mathlibs with a checker 
-for i in scons_get_paths(env['include_bootstrap']):
-    try:
-        mlib =  get_mathlibs(i)
-        break
-    except IOError:
-        pass
+mlib = scons_get_mathlib(env)
 env.AppendUnique(LIBS = mlib)
 
 # On windows, see if we should use Advapi32



More information about the Numpy-svn mailing list