Fix mumps compilation with gcc@10 (i.e., gfortran) (#21631)

* add new flag when compiling mumps with %gcc@10.

* Fix style

* Try to fix formatting

* Use flag_handler approach suggested by @michaelkuhn
	in the PR review.

* Delete former approach

* Another style issue

* Add another space

* More fixes
This commit is contained in:
Tom Epperly 2021-02-11 17:14:09 -08:00 committed by GitHub
parent 0724467ad2
commit 58b9c6dadd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -155,8 +155,7 @@ def write_makefile_inc(self):
makefile_conf.extend([ makefile_conf.extend([
'OPTF = %s -O -DALLOW_NON_INIT %s' % ( 'OPTF = %s -O -DALLOW_NON_INIT %s' % (
fpic, fpic,
'-fdefault-integer-8' if using_gcc '-fdefault-integer-8' if using_gcc else '-i8'), # noqa
else '-i8'), # noqa
]) ])
makefile_conf.extend([ makefile_conf.extend([
@ -275,6 +274,15 @@ def write_makefile_inc(self):
makefile_inc = '\n'.join(makefile_conf) makefile_inc = '\n'.join(makefile_conf)
fh.write(makefile_inc) fh.write(makefile_inc)
def flag_handler(self, name, flags):
if name == 'fflags':
if self.spec.satisfies('%gcc@10:'):
if flags is None:
flags = []
flags.append('-fallow-argument-mismatch')
return (flags, None, None)
def install(self, spec, prefix): def install(self, spec, prefix):
self.write_makefile_inc() self.write_makefile_inc()