Mercurial > hg > vamp-build-and-test
comparison DEPENDENCIES/mingw32/Python27/Lib/site-packages/numpy/distutils/fcompiler/mips.py @ 87:2a2c65a20a8b
Add Python libs and headers
author | Chris Cannam |
---|---|
date | Wed, 25 Feb 2015 14:05:22 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
86:413a9d26189e | 87:2a2c65a20a8b |
---|---|
1 from __future__ import division, absolute_import, print_function | |
2 | |
3 from numpy.distutils.cpuinfo import cpu | |
4 from numpy.distutils.fcompiler import FCompiler | |
5 | |
6 compilers = ['MIPSFCompiler'] | |
7 | |
8 class MIPSFCompiler(FCompiler): | |
9 | |
10 compiler_type = 'mips' | |
11 description = 'MIPSpro Fortran Compiler' | |
12 version_pattern = r'MIPSpro Compilers: Version (?P<version>[^\s*,]*)' | |
13 | |
14 executables = { | |
15 'version_cmd' : ["<F90>", "-version"], | |
16 'compiler_f77' : ["f77", "-f77"], | |
17 'compiler_fix' : ["f90", "-fixedform"], | |
18 'compiler_f90' : ["f90"], | |
19 'linker_so' : ["f90", "-shared"], | |
20 'archiver' : ["ar", "-cr"], | |
21 'ranlib' : None | |
22 } | |
23 module_dir_switch = None #XXX: fix me | |
24 module_include_switch = None #XXX: fix me | |
25 pic_flags = ['-KPIC'] | |
26 | |
27 def get_flags(self): | |
28 return self.pic_flags + ['-n32'] | |
29 def get_flags_opt(self): | |
30 return ['-O3'] | |
31 def get_flags_arch(self): | |
32 opt = [] | |
33 for a in '19 20 21 22_4k 22_5k 24 25 26 27 28 30 32_5k 32_10k'.split(): | |
34 if getattr(cpu, 'is_IP%s'%a)(): | |
35 opt.append('-TARG:platform=IP%s' % a) | |
36 break | |
37 return opt | |
38 def get_flags_arch_f77(self): | |
39 r = None | |
40 if cpu.is_r10000(): r = 10000 | |
41 elif cpu.is_r12000(): r = 12000 | |
42 elif cpu.is_r8000(): r = 8000 | |
43 elif cpu.is_r5000(): r = 5000 | |
44 elif cpu.is_r4000(): r = 4000 | |
45 if r is not None: | |
46 return ['r%s' % (r)] | |
47 return [] | |
48 def get_flags_arch_f90(self): | |
49 r = self.get_flags_arch_f77() | |
50 if r: | |
51 r[0] = '-' + r[0] | |
52 return r | |
53 | |
54 if __name__ == '__main__': | |
55 from numpy.distutils.fcompiler import new_fcompiler | |
56 compiler = new_fcompiler(compiler='mips') | |
57 compiler.customize() | |
58 print(compiler.get_version()) |