From 1224a3e8cff77b4f98e3af46cef716a6f67241ef Mon Sep 17 00:00:00 2001 From: Harmen Stoppels Date: Wed, 24 Apr 2024 19:11:02 +0200 Subject: [PATCH] clang.py: detect flang-new (#43815) If a flang-new exists, which is rather unlikely, it probably means the user wants it as a fortran compiler. --- lib/spack/spack/compilers/clang.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/spack/spack/compilers/clang.py b/lib/spack/spack/compilers/clang.py index 88154a1921..4f93d04f5f 100644 --- a/lib/spack/spack/compilers/clang.py +++ b/lib/spack/spack/compilers/clang.py @@ -38,10 +38,10 @@ class Clang(Compiler): cxx_names = ["clang++"] # Subclasses use possible names of Fortran 77 compiler - f77_names = ["flang"] + f77_names = ["flang-new", "flang"] # Subclasses use possible names of Fortran 90 compiler - fc_names = ["flang"] + fc_names = ["flang-new", "flang"] version_argument = "--version" @@ -171,10 +171,11 @@ def extract_version_from_output(cls, output): match = re.search( # Normal clang compiler versions are left as-is - r"clang version ([^ )\n]+)-svn[~.\w\d-]*|" + r"(?:clang|flang-new) version ([^ )\n]+)-svn[~.\w\d-]*|" # Don't include hyphenated patch numbers in the version # (see https://github.com/spack/spack/pull/14365 for details) - r"clang version ([^ )\n]+?)-[~.\w\d-]*|" r"clang version ([^ )\n]+)", + r"(?:clang|flang-new) version ([^ )\n]+?)-[~.\w\d-]*|" + r"(?:clang|flang-new) version ([^ )\n]+)", output, ) if match: