diff options
author | Harmen Stoppels <harmenstoppels@gmail.com> | 2021-11-22 22:18:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-22 13:18:39 -0800 |
commit | abec10fcd58abc680b887d1d55d386990073564a (patch) | |
tree | 13e122f9729d37431468cdef45900bbd3f008ba9 /var | |
parent | 6f8fd5b7a7096a1eee29988969197c91f7ba889f (diff) | |
download | spack-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.py | 27 |
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 |