summaryrefslogtreecommitdiff
path: root/numpy/distutils/fcompiler/ibm.py
diff options
context:
space:
mode:
authorPearu Peterson <pearu.peterson@gmail.com>2007-03-02 16:49:00 +0000
committerPearu Peterson <pearu.peterson@gmail.com>2007-03-02 16:49:00 +0000
commit8fa176818c0077d160f4529ecb307fa87dfde727 (patch)
treef37601df3bb9dc21dea6f974f59a280defbbf960 /numpy/distutils/fcompiler/ibm.py
parent2288ef64c313e4de8c95b171fd235f0da9e159ec (diff)
downloadnumpy-8fa176818c0077d160f4529ecb307fa87dfde727.tar.gz
Applying info from Hans-Joachim Ehlers to improve xlf compiler support (on AIX using lslpp to determine compiler version).
Diffstat (limited to 'numpy/distutils/fcompiler/ibm.py')
-rw-r--r--numpy/distutils/fcompiler/ibm.py20
1 files changed, 10 insertions, 10 deletions
diff --git a/numpy/distutils/fcompiler/ibm.py b/numpy/distutils/fcompiler/ibm.py
index 35f212dd3..920d909d7 100644
--- a/numpy/distutils/fcompiler/ibm.py
+++ b/numpy/distutils/fcompiler/ibm.py
@@ -3,6 +3,7 @@ import re
import sys
from numpy.distutils.fcompiler import FCompiler
+from numpy.distutils.exec_command import exec_command, find_executable
from distutils import log
class IbmFCompiler(FCompiler):
@@ -23,19 +24,18 @@ class IbmFCompiler(FCompiler):
def get_version(self,*args,**kwds):
version = FCompiler.get_version(self,*args,**kwds)
- if version is None:
- # Let's try version_cmd without -qversion flag that
- # xlf versions <=8.x don't have.
- version_cmd = self.version_cmd
- orig_version_cmd = version_cmd[:]
- if '-qversion' in version_cmd:
- version_cmd.remove('-qversion')
- version = FCompiler.get_version(self,*args,**kwds)
- if version is None:
- version_cmd[:] = orig_version_cmd
+ if version is None and sys.platform.startswith('aix'):
+ # use lslpp to find out xlf version
+ lslpp = find_executable('lslpp')
+ xlf = find_executable('xlf')
+ if os.path.exists(xlf) and os.path.exists(lslpp):
+ s,o = exec_command(lslpp + ' -Lc xlfcmp')
+ m = re.search('xlfcmp:(?P<version>\d+([.]\d+)+)', o)
+ if m: version = m.group('version')
xlf_dir = '/etc/opt/ibmcmp/xlf'
if version is None and os.path.isdir(xlf_dir):
+ # linux:
# 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: