summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYe Luo <yeluo@anl.gov>2021-03-11 03:43:53 -0600
committerGitHub <noreply@github.com>2021-03-11 09:43:53 +0000
commitd0610f7a39c44e919f9bdd147f1cdb351cb6931b (patch)
tree6f184c374df7fd1be6453cbec723f3c0c1d69433
parent31cf0e9c0df80f2dbee27f55ea8e4677457f5350 (diff)
downloadspack-d0610f7a39c44e919f9bdd147f1cdb351cb6931b.tar.gz
spack-d0610f7a39c44e919f9bdd147f1cdb351cb6931b.tar.bz2
spack-d0610f7a39c44e919f9bdd147f1cdb351cb6931b.tar.xz
spack-d0610f7a39c44e919f9bdd147f1cdb351cb6931b.zip
elpa: fix build of versions before 2020 with GCC >= 10 (#22182)
-rw-r--r--var/spack/repos/builtin/packages/elpa/package.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/var/spack/repos/builtin/packages/elpa/package.py b/var/spack/repos/builtin/packages/elpa/package.py
index c05b712900..e65904e871 100644
--- a/var/spack/repos/builtin/packages/elpa/package.py
+++ b/var/spack/repos/builtin/packages/elpa/package.py
@@ -29,7 +29,6 @@ class Elpa(AutotoolsPackage, CudaPackage):
version('2015.11.001', sha256='c0761a92a31c08a4009c9688c85fc3fc8fde9b6ce05e514c3e1587cf045e9eba')
variant('openmp', default=False, description='Activates OpenMP support')
- variant('optflags', default=True, description='Build with optimization flags')
depends_on('mpi')
depends_on('blas')
@@ -88,10 +87,18 @@ class Elpa(AutotoolsPackage, CudaPackage):
if not any(f in spec.target for f in simd_features):
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([
- 'FCFLAGS=-O2 -ffree-line-length-none',
- 'CFLAGS=-O2'
+ 'CFLAGS=' + space_separator.join(gcc_options),
+ 'FCFLAGS=' + space_separator.join(gfortran_options),
])
if '%aocc' in spec: