summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorHarmen Stoppels <harmenstoppels@gmail.com>2021-11-22 22:18:39 +0100
committerGitHub <noreply@github.com>2021-11-22 13:18:39 -0800
commitabec10fcd58abc680b887d1d55d386990073564a (patch)
tree13e122f9729d37431468cdef45900bbd3f008ba9 /var
parent6f8fd5b7a7096a1eee29988969197c91f7ba889f (diff)
downloadspack-abec10fcd58abc680b887d1d55d386990073564a.tar.gz
spack-abec10fcd58abc680b887d1d55d386990073564a.tar.bz2
spack-abec10fcd58abc680b887d1d55d386990073564a.tar.xz
spack-abec10fcd58abc680b887d1d55d386990073564a.zip
suite-sparse package: add support for blas symbol suffix (#27510)
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/suite-sparse/package.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/suite-sparse/package.py b/var/spack/repos/builtin/packages/suite-sparse/package.py
index ca5fbb6204..070583b72d 100644
--- a/var/spack/repos/builtin/packages/suite-sparse/package.py
+++ b/var/spack/repos/builtin/packages/suite-sparse/package.py
@@ -70,6 +70,30 @@ class SuiteSparse(Package):
conflicts('%gcc@:4.8', when='@5.2.0:', msg='gcc version must be at least 4.9 for suite-sparse@5.2.0:')
+ def symbol_suffix_blas(self, spec, args):
+ """When using BLAS with a special symbol suffix we use defines to
+ replace blas symbols, e.g. dgemm_ becomes dgemm_64_ when
+ symbol_suffix=64_."""
+
+ # Currently only OpenBLAS does this.
+ if not spec.satisfies('^openblas'):
+ return
+
+ suffix = spec['openblas'].variants['symbol_suffix'].value
+ if suffix == 'none':
+ return
+
+ symbols = (
+ 'dtrsv_', 'dgemv_', 'dtrsm_', 'dgemm_', 'dsyrk_', 'dger_', 'dscal_',
+ 'dpotrf_', 'ztrsv_', 'zgemv_', 'ztrsm_', 'zgemm_', 'zherk_',
+ 'zgeru_', 'zscal_', 'zpotrf_',
+ 'dnrm2_', 'dlarf_', 'dlarfg_', 'dlarft_', 'dlarfb_', 'dznrm2_',
+ 'zlarf_', 'zlarfg_', 'zlarft_', 'zlarfb_'
+ )
+
+ for symbol in symbols:
+ args.append('CFLAGS+=-D{0}={1}{2}'.format(symbol, symbol, suffix))
+
def install(self, spec, prefix):
# The build system of SuiteSparse is quite old-fashioned.
# It's basically a plain Makefile which include an header
@@ -125,6 +149,9 @@ class SuiteSparse(Package):
spec.satisfies('^intel-parallel-studio+mkl+ilp64')):
make_args.append('UMFPACK_CONFIG=-DLONGBLAS="long long"')
+ # Handle symbol suffix of some BLAS'es (e.g. 64_ or _64 for ilp64)
+ self.symbol_suffix_blas(spec, make_args)
+
# SuiteSparse defaults to using '-fno-common -fexceptions' in
# CFLAGS, but not all compilers use the same flags for these
# optimizations