diff options
author | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2021-05-04 07:27:37 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-03 22:27:37 -0700 |
commit | 8a65bcb7c948b07fd1118e82b043533f2d6ff3de (patch) | |
tree | 5784c2683dc13aad1f8218cc2ce70509da742d7d /lib | |
parent | 10389b2b515080d0bd7756e0a96b1fb58ac4c66c (diff) | |
download | spack-8a65bcb7c948b07fd1118e82b043533f2d6ff3de.tar.gz spack-8a65bcb7c948b07fd1118e82b043533f2d6ff3de.tar.bz2 spack-8a65bcb7c948b07fd1118e82b043533f2d6ff3de.tar.xz spack-8a65bcb7c948b07fd1118e82b043533f2d6ff3de.zip |
archspec: updated external dependency (#23311)
Added support for Apple M1, extended support
for zen3 with more compiler flags.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/spack/external/__init__.py | 2 | ||||
-rw-r--r-- | lib/spack/external/archspec/cpu/detect.py | 34 | ||||
-rw-r--r-- | lib/spack/external/archspec/json/cpu/microarchitectures.json | 48 |
3 files changed, 71 insertions, 13 deletions
diff --git a/lib/spack/external/__init__.py b/lib/spack/external/__init__.py index 48c63bea78..ac144c5b4f 100644 --- a/lib/spack/external/__init__.py +++ b/lib/spack/external/__init__.py @@ -11,7 +11,7 @@ archspec * Homepage: https://pypi.python.org/pypi/archspec * Usage: Labeling, comparison and detection of microarchitectures -* Version: 0.1.2 (commit 0389e83e87d3dc5043a7ac08172bd970706524d6) +* Version: 0.1.2 (commit a15485ab632478c15fadc65a00cd88b75ef7528a) argparse -------- diff --git a/lib/spack/external/archspec/cpu/detect.py b/lib/spack/external/archspec/cpu/detect.py index e65076c788..4fe343de8c 100644 --- a/lib/spack/external/archspec/cpu/detect.py +++ b/lib/spack/external/archspec/cpu/detect.py @@ -99,17 +99,29 @@ def sysctl_info_dict(): def sysctl(*args): return _check_output(["sysctl"] + list(args), env=child_environment).strip() - flags = ( - sysctl("-n", "machdep.cpu.features").lower() - + " " - + sysctl("-n", "machdep.cpu.leaf7_features").lower() - ) - info = { - "vendor_id": sysctl("-n", "machdep.cpu.vendor"), - "flags": flags, - "model": sysctl("-n", "machdep.cpu.model"), - "model name": sysctl("-n", "machdep.cpu.brand_string"), - } + if platform.machine() == "x86_64": + flags = ( + sysctl("-n", "machdep.cpu.features").lower() + + " " + + sysctl("-n", "machdep.cpu.leaf7_features").lower() + ) + info = { + "vendor_id": sysctl("-n", "machdep.cpu.vendor"), + "flags": flags, + "model": sysctl("-n", "machdep.cpu.model"), + "model name": sysctl("-n", "machdep.cpu.brand_string"), + } + else: + model = ( + "m1" if "Apple" in sysctl("-n", "machdep.cpu.brand_string") else "unknown" + ) + info = { + "vendor_id": "Apple", + "flags": [], + "model": model, + "CPU implementer": "Apple", + "model name": sysctl("-n", "machdep.cpu.brand_string"), + } return info diff --git a/lib/spack/external/archspec/json/cpu/microarchitectures.json b/lib/spack/external/archspec/json/cpu/microarchitectures.json index 5d1143c495..dc3bab6109 100644 --- a/lib/spack/external/archspec/json/cpu/microarchitectures.json +++ b/lib/spack/external/archspec/json/cpu/microarchitectures.json @@ -1359,9 +1359,24 @@ "popcnt", "clwb", "vaes", - "vpclmulqdq" + "vpclmulqdq", + "pku" ], "compilers": { + "gcc": [ + { + "versions": "10.3:", + "name": "znver3", + "flags": "-march={name} -mtune={name}" + } + ], + "clang": [ + { + "versions": "12.0:", + "name": "znver3", + "flags": "-march={name} -mtune={name}" + } + ], "aocc": [ { "versions": "3.0:", @@ -1544,6 +1559,12 @@ "versions": ":", "flags": "-march=armv8-a -mtune=generic" } + ], + "apple-clang": [ + { + "versions": ":", + "flags": "-march=armv8-a -mtune=generic" + } ] } }, @@ -1752,6 +1773,31 @@ ] } }, + "m1": { + "from": ["aarch64"], + "vendor": "Apple", + "features": [], + "compilers": { + "gcc": [ + { + "versions": "8.0:", + "flags" : "-march=armv8.4-a -mtune=generic" + } + ], + "clang" : [ + { + "versions": "9.0:", + "flags" : "-march=armv8.4-a" + } + ], + "apple-clang": [ + { + "versions": "11.0:", + "flags" : "-march=armv8.4-a" + } + ] + } + }, "arm": { "from": [], "vendor": "generic", |