Chris@87
|
1 from __future__ import division, absolute_import, print_function
|
Chris@87
|
2
|
Chris@87
|
3 from distutils.unixccompiler import UnixCCompiler
|
Chris@87
|
4 from numpy.distutils.exec_command import find_executable
|
Chris@87
|
5
|
Chris@87
|
6 class IntelCCompiler(UnixCCompiler):
|
Chris@87
|
7 """ A modified Intel compiler compatible with an gcc built Python."""
|
Chris@87
|
8 compiler_type = 'intel'
|
Chris@87
|
9 cc_exe = 'icc'
|
Chris@87
|
10 cc_args = 'fPIC'
|
Chris@87
|
11
|
Chris@87
|
12 def __init__ (self, verbose=0, dry_run=0, force=0):
|
Chris@87
|
13 UnixCCompiler.__init__ (self, verbose, dry_run, force)
|
Chris@87
|
14 self.cc_exe = 'icc -fPIC'
|
Chris@87
|
15 compiler = self.cc_exe
|
Chris@87
|
16 self.set_executables(compiler=compiler,
|
Chris@87
|
17 compiler_so=compiler,
|
Chris@87
|
18 compiler_cxx=compiler,
|
Chris@87
|
19 linker_exe=compiler,
|
Chris@87
|
20 linker_so=compiler + ' -shared')
|
Chris@87
|
21
|
Chris@87
|
22 class IntelItaniumCCompiler(IntelCCompiler):
|
Chris@87
|
23 compiler_type = 'intele'
|
Chris@87
|
24
|
Chris@87
|
25 # On Itanium, the Intel Compiler used to be called ecc, let's search for
|
Chris@87
|
26 # it (now it's also icc, so ecc is last in the search).
|
Chris@87
|
27 for cc_exe in map(find_executable, ['icc', 'ecc']):
|
Chris@87
|
28 if cc_exe:
|
Chris@87
|
29 break
|
Chris@87
|
30
|
Chris@87
|
31 class IntelEM64TCCompiler(UnixCCompiler):
|
Chris@87
|
32 """ A modified Intel x86_64 compiler compatible with a 64bit gcc built Python.
|
Chris@87
|
33 """
|
Chris@87
|
34 compiler_type = 'intelem'
|
Chris@87
|
35 cc_exe = 'icc -m64 -fPIC'
|
Chris@87
|
36 cc_args = "-fPIC"
|
Chris@87
|
37 def __init__ (self, verbose=0, dry_run=0, force=0):
|
Chris@87
|
38 UnixCCompiler.__init__ (self, verbose, dry_run, force)
|
Chris@87
|
39 self.cc_exe = 'icc -m64 -fPIC'
|
Chris@87
|
40 compiler = self.cc_exe
|
Chris@87
|
41 self.set_executables(compiler=compiler,
|
Chris@87
|
42 compiler_so=compiler,
|
Chris@87
|
43 compiler_cxx=compiler,
|
Chris@87
|
44 linker_exe=compiler,
|
Chris@87
|
45 linker_so=compiler + ' -shared')
|