From 0df067e64f921d960be70db54a4b8f6727b32a52 Mon Sep 17 00:00:00 2001 From: Frank Willmore Date: Mon, 2 Aug 2021 13:13:32 -0500 Subject: adjust for erroneous detection of nvc as gcc (#24915) * adjust for erroneous detection of nvc as gcc adjust for erroneous detection of nvc as gcc when it is built with gcc * add missing parenthesis :/ * fix trailing whitespace * re-work hdf5 patch for nvc to make it more general * flake8 fixes * Render as comment Render intended note as a comment rather than logical constraint Co-authored-by: Frank Willmore --- var/spack/repos/builtin/packages/hdf5/package.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/hdf5/package.py b/var/spack/repos/builtin/packages/hdf5/package.py index f110700efb..e188bb94b1 100644 --- a/var/spack/repos/builtin/packages/hdf5/package.py +++ b/var/spack/repos/builtin/packages/hdf5/package.py @@ -188,11 +188,12 @@ class Hdf5(CMakePackage): cmake_flags = [] if name == "cflags": - cc_name = os.path.basename(self.compiler.cc) - if "clang" in cc_name or "gcc" in cc_name: + if self.spec.satisfies('%gcc') \ + or self.spec.satisfies('%clang'): # Quiet warnings/errors about implicit declaration of functions # in C99: cmake_flags.append("-Wno-implicit-function-declaration") + # Note that this flag will cause an error if building %nvhpc. if self.spec.satisfies('@:1.8.12~shared'): # More recent versions set CMAKE_POSITION_INDEPENDENT_CODE to # True and build with PIC flags. -- cgit v1.2.3-70-g09d2