From b56f464c29c3e316c3afbbde52bf2597ad5351f1 Mon Sep 17 00:00:00 2001 From: Chuck Atkins Date: Mon, 1 Nov 2021 16:31:39 -0400 Subject: [PATCH] GCC 11 fixes (#27122) * adios2: Fix compile errors for gcc 11 * unifyfs: Suppress bogus warnings for gcc 11 * conduit: Fix compile errors for gcc 11 --- var/spack/repos/builtin/packages/adios2/package.py | 5 +++++ var/spack/repos/builtin/packages/conduit/package.py | 5 +++++ var/spack/repos/builtin/packages/unifyfs/package.py | 6 ++++++ 3 files changed, 16 insertions(+) diff --git a/var/spack/repos/builtin/packages/adios2/package.py b/var/spack/repos/builtin/packages/adios2/package.py index e6165f43b6..47ceb714df 100644 --- a/var/spack/repos/builtin/packages/adios2/package.py +++ b/var/spack/repos/builtin/packages/adios2/package.py @@ -129,6 +129,11 @@ class Adios2(CMakePackage): # See https://github.com/ornladios/ADIOS2/pull/2714 patch('2.6-fix-gcc10-symbols.patch', when='@2.6.0') + # Add missing include + # https://github.com/ornladios/adios2/pull/2710 + patch('https://github.com/ornladios/adios2/pull/2710.patch', when='@:2.7.1', + sha256='8d301e8232baf4049b547f22bd73774309662017a62dac36360d2965907062bf') + @when('%fj') def patch(self): """ add fujitsu mpi commands #16864 """ diff --git a/var/spack/repos/builtin/packages/conduit/package.py b/var/spack/repos/builtin/packages/conduit/package.py index a784668d9f..9a01161f12 100644 --- a/var/spack/repos/builtin/packages/conduit/package.py +++ b/var/spack/repos/builtin/packages/conduit/package.py @@ -171,6 +171,11 @@ class Conduit(CMakePackage): # Cmake will support fj compiler and this patch will be removed patch('fj_flags.patch', when='%fj') + # Add missing include for numeric_limits + # https://github.com/LLNL/conduit/pull/773 + patch('https://github.com/LLNL/conduit/pull/773.patch', when='@:0.7.2', + sha256='89d1829ad52f503f6179e43efddf998c239a95c14ca1f248463a3f61ad7d5cf7') + ################################### # build phases used by this package ################################### diff --git a/var/spack/repos/builtin/packages/unifyfs/package.py b/var/spack/repos/builtin/packages/unifyfs/package.py index aca163976b..d4f780a780 100644 --- a/var/spack/repos/builtin/packages/unifyfs/package.py +++ b/var/spack/repos/builtin/packages/unifyfs/package.py @@ -75,6 +75,12 @@ def flag_handler(self, name, flags): self.debug_build = True return (None, None, flags) + def setup_build_environment(self, env): + # GCC11 generates a bogus array bounds error: + # See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98266 + if '%gcc@11' in self.spec: + env.append_flags('CFLAGS', '-Wno-array-bounds') + def configure_args(self): spec = self.spec args = []