parallel-netcdf: fix build with gcc@10: (#16620)

This commit is contained in:
Michael Kuhn 2020-05-13 16:44:50 +02:00 committed by GitHub
parent f6fbf8b8d3
commit 308f016f31
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -95,13 +95,27 @@ def configure_args(self):
args += self.enable_or_disable('cxx') args += self.enable_or_disable('cxx')
args += self.enable_or_disable('fortran') args += self.enable_or_disable('fortran')
flags = {
'CFLAGS': [],
'CXXFLAGS': [],
'FFLAGS': [],
'FCFLAGS': [],
}
if '+pic' in self.spec: if '+pic' in self.spec:
args.extend([ flags['CFLAGS'].append(self.compiler.cc_pic_flag)
'CFLAGS=' + self.compiler.cc_pic_flag, flags['CXXFLAGS'].append(self.compiler.cxx_pic_flag)
'CXXFLAGS=' + self.compiler.cxx_pic_flag, flags['FFLAGS'].append(self.compiler.f77_pic_flag)
'FFLAGS=' + self.compiler.f77_pic_flag, flags['FCFLAGS'].append(self.compiler.fc_pic_flag)
'FCFLAGS=' + 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'): if self.version >= Version('1.8'):
args.append('--enable-relax-coord-bound') args.append('--enable-relax-coord-bound')