annotate DEPENDENCIES/mingw32/Python27/Lib/site-packages/numpy/distutils/fcompiler/pg.py @ 133:4acb5d8d80b6 tip

Don't fail environmental check if README.md exists (but .txt and no-suffix don't)
author Chris Cannam
date Tue, 30 Jul 2019 12:25:44 +0100
parents 2a2c65a20a8b
children
rev   line source
Chris@87 1 # http://www.pgroup.com
Chris@87 2 from __future__ import division, absolute_import, print_function
Chris@87 3
Chris@87 4 from numpy.distutils.fcompiler import FCompiler
Chris@87 5 from sys import platform
Chris@87 6
Chris@87 7 compilers = ['PGroupFCompiler']
Chris@87 8
Chris@87 9 class PGroupFCompiler(FCompiler):
Chris@87 10
Chris@87 11 compiler_type = 'pg'
Chris@87 12 description = 'Portland Group Fortran Compiler'
Chris@87 13 version_pattern = r'\s*pg(f77|f90|hpf|fortran) (?P<version>[\d.-]+).*'
Chris@87 14
Chris@87 15 if platform == 'darwin':
Chris@87 16 executables = {
Chris@87 17 'version_cmd' : ["<F77>", "-V"],
Chris@87 18 'compiler_f77' : ["pgfortran", "-dynamiclib"],
Chris@87 19 'compiler_fix' : ["pgfortran", "-Mfixed", "-dynamiclib"],
Chris@87 20 'compiler_f90' : ["pgfortran", "-dynamiclib"],
Chris@87 21 'linker_so' : ["libtool"],
Chris@87 22 'archiver' : ["ar", "-cr"],
Chris@87 23 'ranlib' : ["ranlib"]
Chris@87 24 }
Chris@87 25 pic_flags = ['']
Chris@87 26 else:
Chris@87 27 executables = {
Chris@87 28 'version_cmd' : ["<F77>", "-V"],
Chris@87 29 'compiler_f77' : ["pgfortran"],
Chris@87 30 'compiler_fix' : ["pgfortran", "-Mfixed"],
Chris@87 31 'compiler_f90' : ["pgfortran"],
Chris@87 32 'linker_so' : ["pgfortran", "-shared", "-fpic"],
Chris@87 33 'archiver' : ["ar", "-cr"],
Chris@87 34 'ranlib' : ["ranlib"]
Chris@87 35 }
Chris@87 36 pic_flags = ['-fpic']
Chris@87 37
Chris@87 38
Chris@87 39 module_dir_switch = '-module '
Chris@87 40 module_include_switch = '-I'
Chris@87 41
Chris@87 42 def get_flags(self):
Chris@87 43 opt = ['-Minform=inform', '-Mnosecond_underscore']
Chris@87 44 return self.pic_flags + opt
Chris@87 45 def get_flags_opt(self):
Chris@87 46 return ['-fast']
Chris@87 47 def get_flags_debug(self):
Chris@87 48 return ['-g']
Chris@87 49
Chris@87 50 if platform == 'darwin':
Chris@87 51 def get_flags_linker_so(self):
Chris@87 52 return ["-dynamic", '-undefined', 'dynamic_lookup']
Chris@87 53
Chris@87 54 if __name__ == '__main__':
Chris@87 55 from distutils import log
Chris@87 56 log.set_verbosity(2)
Chris@87 57 from numpy.distutils.fcompiler import new_fcompiler
Chris@87 58 compiler = new_fcompiler(compiler='pg')
Chris@87 59 compiler.customize()
Chris@87 60 print(compiler.get_version())