openblas: add a symbol suffix variant (#27500)
Some packages use a 64_ or _64 symbol suffix for the ilp64 (= 64-bit integers) intefrace for BLAS. In particular if we want to support shim libraries like libopenblastrampoline supporting both the 32 and 64 bit integer version of blas, it must be possible to distinguish between the two.
This commit is contained in:
parent
2765861705
commit
d900abe7e1
@ -49,6 +49,7 @@ class Openblas(MakefilePackage):
|
||||
variant('shared', default=True, description='Build shared libraries')
|
||||
variant('consistent_fpcsr', default=False, description='Synchronize FP CSR between threads (x86/x86_64 only)')
|
||||
variant('bignuma', default=False, description='Enable experimental support for up to 1024 CPUs/Cores and 128 numa nodes')
|
||||
variant('symbol_suffix', default='none', description='Set a symbol suffix')
|
||||
|
||||
variant('locking', default=True, description='Build with thread safety')
|
||||
variant(
|
||||
@ -302,6 +303,10 @@ def make_defs(self):
|
||||
if '+ilp64' in self.spec:
|
||||
make_defs += ['INTERFACE64=1']
|
||||
|
||||
suffix = self.spec.variants['symbol_suffix'].value
|
||||
if suffix != 'none':
|
||||
make_defs += ['SYMBOLSUFFIX={0}'.format(suffix)]
|
||||
|
||||
# Synchronize floating-point control and status register (FPCSR)
|
||||
# between threads (x86/x86_64 only).
|
||||
if '+consistent_fpcsr' in self.spec:
|
||||
@ -338,6 +343,19 @@ def headers(self):
|
||||
# headers.
|
||||
return find_headers(['cblas', 'lapacke'], self.prefix.include)
|
||||
|
||||
@property
|
||||
def libs(self):
|
||||
spec = self.spec
|
||||
|
||||
# Look for openblas{symbol_suffix}
|
||||
name = 'libopenblas'
|
||||
search_shared = bool(spec.variants['shared'].value)
|
||||
suffix = spec.variants['symbol_suffix'].value
|
||||
if suffix != 'none':
|
||||
name += suffix
|
||||
|
||||
return find_libraries(name, spec.prefix, shared=search_shared, recursive=True)
|
||||
|
||||
@property
|
||||
def build_targets(self):
|
||||
targets = ['libs', 'netlib']
|
||||
|
Loading…
Reference in New Issue
Block a user