diff options
author | Harmen Stoppels <harmenstoppels@gmail.com> | 2021-11-17 16:52:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-17 08:52:56 -0700 |
commit | d900abe7e10f958765a0e817c4f3b2379b384ece (patch) | |
tree | 980c49979f569bd441fdf111509e3596cc753c19 | |
parent | 2765861705d3f48e8504c2f0b3e26ade6f5a65dc (diff) | |
download | spack-d900abe7e10f958765a0e817c4f3b2379b384ece.tar.gz spack-d900abe7e10f958765a0e817c4f3b2379b384ece.tar.bz2 spack-d900abe7e10f958765a0e817c4f3b2379b384ece.tar.xz spack-d900abe7e10f958765a0e817c4f3b2379b384ece.zip |
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.
-rw-r--r-- | var/spack/repos/builtin/packages/openblas/package.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/openblas/package.py b/var/spack/repos/builtin/packages/openblas/package.py index 0c267eb931..5beb8ce6b1 100644 --- a/var/spack/repos/builtin/packages/openblas/package.py +++ b/var/spack/repos/builtin/packages/openblas/package.py @@ -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 @@ class Openblas(MakefilePackage): 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: @@ -339,6 +344,19 @@ class Openblas(MakefilePackage): 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'] |