summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2017-04-21 12:21:07 -0600
committerGitHub <noreply@github.com>2017-04-21 12:21:07 -0600
commit6b1a37621404ca404a82a09998c28071c54494d1 (patch)
tree021f478a237b142ae58121c72e4497c8dcb17e31
parentd3b9d199666232552f5919d387654824ad82071b (diff)
parentd497a60caa0efa575fcf6a374878c9c1176b072d (diff)
downloadnumpy-6b1a37621404ca404a82a09998c28071c54494d1.tar.gz
Merge pull request #8973 from charris/fix-for-intel-18
MAINT: Update Intel compiler options.
-rw-r--r--numpy/distutils/fcompiler/intel.py8
-rw-r--r--numpy/distutils/intelccompiler.py12
2 files changed, 16 insertions, 4 deletions
diff --git a/numpy/distutils/fcompiler/intel.py b/numpy/distutils/fcompiler/intel.py
index f6f2d7e32..eb6150201 100644
--- a/numpy/distutils/fcompiler/intel.py
+++ b/numpy/distutils/fcompiler/intel.py
@@ -56,7 +56,9 @@ class IntelFCompiler(BaseIntelFCompiler):
return ['-fPIC']
def get_flags_opt(self): # Scipy test failures with -O2
- return ['-xhost -openmp -fp-model strict -O1']
+ v = self.get_version()
+ mpopt = 'openmp' if v and int(v.split('.')[0]) < 15 else 'qopenmp'
+ return ['-xhost -fp-model strict -O1 -{}'.format(mpopt)]
def get_flags_arch(self):
return []
@@ -120,7 +122,9 @@ class IntelEM64TFCompiler(IntelFCompiler):
return ['-fPIC']
def get_flags_opt(self): # Scipy test failures with -O2
- return ['-openmp -fp-model strict -O1']
+ v = self.get_version()
+ mpopt = 'openmp' if v and int(v.split('.')[0]) < 15 else 'qopenmp'
+ return ['-fp-model strict -O1 -{}'.format(mpopt)]
def get_flags_arch(self):
return ['']
diff --git a/numpy/distutils/intelccompiler.py b/numpy/distutils/intelccompiler.py
index 902f19b67..3b7756b59 100644
--- a/numpy/distutils/intelccompiler.py
+++ b/numpy/distutils/intelccompiler.py
@@ -17,9 +17,13 @@ class IntelCCompiler(UnixCCompiler):
def __init__(self, verbose=0, dry_run=0, force=0):
UnixCCompiler.__init__(self, verbose, dry_run, force)
+
+ v = self.get_version()
+ mpopt = 'openmp' if v and int(v.split('.')[0]) < 15 else 'qopenmp'
self.cc_exe = ('icc -fPIC -fp-model strict -O3 '
- '-fomit-frame-pointer -openmp')
+ '-fomit-frame-pointer -{}').format(mpopt)
compiler = self.cc_exe
+
if platform.system() == 'Darwin':
shared_flag = '-Wl,-undefined,dynamic_lookup'
else:
@@ -53,9 +57,13 @@ class IntelEM64TCCompiler(UnixCCompiler):
def __init__(self, verbose=0, dry_run=0, force=0):
UnixCCompiler.__init__(self, verbose, dry_run, force)
+
+ v = self.get_version()
+ mpopt = 'openmp' if v and int(v.split('.')[0]) < 15 else 'qopenmp'
self.cc_exe = ('icc -m64 -fPIC -fp-model strict -O3 '
- '-fomit-frame-pointer -openmp')
+ '-fomit-frame-pointer -{}').format(mpopt)
compiler = self.cc_exe
+
if platform.system() == 'Darwin':
shared_flag = '-Wl,-undefined,dynamic_lookup'
else: