From 5a49264e197576d55ef89c1e3452c67cc571b681 Mon Sep 17 00:00:00 2001 From: Tom Payerle Date: Wed, 21 Jul 2021 15:24:51 -0400 Subject: metis: suppress warnings causing issues for %nvhpc builds (#25014) We add compilation flags when using %nvhpc to suppress warnings (which due to global -Werror flag in the build get promoted to errors) for the following: Diagnostic 111: statement is unreachable Diagnostic 177: variable "foo" was declared but never referenced Diagnostic 188: enumerated type mixed with another type Diagnostic 550: variable "foo" was set but never used --- var/spack/repos/builtin/packages/metis/package.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/metis/package.py b/var/spack/repos/builtin/packages/metis/package.py index 36a1336bbd..193b41a6e2 100644 --- a/var/spack/repos/builtin/packages/metis/package.py +++ b/var/spack/repos/builtin/packages/metis/package.py @@ -53,6 +53,17 @@ class Metis(Package): # Ignore warnings/errors re unrecognized omp pragmas on %intel if '%intel@14:' in self.spec: env.append_flags('CFLAGS', '-diag-disable 3180') + # Ignore some warnings to get it to compile with %nvhpc + # 111: statement is unreachable + # 177: variable "foo" was declared but never referenced + # 188: enumerated type mixed with another type + # 550: variable "foo" was set but never used + if '%nvhpc' in self.spec: + env.append_flags('CFLAGS', '--display_error_number') + env.append_flags('CFLAGS', '--diag_suppress 111') + env.append_flags('CFLAGS', '--diag_suppress 177') + env.append_flags('CFLAGS', '--diag_suppress 188') + env.append_flags('CFLAGS', '--diag_suppress 550') @when('@5:') def patch(self): -- cgit v1.2.3-70-g09d2