pathf95.py 1.1 KB

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