summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarmen Stoppels <me@harmenstoppels.nl>2024-04-24 19:11:02 +0200
committerGitHub <noreply@github.com>2024-04-24 19:11:02 +0200
commit1224a3e8cff77b4f98e3af46cef716a6f67241ef (patch)
tree40a5677eb22a50f96d025bd5b8a179ef3ec03a9b
parent6c3218920f0e0c41947bb8abfb4e941f8553e451 (diff)
downloadspack-1224a3e8cff77b4f98e3af46cef716a6f67241ef.tar.gz
spack-1224a3e8cff77b4f98e3af46cef716a6f67241ef.tar.bz2
spack-1224a3e8cff77b4f98e3af46cef716a6f67241ef.tar.xz
spack-1224a3e8cff77b4f98e3af46cef716a6f67241ef.zip
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.
-rw-r--r--lib/spack/spack/compilers/clang.py9
1 files 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 @@ class Clang(Compiler):
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: