Skip to content

Commit

Permalink
MAINT: Update Intel compiler options.
Browse files Browse the repository at this point in the history
The '-openmp' option was deprecated in Intel version 15 and removed
in version 18. The replacement is '-qopenmp'.

Closes numpy#8941.

[skip ci]
  • Loading branch information
charris committed Apr 19, 2017
1 parent c853b93 commit 3a429d1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
8 changes: 6 additions & 2 deletions numpy/distutils/fcompiler/intel.py
Expand Up @@ -56,7 +56,9 @@ def get_flags(self):
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 []
Expand Down Expand Up @@ -120,7 +122,9 @@ def get_flags(self):
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 ['']
Expand Down
12 changes: 10 additions & 2 deletions numpy/distutils/intelccompiler.py
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 3a429d1

Please sign in to comment.