Chris@87: from __future__ import division, absolute_import, print_function Chris@87: Chris@87: from distutils.unixccompiler import UnixCCompiler Chris@87: from numpy.distutils.exec_command import find_executable Chris@87: Chris@87: class IntelCCompiler(UnixCCompiler): Chris@87: """ A modified Intel compiler compatible with an gcc built Python.""" Chris@87: compiler_type = 'intel' Chris@87: cc_exe = 'icc' Chris@87: cc_args = 'fPIC' Chris@87: Chris@87: def __init__ (self, verbose=0, dry_run=0, force=0): Chris@87: UnixCCompiler.__init__ (self, verbose, dry_run, force) Chris@87: self.cc_exe = 'icc -fPIC' Chris@87: compiler = self.cc_exe Chris@87: self.set_executables(compiler=compiler, Chris@87: compiler_so=compiler, Chris@87: compiler_cxx=compiler, Chris@87: linker_exe=compiler, Chris@87: linker_so=compiler + ' -shared') Chris@87: Chris@87: class IntelItaniumCCompiler(IntelCCompiler): Chris@87: compiler_type = 'intele' Chris@87: Chris@87: # On Itanium, the Intel Compiler used to be called ecc, let's search for Chris@87: # it (now it's also icc, so ecc is last in the search). Chris@87: for cc_exe in map(find_executable, ['icc', 'ecc']): Chris@87: if cc_exe: Chris@87: break Chris@87: Chris@87: class IntelEM64TCCompiler(UnixCCompiler): Chris@87: """ A modified Intel x86_64 compiler compatible with a 64bit gcc built Python. Chris@87: """ Chris@87: compiler_type = 'intelem' Chris@87: cc_exe = 'icc -m64 -fPIC' Chris@87: cc_args = "-fPIC" Chris@87: def __init__ (self, verbose=0, dry_run=0, force=0): Chris@87: UnixCCompiler.__init__ (self, verbose, dry_run, force) Chris@87: self.cc_exe = 'icc -m64 -fPIC' Chris@87: compiler = self.cc_exe Chris@87: self.set_executables(compiler=compiler, Chris@87: compiler_so=compiler, Chris@87: compiler_cxx=compiler, Chris@87: linker_exe=compiler, Chris@87: linker_so=compiler + ' -shared')