From 963c103a67725f3c2fc4da64dd774085876fafca Mon Sep 17 00:00:00 2001 From: serbanmaerean Date: Thu, 26 Apr 2018 17:50:14 -0400 Subject: [PATCH] XL Fortran compiler >= 16.0 is synced with C compiler version (#7887) * Use reported version of IBM XL Fortran compiler for compiler versions >= 16.0. Starting with the April 2018 release, the IBM XL C and Fortran compilers report the same version, 16.0. Consequently, there is no need to downgrade the Fortran compiler version to match that of the C compiler. --- lib/spack/spack/compilers/xl.py | 6 ++++++ lib/spack/spack/compilers/xl_r.py | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/lib/spack/spack/compilers/xl.py b/lib/spack/spack/compilers/xl.py index 8fda5cb536..1e5ca52d33 100644 --- a/lib/spack/spack/compilers/xl.py +++ b/lib/spack/spack/compilers/xl.py @@ -112,6 +112,12 @@ def fc_version(cls, fc): older version of AIX and linux on power. """ fver = get_compiler_version(fc, '-qversion', r'([0-9]?[0-9]\.[0-9])') + if fver >= 16: + """Starting with version 16.1, the XL C and Fortran compilers + have the same version. So no need to downgrade the Fortran + compiler version to match that of the C compiler version. + """ + return str(fver) cver = float(fver) - 2 if cver < 10: cver = cver - 0.1 diff --git a/lib/spack/spack/compilers/xl_r.py b/lib/spack/spack/compilers/xl_r.py index 1afaa45e63..717d631873 100644 --- a/lib/spack/spack/compilers/xl_r.py +++ b/lib/spack/spack/compilers/xl_r.py @@ -113,6 +113,12 @@ def fc_version(cls, fc): older version of AIX and linux on power. """ fver = get_compiler_version(fc, '-qversion', r'([0-9]?[0-9]\.[0-9])') + if fver >= 16: + """Starting with version 16.1, the XL C and Fortran compilers + have the same version. So no need to downgrade the Fortran + compiler version to match that of the C compiler version. + """ + return str(fver) cver = float(fver) - 2 if cver < 10: cver = cver - 0.1