pathf95.py 1.0 KB

123456789101112131415161718192021222324252627282930313233
  1. from numpy.distutils.fcompiler import FCompiler
  2. compilers = ['PathScaleFCompiler']
  3. class PathScaleFCompiler(FCompiler):
  4. compiler_type = 'pathf95'
  5. description = 'PathScale Fortran Compiler'
  6. version_pattern = r'PathScale\(TM\) Compiler Suite: Version (?P<version>[\d.]+)'
  7. executables = {
  8. 'version_cmd' : ["pathf95", "-version"],
  9. 'compiler_f77' : ["pathf95", "-fixedform"],
  10. 'compiler_fix' : ["pathf95", "-fixedform"],
  11. 'compiler_f90' : ["pathf95"],
  12. 'linker_so' : ["pathf95", "-shared"],
  13. 'archiver' : ["ar", "-cr"],
  14. 'ranlib' : ["ranlib"]
  15. }
  16. pic_flags = ['-fPIC']
  17. module_dir_switch = '-module ' # Don't remove ending space!
  18. module_include_switch = '-I'
  19. def get_flags_opt(self):
  20. return ['-O3']
  21. def get_flags_debug(self):
  22. return ['-g']
  23. if __name__ == '__main__':
  24. from distutils import log
  25. log.set_verbosity(2)
  26. from numpy.distutils import customized_fcompiler
  27. print(customized_fcompiler(compiler='pathf95').get_version())