summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Becker <becker33@llnl.gov>2019-10-30 17:16:13 -0500
committerGitHub <noreply@github.com>2019-10-30 17:16:13 -0500
commit230c6aa32625cd97a229f82082e4d91f813b696d (patch)
tree482036f79ca6fd6a9c8322cf5d50005bcd25ecf7
parentcf1c38162ebf546266a827badb41145a337e5489 (diff)
downloadspack-230c6aa32625cd97a229f82082e4d91f813b696d.tar.gz
spack-230c6aa32625cd97a229f82082e4d91f813b696d.tar.bz2
spack-230c6aa32625cd97a229f82082e4d91f813b696d.tar.xz
spack-230c6aa32625cd97a229f82082e4d91f813b696d.zip
cpu: fix clang flags for generic x86_64 (#13491)
* cpu: differentiate flags used for pristine LLVM vs. Apple's version
-rw-r--r--lib/spack/llnl/util/cpu/microarchitectures.json17
-rw-r--r--lib/spack/spack/test/architecture.py7
2 files changed, 16 insertions, 8 deletions
diff --git a/lib/spack/llnl/util/cpu/microarchitectures.json b/lib/spack/llnl/util/cpu/microarchitectures.json
index 23cff4bf9a..bb3b4db21a 100644
--- a/lib/spack/llnl/util/cpu/microarchitectures.json
+++ b/lib/spack/llnl/util/cpu/microarchitectures.json
@@ -61,11 +61,18 @@
"flags": "-march={name} -mtune={name}"
}
],
- "clang": {
- "versions": ":",
- "family": "x86-64",
- "flags": "-march={family} -mcpu=generic"
- },
+ "clang": [
+ {
+ "versions": "0.0.0-apple:",
+ "family": "x86-64",
+ "flags": "-march={family}"
+ },
+ {
+ "versions": ":",
+ "family": "x86-64",
+ "flags": "-march={family} -mcpu=generic"
+ }
+ ],
"intel": {
"versions": ":",
"name": "pentium4",
diff --git a/lib/spack/spack/test/architecture.py b/lib/spack/spack/test/architecture.py
index 30aba65214..0a37ef9558 100644
--- a/lib/spack/spack/test/architecture.py
+++ b/lib/spack/spack/test/architecture.py
@@ -176,8 +176,9 @@ def test_arch_spec_container_semantic(item, architecture_str):
('gcc@4.7.2', 'ivybridge', '-march=core-avx-i -mtune=core-avx-i'),
# Check mixed toolchains
('clang@8.0.0', 'broadwell', ''),
+ ('clang@3.5', 'x86_64', '-march=x86-64 -mcpu=generic'),
# Check clang compilers with 'apple' suffix
- ('clang@9.1.0-apple', 'x86_64', '-march=x86-64 -mcpu=generic')
+ ('clang@9.1.0-apple', 'x86_64', '-march=x86-64')
])
@pytest.mark.filterwarnings("ignore:microarchitecture specific")
def test_optimization_flags(
@@ -199,9 +200,9 @@ def test_optimization_flags(
(spack.spec.CompilerSpec('gcc@4.4.0-special'), '9.2.0', 'icelake',
'-march=icelake-client -mtune=icelake-client'),
# Check that the special case for Apple's clang is treated correctly
- # i.e. it won't try to dtect the version again
+ # i.e. it won't try to detect the version again
(spack.spec.CompilerSpec('clang@9.1.0-apple'), None, 'x86_64',
- '-march=x86-64 -mcpu=generic'),
+ '-march=x86-64'),
])
def test_optimization_flags_with_custom_versions(
compiler, real_version, target_str, expected_flags, monkeypatch, config