summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAnnop Wongwathanarat <annop.wongwathanarat@gmail.com>2023-05-04 09:59:15 +0100
committerGitHub <noreply@github.com>2023-05-04 03:59:15 -0500
commite5dcaebd4317390d261bb15f35458fcfd649af6d (patch)
treeed56e8550dc7bea8fe5d860a6d25f327c724358e /lib
parent84a70c26d90ff82bd3568682b1a5a3615829d11f (diff)
downloadspack-e5dcaebd4317390d261bb15f35458fcfd649af6d.tar.gz
spack-e5dcaebd4317390d261bb15f35458fcfd649af6d.tar.bz2
spack-e5dcaebd4317390d261bb15f35458fcfd649af6d.tar.xz
spack-e5dcaebd4317390d261bb15f35458fcfd649af6d.zip
acfl: add compiler-package mapping and fix version number (#36768)
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/compilers/__init__.py2
-rw-r--r--lib/spack/spack/compilers/arm.py15
-rw-r--r--lib/spack/spack/test/compilers/detection.py4
3 files changed, 5 insertions, 16 deletions
diff --git a/lib/spack/spack/compilers/__init__.py b/lib/spack/spack/compilers/__init__.py
index 0027f156c0..b5dc6c4a8f 100644
--- a/lib/spack/spack/compilers/__init__.py
+++ b/lib/spack/spack/compilers/__init__.py
@@ -48,6 +48,7 @@ _compiler_to_pkg = {
"oneapi": "intel-oneapi-compilers",
"rocmcc": "llvm-amdgpu",
"intel@2020:": "intel-oneapi-compilers-classic",
+ "arm": "acfl",
}
# TODO: generating this from the previous dict causes docs errors
@@ -56,6 +57,7 @@ package_name_to_compiler_name = {
"intel-oneapi-compilers": "oneapi",
"llvm-amdgpu": "rocmcc",
"intel-oneapi-compilers-classic": "intel",
+ "acfl": "arm",
}
diff --git a/lib/spack/spack/compilers/arm.py b/lib/spack/spack/compilers/arm.py
index 2975b7d48b..9b4648ec1b 100644
--- a/lib/spack/spack/compilers/arm.py
+++ b/lib/spack/spack/compilers/arm.py
@@ -4,7 +4,6 @@
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
import os
-import re
import spack.compiler
@@ -40,19 +39,7 @@ class Arm(spack.compiler.Compiler):
# InstalledDir:
# /opt/arm/arm-hpc-compiler-19.0_Generic-AArch64_RHEL-7_aarch64-linux/bin
version_argument = "--version"
- version_regex = r"Arm C\/C\+\+\/Fortran Compiler version ([\d\.]+) " r"\(build number (\d+)\) "
-
- @classmethod
- def extract_version_from_output(cls, output):
- """Extracts the version from compiler's output."""
- match = re.search(cls.version_regex, output)
- temp = "unknown"
- if match:
- if match.group(1).count(".") == 1:
- temp = match.group(1) + ".0." + match.group(2)
- else:
- temp = match.group(1) + "." + match.group(2)
- return temp
+ version_regex = r"Arm C\/C\+\+\/Fortran Compiler version ([\d\.]+) "
@property
def verbose_flag(self):
diff --git a/lib/spack/spack/test/compilers/detection.py b/lib/spack/spack/test/compilers/detection.py
index 2d3765aef5..ef1beb1250 100644
--- a/lib/spack/spack/test/compilers/detection.py
+++ b/lib/spack/spack/test/compilers/detection.py
@@ -36,7 +36,7 @@ from spack.operating_systems.cray_frontend import CrayFrontend
"Thread model: posix\n"
"InstalledDir:\n"
"/opt/arm/arm-hpc-compiler-19.0_Generic-AArch64_RHEL-7_aarch64-linux/bin\n",
- "19.0.0.73",
+ "19.0",
),
(
"Arm C/C++/Fortran Compiler version 19.3.1 (build number 75) (based on LLVM 7.0.2)\n"
@@ -44,7 +44,7 @@ from spack.operating_systems.cray_frontend import CrayFrontend
"Thread model: posix\n"
"InstalledDir:\n"
"/opt/arm/arm-hpc-compiler-19.0_Generic-AArch64_RHEL-7_aarch64-linux/bin\n",
- "19.3.1.75",
+ "19.3.1",
),
],
)