MCPcopy Create free account
hub / github.com/numpy/numpy / get_version

Method get_version

numpy/distutils/fcompiler/ibm.py:29–57  ·  view source on GitHub ↗
(self,*args,**kwds)

Source from the content-addressed store, hash-verified

27 }
28
29 def get_version(self,*args,**kwds):
30 version = FCompiler.get_version(self,*args,**kwds)
31
32 if version is None and sys.platform.startswith('aix'):
33 # use lslpp to find out xlf version
34 lslpp = find_executable('lslpp')
35 xlf = find_executable('xlf')
36 if os.path.exists(xlf) and os.path.exists(lslpp):
37 try:
38 o = subprocess.check_output([lslpp, '-Lc', 'xlfcmp'])
39 except (OSError, subprocess.CalledProcessError):
40 pass
41 else:
42 m = re.search(r'xlfcmp:(?P<version>\d+([.]\d+)+)', o)
43 if m: version = m.group('version')
44
45 xlf_dir = '/etc/opt/ibmcmp/xlf'
46 if version is None and os.path.isdir(xlf_dir):
47 # linux:
48 # If the output of xlf does not contain version info
49 # (that's the case with xlf 8.1, for instance) then
50 # let's try another method:
51 l = sorted(os.listdir(xlf_dir))
52 l.reverse()
53 l = [d for d in l if os.path.isfile(os.path.join(xlf_dir, d, 'xlf.cfg'))]
54 if l:
55 from distutils.version import LooseVersion
56 self.version = version = LooseVersion(l[0])
57 return version
58
59 def get_flags(self):
60 return ['-qextname']

Callers 15

get_flags_linker_soMethod · 0.95
pathf95.pyFile · 0.45
get_flags_optMethod · 0.45
get_flags_linker_soMethod · 0.45
intel.pyFile · 0.45
get_flags_f77Method · 0.45
sun.pyFile · 0.45
ibm.pyFile · 0.45
get_flags_linker_soMethod · 0.45
get_library_dirsMethod · 0.45
get_librariesMethod · 0.45
get_flagsMethod · 0.45

Calls 6

find_executableFunction · 0.90
startswithMethod · 0.80
listdirMethod · 0.80
existsMethod · 0.45
check_outputMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected