[Numpy-svn] r4449 - in branches/numpy.scons/numpy/core: . include/numpy

numpy-svn@scip... numpy-svn@scip...
Tue Nov 13 05:51:09 CST 2007


Author: cdavid
Date: 2007-11-13 05:50:59 -0600 (Tue, 13 Nov 2007)
New Revision: 4449

Modified:
   branches/numpy.scons/numpy/core/SConstruct
   branches/numpy.scons/numpy/core/include/numpy/numpyconfig.h.in
   branches/numpy.scons/numpy/core/scons_support.py
Log:
Put the MATHLIB value in both numpyconfig.h and config.h (temporary workaround)

Modified: branches/numpy.scons/numpy/core/SConstruct
===================================================================
--- branches/numpy.scons/numpy/core/SConstruct	2007-11-13 11:28:16 UTC (rev 4448)
+++ branches/numpy.scons/numpy/core/SConstruct	2007-11-13 11:50:59 UTC (rev 4449)
@@ -96,7 +96,8 @@
     raise SCons.Errors.UserError("No usable mathlib was found: chose another "\
                                  "one using the MATHLIB env variable, eg "\
                                  "'MATHLIB=m python setup.py build'")
-config_sym.append(('MATHLIB', mlib))
+# XXX: this is ugly: mathlib has nothing to do in a public header file
+config_sym.append(('MATHLIB', ','.join(mlib)))
 
 def check_lib(f, autoadd = 0):
     """Check that f is available in mlib, and add the symbol appropriately.

Modified: branches/numpy.scons/numpy/core/include/numpy/numpyconfig.h.in
===================================================================
--- branches/numpy.scons/numpy/core/include/numpy/numpyconfig.h.in	2007-11-13 11:28:16 UTC (rev 4448)
+++ branches/numpy.scons/numpy/core/include/numpy/numpyconfig.h.in	2007-11-13 11:50:59 UTC (rev 4449)
@@ -8,7 +8,9 @@
 
 #define NPY_NOSMP        @NPY_NOSMP@
 
-/* Conditionally define them */
+/* XXX: this has really nothing to do in a config file... */
+#define NPY_MATHLIB      @MATHLIB@
+
 /* XXX: this has to be done outside config files !!!! */
 #ifdef PY_LONG_LONG
         #define NPY_SIZEOF_LONGLONG @SIZEOF_PY_LONG_LONG@

Modified: branches/numpy.scons/numpy/core/scons_support.py
===================================================================
--- branches/numpy.scons/numpy/core/scons_support.py	2007-11-13 11:28:16 UTC (rev 4448)
+++ branches/numpy.scons/numpy/core/scons_support.py	2007-11-13 11:50:59 UTC (rev 4449)
@@ -109,7 +109,7 @@
         elif isstring(value):
             return "#define %s %s\n\n" % (define, value)
         else:
-            return "#define %s %s\n\n" % (define, ' '.join(value))
+            return "#define %s %s\n\n" % (define, ','.join(value))
     t.writelines([write_symbol(i[0], i[1]) for i in sym])
     t.write('\n')
     t.close()
@@ -132,33 +132,6 @@
 #-----------------------------------------
 # Other functions related to configuration
 #-----------------------------------------
-def CheckMathlib(context, mathlib):
-    src = """
-/* check whether exp can be found with current link/compile options */
-#include <math.h>
-int main(int argc, char *argv[])
-{
-    double a = exp(0);
-}
-"""
-    try:
-        oldLIBS = deepcopy(context.env['LIBS'])
-    except:
-        oldLIBS = []
-
-    try:
-        context.Message("Checking if math lib %s defines exp ... " % mathlib)
-        context.env.AppendUnique(LIBS = mathlib)
-        st = context.TryLink(src, '.c')
-    finally:
-        context.env['LIBS'] = oldLIBS
-
-    if st:
-        context.Result(' Yes')
-    else:
-        context.Result(' No ')
-    return st
-
 def CheckBrokenMathlib(context, mathlib):
     src = """
 /* check whether libm is broken */



More information about the Numpy-svn mailing list