[Numpy-svn] r4852 - trunk/numpy/distutils

numpy-svn at scipy.org numpy-svn at scipy.org
Thu Mar 6 00:03:04 EST 2008


Author: charris
Date: 2008-03-05 23:03:02 -0600 (Wed, 05 Mar 2008)
New Revision: 4852

Modified:
   trunk/numpy/distutils/cpuinfo.py
Log:
Apply David's patch to fix ticket 653.


Modified: trunk/numpy/distutils/cpuinfo.py
===================================================================
--- trunk/numpy/distutils/cpuinfo.py	2008-03-05 07:00:18 UTC (rev 4851)
+++ trunk/numpy/distutils/cpuinfo.py	2008-03-06 05:03:02 UTC (rev 4852)
@@ -18,6 +18,7 @@
 import os
 import commands
 import warnings
+import platform
 
 def getoutput(cmd, successful_status=(0,), stacklevel=1):
     try:
@@ -80,9 +81,17 @@
     def _getNCPUs(self):
         return 1
 
+    def __get_nbits(self):
+        abits = platform.architecture()[0]
+        nbits = re.compile('(\d+)bit').search(abits).group(1)
+        return nbits
+
     def _is_32bit(self):
-        return not self.is_64bit()
+        return self.__get_nbits() == '32'
 
+    def _is_64bit(self):
+        return self.__get_nbits() == '64'
+
 class LinuxCPUInfo(CPUInfoBase):
 
     info = None
@@ -271,20 +280,6 @@
     def _has_3dnowext(self):
         return re.match(r'.*?\b3dnowext\b',self.info[0]['flags']) is not None
 
-    def _is_64bit(self):
-        if self.is_Alpha():
-            return True
-        if self.info[0].get('clflush size','')=='64':
-            return True
-        if self.info[0].get('uname_m','')=='x86_64':
-            return True
-        if self.info[0].get('arch','')=='IA-64':
-            return True
-        return False
-
-    def _is_32bit(self):
-        return not self.is_64bit()
-
 class IRIXCPUInfo(CPUInfoBase):
     info = None
 
@@ -412,11 +407,6 @@
 
     def _not_impl(self): pass
 
-    def _is_32bit(self):
-        return self.info['isainfo_b']=='32'
-    def _is_64bit(self):
-        return self.info['isainfo_b']=='64'
-
     def _is_i386(self):
         return self.info['isainfo_n']=='i386'
     def _is_sparc(self):




More information about the Numpy-svn mailing list