From f1842f363db1e159e7b11fabde88acbb15563695 Mon Sep 17 00:00:00 2001 From: Chuck Atkins Date: Fri, 2 Jul 2021 02:29:17 -0500 Subject: [PATCH] dataspaces: move compiler vars to setup_build_environment (#24626) --- .../builtin/packages/dataspaces/package.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/var/spack/repos/builtin/packages/dataspaces/package.py b/var/spack/repos/builtin/packages/dataspaces/package.py index 9c85b6b804..845a86324e 100644 --- a/var/spack/repos/builtin/packages/dataspaces/package.py +++ b/var/spack/repos/builtin/packages/dataspaces/package.py @@ -3,9 +3,10 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -from spack import * import six +from spack import * + def is_string(x): """validate a string""" @@ -52,11 +53,20 @@ def autoreconf(self, spec, prefix): bash = which('bash') bash('./autogen.sh') + def setup_build_environment(self, env): + if self.spec.satisfies('+mpi'): + env.set('CC', self.spec['mpi'].mpicc) + env.set('FC', self.spec['mpi'].mpifc) + + env.set('CFLAGS', self.compiler.cc_pic_flag) + + if '%gcc@10:' in self.spec: + env.set('FCFLAGS', '-fallow-argument-mismatch') + def configure_args(self): args = [] cookie = self.spec.variants['gni-cookie'].value ptag = self.spec.variants['ptag'].value - args.append('CFLAGS={0}'.format(self.compiler.cc_pic_flag)) if self.spec.satisfies('+dimes'): args.append('--enable-dimes') if self.spec.satisfies('+cray-drc'): @@ -64,7 +74,4 @@ def configure_args(self): else: args.append('--with-gni-cookie=%s' % cookie) args.append('--with-gni-ptag=%s' % ptag) - if self.spec.satisfies('+mpi'): - args.append('CC=%s' % self.spec['mpi'].mpicc) - args.append('FC=%s' % self.spec['mpi'].mpifc) return args