diff options
author | Pearu Peterson <pearu.peterson@gmail.com> | 2007-02-28 18:32:18 +0000 |
---|---|---|
committer | Pearu Peterson <pearu.peterson@gmail.com> | 2007-02-28 18:32:18 +0000 |
commit | a3aacd3cba852ba63fbfd9381bc41a078d1716db (patch) | |
tree | e8e320b8b1c038f0494aa81061bf7a575fed8233 /numpy/distutils/fcompiler/ibm.py | |
parent | a353043bc0e74d0ee934a88180b94b98093f60bb (diff) | |
download | numpy-a3aacd3cba852ba63fbfd9381bc41a078d1716db.tar.gz |
Fixing xlf compiler for AIX with 9.x and 10.x version support (needs testing and checking that xlf 8.x compilers are still detected)
Diffstat (limited to 'numpy/distutils/fcompiler/ibm.py')
-rw-r--r-- | numpy/distutils/fcompiler/ibm.py | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/numpy/distutils/fcompiler/ibm.py b/numpy/distutils/fcompiler/ibm.py index 14ec298d5..35f212dd3 100644 --- a/numpy/distutils/fcompiler/ibm.py +++ b/numpy/distutils/fcompiler/ibm.py @@ -11,7 +11,7 @@ class IbmFCompiler(FCompiler): version_pattern = r'(xlf\(1\)\s*|)IBM XL Fortran ((Advanced Edition |)Version |Enterprise Edition V)(?P<version>[^\s*]*)' #IBM XL Fortran Enterprise Edition V10.1 for AIX \nVersion: 10.01.0000.0004 executables = { - 'version_cmd' : ["xlf"], + 'version_cmd' : ["xlf","-qversion"], 'compiler_f77' : ["xlf"], 'compiler_fix' : ["xlf90", "-qfixed"], 'compiler_f90' : ["xlf90"], @@ -24,14 +24,16 @@ class IbmFCompiler(FCompiler): version = FCompiler.get_version(self,*args,**kwds) if version is None: - # Let's try version_cmd with -qversion flag that V10 supports: - l = self.__class__.executables['version_cmd'] - if '-qversion' not in l: - l.append('-qversion') + # 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: - l.remove('-qversion') - + version_cmd[:] = orig_version_cmd + 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 @@ -61,7 +63,10 @@ class IbmFCompiler(FCompiler): version = self.get_version(ok_status=[0,40]) if version is not None: import tempfile - xlf_cfg = '/etc/opt/ibmcmp/xlf/%s/xlf.cfg' % version + if sys.platform.startswith('aix'): + xlf_cfg = '/etc/xlf.cfg' + else: + xlf_cfg = '/etc/opt/ibmcmp/xlf/%s/xlf.cfg' % version new_cfg = tempfile.mktemp()+'_xlf.cfg' log.info('Creating '+new_cfg) fi = open(xlf_cfg,'r') |