summaryrefslogtreecommitdiff
path: root/numpy/distutils/fcompiler/gnu.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2015-10-20 08:59:26 -0600
committerCharles Harris <charlesr.harris@gmail.com>2015-10-20 08:59:26 -0600
commita08437e12d6b6796f4b0beda49bce9adc37db63d (patch)
treee09edef2c87e623425d465552fc901e1176704f5 /numpy/distutils/fcompiler/gnu.py
parent5fd1707ea9576b5a4efff5866a8e8d36f36ef6e9 (diff)
downloadnumpy-a08437e12d6b6796f4b0beda49bce9adc37db63d.tar.gz
Revert "Merge pull request #5614 from charris/cleanup-gh-5587"
Revert mingwpy modifications to distutils. They are causing problems for non-windows builds and it is better to wait until mingypy is further along. This reverts commit 96abd32de241864ee97f30357234cbc9a96c43ae, reversing changes made to 06af9918f6bf03b8d818ec834f9fb48db57d1489.
Diffstat (limited to 'numpy/distutils/fcompiler/gnu.py')
-rw-r--r--numpy/distutils/fcompiler/gnu.py32
1 files changed, 10 insertions, 22 deletions
diff --git a/numpy/distutils/fcompiler/gnu.py b/numpy/distutils/fcompiler/gnu.py
index a7fd3a77f..37be0800d 100644
--- a/numpy/distutils/fcompiler/gnu.py
+++ b/numpy/distutils/fcompiler/gnu.py
@@ -20,8 +20,6 @@ TARGET_R = re.compile("Target: ([a-zA-Z0-9_\-]*)")
# XXX: handle cross compilation
def is_win64():
return sys.platform == "win32" and platform.architecture()[0] == "64bit"
-def is_win32():
- return sys.platform == "win32" and platform.architecture()[0] == "32bit"
if is_win64():
#_EXTRAFLAGS = ["-fno-leading-underscore"]
@@ -138,7 +136,7 @@ class GnuFCompiler(FCompiler):
opt.extend(['-undefined', 'dynamic_lookup', '-bundle'])
else:
- opt.append("-shared -Wl,-gc-sections -Wl,-s")
+ opt.append("-shared")
if sys.platform.startswith('sunos'):
# SunOS often has dynamically loaded symbols defined in the
# static library libg2c.a The linker doesn't like this. To
@@ -210,18 +208,9 @@ class GnuFCompiler(FCompiler):
# With this compiler version building Fortran BLAS/LAPACK
# with -O3 caused failures in lib.lapack heevr,syevr tests.
opt = ['-O2']
- elif v and v >= '4.6.0':
- if is_win32():
- # use -mincoming-stack-boundary=2
- # due to the change to 16 byte stack alignment since GCC 4.6
- # but 32 bit Windows ABI defines 4 bytes stack alignment
- opt = ['-O2 -march=core2 -mtune=generic -mfpmath=sse -msse2 '
- '-mincoming-stack-boundary=2']
- else:
- opt = ['-O2 -march=x86-64 -DMS_WIN64 -mtune=generic -msse2']
else:
- opt = ['-O2']
-
+ opt = ['-O3']
+ opt.append('-funroll-loops')
return opt
def _c_arch_flags(self):
@@ -361,7 +350,10 @@ class Gnu95FCompiler(GnuFCompiler):
return ""
def get_flags_opt(self):
- return GnuFCompiler.get_flags_opt(self)
+ if is_win64():
+ return ['-O0']
+ else:
+ return GnuFCompiler.get_flags_opt(self)
def _can_target(cmd, arch):
"""Return true if the architecture supports the -arch flag"""
@@ -386,13 +378,9 @@ if __name__ == '__main__':
from distutils import log
log.set_verbosity(2)
- try:
- compiler = GnuFCompiler()
- compiler.customize()
- print(compiler.get_version())
- except Exception:
- msg = get_exception()
- print(msg)
+ compiler = GnuFCompiler()
+ compiler.customize()
+ print(compiler.get_version())
try:
compiler = Gnu95FCompiler()