Skip to content

Commit

Permalink
Merge pull request numpy#6211 from yolanda15/intelc
Browse files Browse the repository at this point in the history
BLD: fix for INTEL compiler build failure on linux when import msvc
  • Loading branch information
charris committed Aug 19, 2015
2 parents 9f4d609 + e76eb27 commit 6078824
Showing 1 changed file with 37 additions and 31 deletions.
68 changes: 37 additions & 31 deletions numpy/distutils/intelccompiler.py
Original file line number Diff line number Diff line change
@@ -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


Expand Down Expand Up @@ -54,34 +55,39 @@ def __init__(self, verbose=0, dry_run=0, force=0):
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

0 comments on commit 6078824

Please sign in to comment.