diff options
| author | Charles Harris <charlesr.harris@gmail.com> | 2015-08-19 11:12:41 -0400 |
|---|---|---|
| committer | Charles Harris <charlesr.harris@gmail.com> | 2015-08-19 11:12:41 -0400 |
| commit | 60788241061e047cadbbfc1af114d2e7ee7ff0ca (patch) | |
| tree | f85266a694db65442cba4abe63a32a6d8293ad59 /numpy/distutils | |
| parent | 9f4d6092ec0cb604395fec5caffddb57eb86237c (diff) | |
| parent | e76eb2724f143fbba82dbbf251b1d9417376e6a2 (diff) | |
| download | numpy-60788241061e047cadbbfc1af114d2e7ee7ff0ca.tar.gz | |
Merge pull request #6211 from yolanda15/intelc
BLD: fix for INTEL compiler build failure on linux when import msvc
Diffstat (limited to 'numpy/distutils')
| -rw-r--r-- | numpy/distutils/intelccompiler.py | 68 |
1 files changed, 37 insertions, 31 deletions
diff --git a/numpy/distutils/intelccompiler.py b/numpy/distutils/intelccompiler.py index 3f062f33b..81009bb6f 100644 --- a/numpy/distutils/intelccompiler.py +++ b/numpy/distutils/intelccompiler.py @@ -1,8 +1,9 @@ from __future__ import division, absolute_import, print_function +import sys + from distutils.unixccompiler import UnixCCompiler from numpy.distutils.exec_command import find_executable -from distutils.msvc9compiler import MSVCCompiler from numpy.distutils.ccompiler import simple_version_match @@ -54,34 +55,39 @@ class IntelEM64TCCompiler(UnixCCompiler): linker_so=compiler + ' -shared') -class IntelCCompilerW(MSVCCompiler): - """ - A modified Intel compiler on Windows compatible with an MSVC-built Python. - """ - compiler_type = 'intelw' - - def __init__(self, verbose=0, dry_run=0, force=0): - MSVCCompiler.__init__(self, verbose, dry_run, force) - version_match = simple_version_match(start='Intel\(R\).*?32,') - self.__version = version_match - - def initialize(self, plat_name=None): - MSVCCompiler.initialize(self, plat_name) - self.cc = self.find_exe("icl.exe") - self.lib = self.find_exe("xilib") - self.linker = self.find_exe("xilink") - self.compile_options = ['/nologo', '/O3', '/MD', '/W3', '/Qstd=c99'] - self.compile_options_debug = ['/nologo', '/Od', '/MDd', '/W3', - '/Qstd=c99', '/Z7', '/D_DEBUG'] +if sys.platform == 'win32': + from distutils.msvc9compiler import MSVCCompiler + + class IntelCCompilerW(MSVCCompiler): + """ + A modified Intel compiler compatible with an MSVC-built Python. + """ + compiler_type = 'intelw' + + def __init__(self, verbose=0, dry_run=0, force=0): + MSVCCompiler.__init__(self, verbose, dry_run, force) + version_match = simple_version_match(start='Intel\(R\).*?32,') + self.__version = version_match + + def initialize(self, plat_name=None): + MSVCCompiler.initialize(self, plat_name) + self.cc = self.find_exe("icl.exe") + self.lib = self.find_exe("xilib") + self.linker = self.find_exe("xilink") + self.compile_options = ['/nologo', '/O3', '/MD', '/W3', + '/Qstd=c99'] + self.compile_options_debug = ['/nologo', '/Od', '/MDd', '/W3', + '/Qstd=c99', '/Z7', '/D_DEBUG'] + + class IntelEM64TCCompilerW(IntelCCompilerW): + """ + A modified Intel x86_64 compiler compatible with + a 64bit MSVC-built Python. + """ + compiler_type = 'intelemw' + + def __init__(self, verbose=0, dry_run=0, force=0): + MSVCCompiler.__init__(self, verbose, dry_run, force) + version_match = simple_version_match(start='Intel\(R\).*?64,') + self.__version = version_match - -class IntelEM64TCCompilerW(IntelCCompilerW): - """ - A modified Intel x86_64 compiler compatible with a 64bit MSVC-built Python. - """ - compiler_type = 'intelemw' - - def __init__(self, verbose=0, dry_run=0, force=0): - MSVCCompiler.__init__(self, verbose, dry_run, force) - version_match = simple_version_match(start='Intel\(R\).*?64,') - self.__version = version_match |
