summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Kuhn <michael.kuhn@informatik.uni-hamburg.de>2020-05-13 16:44:50 +0200
committerGitHub <noreply@github.com>2020-05-13 16:44:50 +0200
commit308f016f31fda65c50534ef351cc4f7a6405c03d (patch)
treee2653a40ae94b7c82021d03c0dcd99efd71c36d1
parentf6fbf8b8d33f32b5c293fd5f142a31d7582374b6 (diff)
downloadspack-308f016f31fda65c50534ef351cc4f7a6405c03d.tar.gz
spack-308f016f31fda65c50534ef351cc4f7a6405c03d.tar.bz2
spack-308f016f31fda65c50534ef351cc4f7a6405c03d.tar.xz
spack-308f016f31fda65c50534ef351cc4f7a6405c03d.zip
parallel-netcdf: fix build with gcc@10: (#16620)
-rw-r--r--var/spack/repos/builtin/packages/parallel-netcdf/package.py26
1 files changed, 20 insertions, 6 deletions
diff --git a/var/spack/repos/builtin/packages/parallel-netcdf/package.py b/var/spack/repos/builtin/packages/parallel-netcdf/package.py
index dc2f1b4ac3..722efab16e 100644
--- a/var/spack/repos/builtin/packages/parallel-netcdf/package.py
+++ b/var/spack/repos/builtin/packages/parallel-netcdf/package.py
@@ -95,13 +95,27 @@ class ParallelNetcdf(AutotoolsPackage):
args += self.enable_or_disable('cxx')
args += self.enable_or_disable('fortran')
+ flags = {
+ 'CFLAGS': [],
+ 'CXXFLAGS': [],
+ 'FFLAGS': [],
+ 'FCFLAGS': [],
+ }
+
if '+pic' in self.spec:
- args.extend([
- 'CFLAGS=' + self.compiler.cc_pic_flag,
- 'CXXFLAGS=' + self.compiler.cxx_pic_flag,
- 'FFLAGS=' + self.compiler.f77_pic_flag,
- 'FCFLAGS=' + self.compiler.fc_pic_flag,
- ])
+ flags['CFLAGS'].append(self.compiler.cc_pic_flag)
+ flags['CXXFLAGS'].append(self.compiler.cxx_pic_flag)
+ flags['FFLAGS'].append(self.compiler.f77_pic_flag)
+ flags['FCFLAGS'].append(self.compiler.fc_pic_flag)
+
+ # https://github.com/Parallel-NetCDF/PnetCDF/issues/61
+ if self.spec.satisfies('%gcc@10:'):
+ flags['FFLAGS'].append('-fallow-argument-mismatch')
+ flags['FCFLAGS'].append('-fallow-argument-mismatch')
+
+ for key, value in sorted(flags.items()):
+ if value:
+ args.append('{0}={1}'.format(key, ' '.join(value)))
if self.version >= Version('1.8'):
args.append('--enable-relax-coord-bound')