summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeth R. Johnson <johnsonsr@ornl.gov>2020-02-13 20:45:55 -0500
committerGitHub <noreply@github.com>2020-02-13 19:45:55 -0600
commit0d0ab601503c238986a49e0c764639044b393cfe (patch)
tree3e3b033ce32727151f4cb4b2bf67646cfd97748e
parent9046deae80472e1318456ca06d5d1db8fb771993 (diff)
downloadspack-0d0ab601503c238986a49e0c764639044b393cfe.tar.gz
spack-0d0ab601503c238986a49e0c764639044b393cfe.tar.bz2
spack-0d0ab601503c238986a49e0c764639044b393cfe.tar.xz
spack-0d0ab601503c238986a49e0c764639044b393cfe.zip
Patch silo for %clang@9 (#14892)
-rw-r--r--var/spack/repos/builtin/packages/silo/package.py26
1 files changed, 26 insertions, 0 deletions
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 <math.h> 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 = [