Skip to content

Commit 9ff9c0a

Browse files
committed
Merge pull request #433 from rgommers/intel-fortran-flags
MAINT: update Intel Fortran compiler flags for the 21st century.
2 parents a17875b + 854f67f commit 9ff9c0a

File tree

1 file changed

+16
-55
lines changed

1 file changed

+16
-55
lines changed

numpy/distutils/fcompiler/intel.py

+16-55
Original file line numberDiff line numberDiff line change
@@ -43,61 +43,18 @@ class IntelFCompiler(BaseIntelFCompiler):
4343
module_dir_switch = '-module ' # Don't remove ending space!
4444
module_include_switch = '-I'
4545

46-
def get_flags(self):
47-
v = self.get_version()
48-
if v >= '10.0':
49-
# Use -fPIC instead of -KPIC.
50-
pic_flags = ['-fPIC']
51-
else:
52-
pic_flags = ['-KPIC']
53-
opt = pic_flags + ["-cm"]
54-
return opt
55-
5646
def get_flags_free(self):
5747
return ["-FR"]
5848

49+
def get_flags(self):
50+
return ['-fPIC']
51+
5952
def get_flags_opt(self):
60-
return ['-O1']
53+
#return ['-i8 -xhost -openmp -fp-model strict']
54+
return ['-xhost -openmp -fp-model strict']
6155

6256
def get_flags_arch(self):
63-
v = self.get_version()
64-
opt = []
65-
if cpu.has_fdiv_bug():
66-
opt.append('-fdiv_check')
67-
if cpu.has_f00f_bug():
68-
opt.append('-0f_check')
69-
if cpu.is_PentiumPro() or cpu.is_PentiumII() or cpu.is_PentiumIII():
70-
opt.extend(['-tpp6'])
71-
elif cpu.is_PentiumM():
72-
opt.extend(['-tpp7','-xB'])
73-
elif cpu.is_Pentium():
74-
opt.append('-tpp5')
75-
elif cpu.is_PentiumIV() or cpu.is_Xeon():
76-
opt.extend(['-tpp7','-xW'])
77-
if v and v <= '7.1':
78-
if cpu.has_mmx() and (cpu.is_PentiumII() or cpu.is_PentiumIII()):
79-
opt.append('-xM')
80-
elif v and v >= '8.0':
81-
if cpu.is_PentiumIII():
82-
opt.append('-xK')
83-
if cpu.has_sse3():
84-
opt.extend(['-xP'])
85-
elif cpu.is_PentiumIV():
86-
opt.append('-xW')
87-
if cpu.has_sse2():
88-
opt.append('-xN')
89-
elif cpu.is_PentiumM():
90-
opt.extend(['-xB'])
91-
if (cpu.is_Xeon() or cpu.is_Core2() or cpu.is_Core2Extreme()) and cpu.getNCPUs()==2:
92-
opt.extend(['-xT'])
93-
if cpu.has_sse3() and (cpu.is_PentiumIV() or cpu.is_CoreDuo() or cpu.is_CoreSolo()):
94-
opt.extend(['-xP'])
95-
96-
if cpu.has_sse2():
97-
opt.append('-arch SSE2')
98-
elif cpu.has_sse():
99-
opt.append('-arch SSE')
100-
return opt
57+
return []
10158

10259
def get_flags_linker_so(self):
10360
opt = FCompiler.get_flags_linker_so(self)
@@ -111,7 +68,7 @@ def get_flags_linker_so(self):
11168
opt.remove('-shared')
11269
except ValueError:
11370
idx = 0
114-
opt[idx:idx] = ['-dynamiclib', '-Wl,-undefined,dynamic_lookup']
71+
opt[idx:idx] = ['-dynamiclib', '-Wl,-undefined,dynamic_lookup', '-Wl,-framework,Python']
11572
return opt
11673

11774
class IntelItaniumFCompiler(IntelFCompiler):
@@ -144,19 +101,23 @@ class IntelEM64TFCompiler(IntelFCompiler):
144101

145102
executables = {
146103
'version_cmd' : None,
147-
'compiler_f77' : [None, "-FI", "-w90", "-w95"],
104+
'compiler_f77' : [None, "-FI"],
148105
'compiler_fix' : [None, "-FI"],
149106
'compiler_f90' : [None],
150107
'linker_so' : ['<F90>', "-shared"],
151108
'archiver' : ["ar", "-cr"],
152109
'ranlib' : ["ranlib"]
153110
}
154111

112+
def get_flags(self):
113+
return ['-fPIC']
114+
115+
def get_flags_opt(self):
116+
#return ['-i8 -xhost -openmp -fp-model strict']
117+
return ['-xhost -openmp -fp-model strict']
118+
155119
def get_flags_arch(self):
156-
opt = []
157-
if cpu.is_PentiumIV() or cpu.is_Xeon():
158-
opt.extend(['-tpp7', '-xW'])
159-
return opt
120+
return []
160121

161122
# Is there no difference in the version string between the above compilers
162123
# and the Visual compilers?

0 commit comments

Comments
 (0)