[Numpy-svn] r3538 - in trunk/numpy/distutils: . fcompiler

numpy-svn@scip... numpy-svn@scip...
Sun Feb 4 18:24:56 CST 2007


Author: edschofield
Date: 2007-02-04 18:24:42 -0600 (Sun, 04 Feb 2007)
New Revision: 3538

Modified:
   trunk/numpy/distutils/cpuinfo.py
   trunk/numpy/distutils/fcompiler/gnu.py
Log:
Fixed detection of Core2 CPUs (scipy ticket #349)


Modified: trunk/numpy/distutils/cpuinfo.py
===================================================================
--- trunk/numpy/distutils/cpuinfo.py	2007-02-03 15:30:00 UTC (rev 3537)
+++ trunk/numpy/distutils/cpuinfo.py	2007-02-05 00:24:42 UTC (rev 3538)
@@ -185,8 +185,13 @@
         return self.is_PentiumIV() and self.has_sse3()
 
     def _is_Nocona(self):
-        return self.is_PentiumIV() and self.is_64bit()
-
+        return self.is_64bit() and self.is_i686()
+    
+    def _is_Core2(self):
+        return self.is_64bit() and self.is_Intel() and \
+               re.match(r'.*?Core\(TM\)2\b', \
+                        self.info[0]['model name']) is not None
+    
     def _is_Itanium(self):
         return re.match(r'.*?Itanium\b',
                         self.info[0]['family']) is not None

Modified: trunk/numpy/distutils/fcompiler/gnu.py
===================================================================
--- trunk/numpy/distutils/fcompiler/gnu.py	2007-02-03 15:30:00 UTC (rev 3537)
+++ trunk/numpy/distutils/fcompiler/gnu.py	2007-02-05 00:24:42 UTC (rev 3538)
@@ -196,6 +196,8 @@
                 # there's also: athlon-tbird, athlon-4, athlon-xp
             elif cpu.is_Nocona():
                 march_opt = '-march=nocona'
+            elif cpu.is_Core2():
+                march_opt = '-march=nocona'
             elif cpu.is_Prescott():
                 march_opt = '-march=prescott'
             elif cpu.is_PentiumIV():
@@ -216,7 +218,12 @@
         if gnu_ver >= '3.4.4':
             if cpu.is_PentiumM():
                 march_opt = '-march=pentium-m'
-
+        
+        # Future:
+        # if gnu_ver >= '4.3':
+        #    if cpu.is_Core2():
+        #        march_opt = '-march=core2'
+        
         # Note: gcc 3.2 on win32 has breakage with -march specified
         if '3.1.1' <= gnu_ver <= '3.4' and sys.platform=='win32':
             march_opt = ''



More information about the Numpy-svn mailing list