[Numpy-svn] r4168 - in branches/numpy.scons/numpy/distutils: command scons

numpy-svn@scip... numpy-svn@scip...
Wed Oct 10 02:07:15 CDT 2007


Author: cdavid
Date: 2007-10-10 02:07:03 -0500 (Wed, 10 Oct 2007)
New Revision: 4168

Modified:
   branches/numpy.scons/numpy/distutils/command/scons.py
   branches/numpy.scons/numpy/distutils/scons/numpyenv.py
Log:
New version for suncc detection

Modified: branches/numpy.scons/numpy/distutils/command/scons.py
===================================================================
--- branches/numpy.scons/numpy/distutils/command/scons.py	2007-10-10 06:06:03 UTC (rev 4167)
+++ branches/numpy.scons/numpy/distutils/command/scons.py	2007-10-10 07:07:03 UTC (rev 4168)
@@ -114,7 +114,7 @@
                                      force=self.force)
         self.compiler.customize(self.distribution)
 		
-		# This initialization seems necessary, sometimes, for find_executable to work...
+	# This initialization seems necessary, sometimes, for find_executable to work...
         if hasattr(self.compiler, 'initialize'):
             self.compiler.initialize()
 		
@@ -140,8 +140,6 @@
         # there is a size limitation ? What is the standard solution in thise
         # case ?
 
-        # XXX: does this work everywhere in all situations ? This assumes
-        # scons.py is executable.
         scons_exec = get_python_exec_invoc()
         scons_exec += ' ' + protect_path(pjoin(get_scons_local_path(), 'scons.py'))
         for i in self.scons_scripts:
@@ -150,7 +148,6 @@
             cmd += ' distutils_libdir=%s ' % protect_path(pjoin(self.build_lib, pdirname(i)))
             cmd += ' cc_opt=%s ' % dist2sconscc(self.compiler)
             cmd += ' cc_opt_path=%s ' % protect_path(get_tool_path(self.compiler))
-            print cmd
             st = os.system(cmd)
             if st:
                 print "status is %d" % st

Modified: branches/numpy.scons/numpy/distutils/scons/numpyenv.py
===================================================================
--- branches/numpy.scons/numpy/distutils/scons/numpyenv.py	2007-10-10 06:06:03 UTC (rev 4167)
+++ branches/numpy.scons/numpy/distutils/scons/numpyenv.py	2007-10-10 07:07:03 UTC (rev 4168)
@@ -26,21 +26,21 @@
 def is_cc_suncc(fullpath):
     """Return true if the compiler is suncc."""
     # I wish there was a better way: we launch suncc -V, read the output, and
-    # returns true if this succeeds and Sun is found in the output.
+    # returns true if Sun is found in the output. We cannot check the status code, because
     
-    print "Testing suncc..."
     import os
     import re
-    suncc = re.compile('[Ss][Uu][Nn]')
+    suncc = re.compile('Sun C')
     # Redirect stderr to stdout
-    cmd = fullpath + ' -V 2>1'
+    cmd = fullpath + ' -V 2>&1'
+    print "Testing suncc with command %s..." % cmd
     out = os.popen(cmd)
     cnt = out.read()
     print "content is %s" % cnt
     st = out.close()
     print "st is %d" % st
 
-    return st == 0 and suncc.search(cnt)
+    return suncc.search(cnt)
 
 def GetNumpyOptions(args):
     """Call this with args=ARGUMENTS to take into account command line args."""



More information about the Numpy-svn mailing list