diff options
author | yolanda15 <yolanda15@users.noreply.github.com> | 2015-08-18 13:32:48 +0800 |
---|---|---|
committer | yolanda15 <yolanda15@users.noreply.github.com> | 2015-08-18 13:32:48 +0800 |
commit | 84e39ce41439df1c1f488f76c3b6d3580d858561 (patch) | |
tree | a24ad6866d81c036abb48a4ce8a662e093c31532 /numpy/distutils/intelccompiler.py | |
parent | 4186b6db167507c96a27d8bdcd36cbe4dc4574a0 (diff) | |
download | numpy-84e39ce41439df1c1f488f76c3b6d3580d858561.tar.gz |
fix for linux build break with msvc
Diffstat (limited to 'numpy/distutils/intelccompiler.py')
-rw-r--r-- | numpy/distutils/intelccompiler.py | 62 |
1 files changed, 34 insertions, 28 deletions
diff --git a/numpy/distutils/intelccompiler.py b/numpy/distutils/intelccompiler.py index 3f062f33b..047b6714e 100644 --- a/numpy/distutils/intelccompiler.py +++ b/numpy/distutils/intelccompiler.py @@ -1,8 +1,11 @@ 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 +if sys.platform == 'win32': + from distutils.msvc9compiler import MSVCCompiler from numpy.distutils.ccompiler import simple_version_match @@ -54,34 +57,37 @@ 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', +if sys.platform == 'win32': + 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'] -class IntelEM64TCCompilerW(IntelCCompilerW): - """ - A modified Intel x86_64 compiler compatible with a 64bit MSVC-built Python. - """ - compiler_type = 'intelemw' + 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 + - 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 |