elpa: fix build of versions before 2020 with GCC >= 10 (#22182)

This commit is contained in:
Ye Luo 2021-03-11 03:43:53 -06:00 committed by GitHub
parent 31cf0e9c0d
commit d0610f7a39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,7 +29,6 @@ class Elpa(AutotoolsPackage, CudaPackage):
version('2015.11.001', sha256='c0761a92a31c08a4009c9688c85fc3fc8fde9b6ce05e514c3e1587cf045e9eba') version('2015.11.001', sha256='c0761a92a31c08a4009c9688c85fc3fc8fde9b6ce05e514c3e1587cf045e9eba')
variant('openmp', default=False, description='Activates OpenMP support') variant('openmp', default=False, description='Activates OpenMP support')
variant('optflags', default=True, description='Build with optimization flags')
depends_on('mpi') depends_on('mpi')
depends_on('blas') depends_on('blas')
@ -88,10 +87,18 @@ def configure_args(self):
if not any(f in spec.target for f in simd_features): if not any(f in spec.target for f in simd_features):
options.append('--enable-generic') options.append('--enable-generic')
if '+optflags' in spec: if self.compiler.name == "gcc":
gcc_options = []
gfortran_options = ['-ffree-line-length-none']
if self.compiler.version >= Version("10.0.0") \
and spec.version <= Version("2019.11.001"):
gfortran_options.append('-fallow-argument-mismatch')
space_separator = ' '
options.extend([ options.extend([
'FCFLAGS=-O2 -ffree-line-length-none', 'CFLAGS=' + space_separator.join(gcc_options),
'CFLAGS=-O2' 'FCFLAGS=' + space_separator.join(gfortran_options),
]) ])
if '%aocc' in spec: if '%aocc' in spec: