"Fossies" - the Fresh Open Source Software Archive

Member "numpy-1.16.4/numpy/distutils/fcompiler/mips.py" (22 Feb 2019, 1780 Bytes) of package /linux/misc/numpy-1.16.4.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. For more information about "mips.py" see the Fossies "Dox" file reference documentation.

    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 import customized_fcompiler
   56     print(customized_fcompiler(compiler='mips').get_version())