Add cpu_target variant to openblas (#5090)

This commit is contained in:
healther 2017-09-21 21:28:24 +02:00 committed by scheibelp
parent f39fa2fee9
commit bce26745e3

View file

@ -51,6 +51,10 @@ class Openblas(MakefilePackage):
variant('openmp', default=False, description="Enable OpenMP support.")
variant('pic', default=True, description='Build position independent code')
variant('cpu_target', default='',
description='Set CPU target architecture (leave empty for '
'autodetection; GENERIC, SSE_GENERIC, NEHALEM, ...)')
# virtual dependency
provides('blas')
provides('lapack')
@ -108,8 +112,12 @@ def make_defs(self):
'FC={0}'.format(spack_f77),
'MAKE_NO_J=1'
]
if self.spec.variants['cpu_target'].value:
make_defs += [
'TARGET={0}'.format(self.spec.variants['cpu_target'].value)
]
# invoke make with the correct TARGET for aarch64
if 'aarch64' in spack.architecture.sys_type():
elif 'aarch64' in spack.architecture.sys_type():
make_defs += [
'TARGET=PILEDRIVER',
'TARGET=ARMV8'