summaryrefslogblamecommitdiff
path: root/user/spack/archspec-fix-cpu-family-detection.patch
blob: a3979ec95506461bcc8e01251a5809ec2c70f97b (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16















                                                                                                  
See also: https://github.com/archspec/archspec/issues/102

diff --git a/lib/spack/external/archspec/cpu/detect.py b/lib/spack/external/archspec/cpu/detect.py
index a7cc4481f6..cadd593ca2 100644
--- a/lib/spack/external/archspec/cpu/detect.py
+++ b/lib/spack/external/archspec/cpu/detect.py
@@ -92,7 +92,8 @@ def _machine():
 
     # If we are not on Darwin, trust what Python tells us
     if operating_system != "Darwin":
-        return platform.machine()
+        machine = platform.machine()
+        return TARGETS[machine].family.name if machine in TARGETS else machine
 
     # On Darwin it might happen that we are on M1, but using an interpreter
     # built for x86_64. In that case "platform.machine() == 'x86_64'", so we