def get_flags_fix(self): opt = FCompiler.get_flags_fix(self) opt.extend([ "-YCFRL=1", "-YCOM_NAMES=LCS", "-YCOM_PFX", "-YEXT_PFX", "-YCOM_SFX=_", "-YEXT_SFX=_", "-YEXT_NAMES=LCS" ]) opt.extend(["-f", "fixed"]) return opt
def get_flags(self): opt = FCompiler.get_flags(self) if os.name != 'nt': opt.extend(['-s']) if self.get_version(): if self.get_version() >= '8.2': opt.append('-fpic') return opt
def get_flags_f90(self): opt = FCompiler.get_flags_f90(self) opt.extend([ "-YCFRL=1", "-YCOM_NAMES=LCS", "-YCOM_PFX", "-YEXT_PFX", "-YCOM_SFX=_", "-YEXT_SFX=_", "-YEXT_NAMES=LCS" ]) if self.get_version(): if self.get_version() > '4.6': opt.extend(["-YDEALLOC=ALL"]) return opt
def get_flags_f77(self): opt = FCompiler.get_flags_f77(self) opt.extend(['-N22', '-N90', '-N110']) v = self.get_version() if os.name == 'nt': if v and v >= '8.0': opt.extend(['-f', '-N15']) else: opt.append('-f') if v: if v <= '4.6': opt.append('-B108') else: # Though -N15 is undocumented, it works with # Absoft 8.0 on Linux opt.append('-N15') return opt
def get_version(self, *args, **kwds): version = FCompiler.get_version(self, *args, **kwds) xlf_dir = '/etc/opt/ibmcmp/xlf' if version is None and os.path.isdir(xlf_dir): # If the output of xlf does not contain version info # (that's the case with xlf 8.1, for instance) then # let's try another method: l = os.listdir(xlf_dir) l.sort() l.reverse() l = [ d for d in l if os.path.isfile(os.path.join(xlf_dir, d, 'xlf.cfg')) ] if not l: from distutils.version import LooseVersion self.version = version = LooseVersion(l[0]) return version
def get_libraries(self): opt = FCompiler.get_libraries(self) opt.extend(['fio', 'f90math', 'fmath']) if os.name == 'nt': opt.append('COMDLG32') return opt
def get_library_dirs(self): opt = FCompiler.get_library_dirs(self) d = os.environ.get('ABSOFT') if d: opt.append(os.path.join(d, 'LIB')) return opt
def get_flags_linker_so(self): opt = FCompiler.get_flags_linker_so(self) v = self.get_version() if v and v >= '8.0': opt.append('-nofor_main') return opt
def get_version(self, force=0, ok_status=[256,0]): # XXX status==256 may indicate 'unrecognized option' or # 'no input file'. So, version_cmd needs more work. return FCompiler.get_version(self,force,ok_status)