[Numpy-svn] r5978 - trunk/numpy/distutils/fcompiler

numpy-svn@scip... numpy-svn@scip...
Thu Nov 6 06:52:37 CST 2008


Author: cdavid
Date: 2008-11-06 06:52:26 -0600 (Thu, 06 Nov 2008)
New Revision: 5978

Modified:
   trunk/numpy/distutils/fcompiler/gnu.py
Log:
Remove cpu/arch specific optimization flags for GNU fortran compilers: they are too fragile, and are more likely not that useful anyway.

Modified: trunk/numpy/distutils/fcompiler/gnu.py
===================================================================
--- trunk/numpy/distutils/fcompiler/gnu.py	2008-11-05 23:10:56 UTC (rev 5977)
+++ trunk/numpy/distutils/fcompiler/gnu.py	2008-11-06 12:52:26 UTC (rev 5978)
@@ -178,104 +178,8 @@
         return opt
 
     def get_flags_arch(self):
-        opt = []
-        if sys.platform == 'darwin':
-            # Since Apple doesn't distribute a GNU Fortran compiler, we
-            # can't add -arch ppc or -arch i386, as only their version
-            # of the GNU compilers accepts those.
-            for a in '601 602 603 603e 604 604e 620 630 740 7400 7450 750'\
-                    '403 505 801 821 823 860'.split():
-                if getattr(cpu,'is_ppc%s'%a)():
-                    opt.append('-mcpu='+a)
-                    opt.append('-mtune='+a)
-                    break
-            return opt
+        return []
 
-        # default march options in case we find nothing better
-        if cpu.is_i686():
-            march_opt = '-march=i686'
-        elif cpu.is_i586():
-            march_opt = '-march=i586'
-        elif cpu.is_i486():
-            march_opt = '-march=i486'
-        elif cpu.is_i386():
-            march_opt = '-march=i386'
-        else:
-            march_opt = ''
-
-        gnu_ver =  self.get_version()
-
-        if gnu_ver >= '0.5.26': # gcc 3.0
-            if cpu.is_AthlonK6():
-                march_opt = '-march=k6'
-            elif cpu.is_AthlonK7():
-                march_opt = '-march=athlon'
-
-        if gnu_ver >= '3.1.1':
-            if cpu.is_AthlonK6_2():
-                march_opt = '-march=k6-2'
-            elif cpu.is_AthlonK6_3():
-                march_opt = '-march=k6-3'
-            elif cpu.is_AthlonMP():
-                march_opt = '-march=athlon-mp'
-                # 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_Xeon() and cpu.is_64bit():
-                march_opt = '-march=nocona'
-            elif cpu.is_Prescott():
-                march_opt = '-march=prescott'
-            elif cpu.is_PentiumIV():
-                march_opt = '-march=pentium4'
-            elif cpu.is_PentiumIII():
-                march_opt = '-march=pentium3'
-            elif cpu.is_PentiumM():
-                march_opt = '-march=pentium3'
-            elif cpu.is_PentiumII():
-                march_opt = '-march=pentium2'
-
-        if gnu_ver >= '3.4':
-            # Actually, I think these all do the same things
-            if cpu.is_Opteron():
-                march_opt = '-march=opteron'
-            elif cpu.is_Athlon64():
-                march_opt = '-march=athlon64'
-            elif cpu.is_AMD64():
-                march_opt = '-march=k8'
-
-        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 = ''
-
-        if march_opt:
-            opt.append(march_opt)
-
-        # other CPU flags
-        if gnu_ver >= '3.1.1':
-            if cpu.has_mmx(): opt.append('-mmmx')
-            if cpu.has_3dnow(): opt.append('-m3dnow')
-
-        if gnu_ver > '3.2.2':
-            if cpu.has_sse2(): opt.append('-msse2')
-            if cpu.has_sse(): opt.append('-msse')
-        if gnu_ver >= '3.4':
-            if cpu.has_sse3(): opt.append('-msse3')
-        if cpu.is_Intel():
-            opt.append('-fomit-frame-pointer')
-            if cpu.is_32bit():
-                opt.append('-malign-double')
-        return opt
-
 class Gnu95FCompiler(GnuFCompiler):
     compiler_type = 'gnu95'
     compiler_aliases = ('gfortran',)



More information about the Numpy-svn mailing list