[Numpy-svn] r5625 - trunk/numpy/core

numpy-svn at scipy.org numpy-svn at scipy.org
Sat Aug 9 19:55:21 EDT 2008


Author: cdavid
Date: 2008-08-09 18:55:21 -0500 (Sat, 09 Aug 2008)
New Revision: 5625

Modified:
   trunk/numpy/core/SConscript
Log:
Give better error message when testing python.h fails.

Modified: trunk/numpy/core/SConscript
===================================================================
--- trunk/numpy/core/SConscript	2008-08-09 23:55:01 UTC (rev 5624)
+++ trunk/numpy/core/SConscript	2008-08-09 23:55:21 UTC (rev 5625)
@@ -5,7 +5,7 @@
 from os.path import join as pjoin, basename as pbasename, dirname as pdirname
 from copy import deepcopy
 
-from numscons import get_python_inc, get_pythonlib_dir
+from numscons import get_pythonlib_dir
 from numscons import GetNumpyEnvironment
 from numscons import CheckCBLAS
 from numscons import write_info
@@ -17,7 +17,7 @@
 
 
 env = GetNumpyEnvironment(ARGUMENTS)
-env.Append(CPPPATH = [get_python_inc()])
+env.Append(CPPPATH = env["PYEXTCPPPATH"])
 if os.name == 'nt':
     # NT needs the pythonlib to run any code importing Python.h, including
     # simple code using only typedef and so on, so we need it for configuration
@@ -43,9 +43,13 @@
 # Checking Types
 #---------------
 if not config.CheckHeader("Python.h"):
-    raise RuntimeError("Error: Python.h header is not found (or cannot be "
-"compiled). On linux, check that you have python-dev/python-devel packages. On"
-" windows, check \ that you have the platform SDK.")
+    errmsg = []
+    for line in config.GetLastError():
+        errmsg.append("\t>> %s " % line)
+    print """\ Error: Python.h header cannot be compiled (or cannot be found).
+On linux, check that you have python-dev/python-devel packages. On windows,
+check that you have he platform SDK. You may also use unsupported cflags. Configuration error log says: \n%s""" % ''.join(errmsg)
+    Exit(-1)
 
 def check_type(type, include = None):
     st = config.CheckTypeSize(type, includes = include)




More information about the Numpy-svn mailing list