diff options
author | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2021-04-21 10:02:10 +0200 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2021-05-22 11:51:20 -0700 |
commit | 8a7bfe97c31b5c5b16dc5a79dba6adbb91c618ea (patch) | |
tree | 01235e1ea5af4962dfdf8933de6af6bde2155249 /lib | |
parent | f1f94ad31abbcbff14fdbb200e86b81cdf339c82 (diff) | |
download | spack-8a7bfe97c31b5c5b16dc5a79dba6adbb91c618ea.tar.gz spack-8a7bfe97c31b5c5b16dc5a79dba6adbb91c618ea.tar.bz2 spack-8a7bfe97c31b5c5b16dc5a79dba6adbb91c618ea.tar.xz spack-8a7bfe97c31b5c5b16dc5a79dba6adbb91c618ea.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.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/spack/spack/solver/asp.py b/lib/spack/spack/solver/asp.py index 9ccbbaf9b1..30de581cbd 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 @@ -1023,7 +1024,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 |