dataspaces: move compiler vars to setup_build_environment (#24626)
This commit is contained in:
parent
7ced07a141
commit
f1842f363d
@ -3,9 +3,10 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
from spack import *
|
|
||||||
import six
|
import six
|
||||||
|
|
||||||
|
from spack import *
|
||||||
|
|
||||||
|
|
||||||
def is_string(x):
|
def is_string(x):
|
||||||
"""validate a string"""
|
"""validate a string"""
|
||||||
@ -52,11 +53,20 @@ def autoreconf(self, spec, prefix):
|
|||||||
bash = which('bash')
|
bash = which('bash')
|
||||||
bash('./autogen.sh')
|
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):
|
def configure_args(self):
|
||||||
args = []
|
args = []
|
||||||
cookie = self.spec.variants['gni-cookie'].value
|
cookie = self.spec.variants['gni-cookie'].value
|
||||||
ptag = self.spec.variants['ptag'].value
|
ptag = self.spec.variants['ptag'].value
|
||||||
args.append('CFLAGS={0}'.format(self.compiler.cc_pic_flag))
|
|
||||||
if self.spec.satisfies('+dimes'):
|
if self.spec.satisfies('+dimes'):
|
||||||
args.append('--enable-dimes')
|
args.append('--enable-dimes')
|
||||||
if self.spec.satisfies('+cray-drc'):
|
if self.spec.satisfies('+cray-drc'):
|
||||||
@ -64,7 +74,4 @@ def configure_args(self):
|
|||||||
else:
|
else:
|
||||||
args.append('--with-gni-cookie=%s' % cookie)
|
args.append('--with-gni-cookie=%s' % cookie)
|
||||||
args.append('--with-gni-ptag=%s' % ptag)
|
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
|
return args
|
||||||
|
Loading…
Reference in New Issue
Block a user