summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@gmail.com>2021-04-21 10:02:10 +0200
committerGitHub <noreply@github.com>2021-04-21 01:02:10 -0700
commit9a473d6ab368fbeeed408e9063983b60e661a27a (patch)
tree9aa24a6132848962c69aed274a3b8edb7f6fef27 /lib
parent4ee3934fb35ee1c0c169e9fd2851b54192aedb11 (diff)
downloadspack-9a473d6ab368fbeeed408e9063983b60e661a27a.tar.gz
spack-9a473d6ab368fbeeed408e9063983b60e661a27a.tar.bz2
spack-9a473d6ab368fbeeed408e9063983b60e661a27a.tar.xz
spack-9a473d6ab368fbeeed408e9063983b60e661a27a.zip
ASP-based solver: suppress warnings when constructing facts (#23090)
fixes #22786 Trying to get optimization flags for a specific target from a compiler may trigger warnings. In the context of constructing facts for the ASP-based solver we don't want to show these warnings to the user, so here we simply ignore them.
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/solver/asp.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/spack/spack/solver/asp.py b/lib/spack/spack/solver/asp.py
index 712a21b05b..311b0c4753 100644
--- a/lib/spack/spack/solver/asp.py
+++ b/lib/spack/spack/solver/asp.py
@@ -12,6 +12,7 @@ import pprint
import sys
import time
import types
+import warnings
from six import string_types
import archspec.cpu
@@ -1040,7 +1041,9 @@ class SpackSolverSetup(object):
for target in targets:
try:
- target.optimization_flags(compiler_name, compiler_version)
+ with warnings.catch_warnings():
+ warnings.simplefilter("ignore")
+ target.optimization_flags(compiler_name, compiler_version)
supported.append(target)
except archspec.cpu.UnsupportedMicroarchitecture:
continue