From 0d0ab601503c238986a49e0c764639044b393cfe Mon Sep 17 00:00:00 2001 From: "Seth R. Johnson" Date: Thu, 13 Feb 2020 20:45:55 -0500 Subject: Patch silo for %clang@9 (#14892) --- var/spack/repos/builtin/packages/silo/package.py | 26 ++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/silo/package.py b/var/spack/repos/builtin/packages/silo/package.py index 420e8fe59e..ef39dfdaaf 100644 --- a/var/spack/repos/builtin/packages/silo/package.py +++ b/var/spack/repos/builtin/packages/silo/package.py @@ -41,6 +41,32 @@ class Silo(AutotoolsPackage): flags.append('-ldl') return (flags, None, None) + @when('%clang@9:') + def patch(self): + # Clang 9 and later include macro definitions in that conflict + # with typedefs DOMAIN and RANGE used in Silo plugins. + # It looks like the upstream fpzip repo has been fixed, but that change + # hasn't yet made it into silo. + # https://github.com/LLNL/fpzip/blob/master/src/pcmap.h + + def repl(match): + # Change macro-like uppercase to title-case. + return match.group(1).title() + + files_to_filter = [ + "src/fpzip/codec.h", + "src/fpzip/pcdecoder.inl", + "src/fpzip/pcencoder.inl", + "src/fpzip/pcmap.h", + "src/fpzip/pcmap.inl", + "src/fpzip/read.cpp", + "src/fpzip/write.cpp", + "src/hzip/hzmap.h", + "src/hzip/hzresidual.h", + ] + + filter_file(r'\b(DOMAIN|RANGE|UNION)\b', repl, *files_to_filter) + def configure_args(self): spec = self.spec config_args = [ -- cgit v1.2.3-70-g09d2