hpux.py 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. from numpy.distutils.fcompiler import FCompiler
  2. compilers = ['HPUXFCompiler']
  3. class HPUXFCompiler(FCompiler):
  4. compiler_type = 'hpux'
  5. description = 'HP Fortran 90 Compiler'
  6. version_pattern = r'HP F90 (?P<version>[^\s*,]*)'
  7. executables = {
  8. 'version_cmd' : ["f90", "+version"],
  9. 'compiler_f77' : ["f90"],
  10. 'compiler_fix' : ["f90"],
  11. 'compiler_f90' : ["f90"],
  12. 'linker_so' : ["ld", "-b"],
  13. 'archiver' : ["ar", "-cr"],
  14. 'ranlib' : ["ranlib"]
  15. }
  16. module_dir_switch = None #XXX: fix me
  17. module_include_switch = None #XXX: fix me
  18. pic_flags = ['+Z']
  19. def get_flags(self):
  20. return self.pic_flags + ['+ppu', '+DD64']
  21. def get_flags_opt(self):
  22. return ['-O3']
  23. def get_libraries(self):
  24. return ['m']
  25. def get_library_dirs(self):
  26. opt = ['/usr/lib/hpux64']
  27. return opt
  28. def get_version(self, force=0, ok_status=[256, 0, 1]):
  29. # XXX status==256 may indicate 'unrecognized option' or
  30. # 'no input file'. So, version_cmd needs more work.
  31. return FCompiler.get_version(self, force, ok_status)
  32. if __name__ == '__main__':
  33. from distutils import log
  34. log.set_verbosity(10)
  35. from numpy.distutils import customized_fcompiler
  36. print(customized_fcompiler(compiler='hpux').get_version())