openblas: add variant +consistentFPCSR (#14876)

Add the OpenBLAS variant `+consistentFPCSR`, by default `False`, which adds the compile definition `CONSISTENT_FPCSR=1` as documented in  OpenBLAS `Makefile.rule`.
This commit is contained in:
Kai Torben Ohlhus 2020-02-14 10:59:34 +09:00 committed by GitHub
parent 690ed2fe98
commit 4fa29ceb50
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -37,6 +37,7 @@ class Openblas(MakefilePackage):
variant('ilp64', default=False, description='Force 64-bit Fortran native integers')
variant('pic', default=True, description='Build position independent code')
variant('shared', default=True, description='Build shared libraries')
variant('consistentFPCSR', default=False, description='Synchronize FP CSR between threads (x86/x86_64 only)')
variant(
'threads', default='none',
@ -234,6 +235,11 @@ def make_defs(self):
if '+ilp64' in self.spec:
make_defs += ['INTERFACE64=1']
# Synchronize floating-point control and status register (FPCSR)
# between threads (x86/x86_64 only).
if '+consistentFPCSR' in self.spec:
make_defs += ['CONSISTENT_FPCSR=1']
# Prevent errors in `as` assembler from newer instructions
if self.spec.satisfies('%gcc@:4.8.4'):
make_defs.append('NO_AVX2=1')