[Numpy-svn] r5902 - branches/clean_math_config/numpy/core

numpy-svn@scip... numpy-svn@scip...
Fri Oct 3 02:22:09 CDT 2008


Author: cdavid
Date: 2008-10-03 02:22:02 -0500 (Fri, 03 Oct 2008)
New Revision: 5902

Modified:
   branches/clean_math_config/numpy/core/SConscript
Log:
Check for float/long double C99 functions.

Modified: branches/clean_math_config/numpy/core/SConscript
===================================================================
--- branches/clean_math_config/numpy/core/SConscript	2008-10-03 07:21:46 UTC (rev 5901)
+++ branches/clean_math_config/numpy/core/SConscript	2008-10-03 07:22:02 UTC (rev 5902)
@@ -1,4 +1,4 @@
-# Last Change: Fri Oct 03 03:00 PM 2008 J
+# Last Change: Fri Oct 03 04:00 PM 2008 J
 # vim:syntax=python
 import os
 import sys
@@ -145,6 +145,9 @@
     raise SystemError("One of the required function to build numpy is not"
             " available (the list is %s)." % str(mandatory_funcs))
 
+# Standard functions which may not be available and for which we have a
+# replacement implementation
+#
 def check_funcs(funcs):
     # Use check_funcs_once first, and if it does not work, test func per
     # func. Return success only if all the functions are available
@@ -161,6 +164,16 @@
 
 check_funcs(optional_stdfuncs)
 
+# C99 functions: float and long double versions
+c99_funcs = ["sin", "cos", "tan", "sinh", "cosh", "tanh", "fabs", "floor",
+             "ceil", "rint", "trunc", "sqrt", "log10", "log", "exp",
+             "expm1", "asin", "acos", "atan", "asinh", "acosh", "atanh",
+             "hypot", "atan2", "pow", "fmod", "modf", 'frexp', 'ldexp']
+
+for prec in ['l', 'f']:
+    fns = [f + prec for f in c99_funcs]
+    check_funcs(fns)
+
 def check_func(f):
     """Check that f is available in mlib, and add the symbol appropriately.  """
     st = config.CheckDeclaration(f, language = 'C', includes = "#include <math.h>")



More information about the Numpy-svn mailing list