summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorTeodor Nikolov <teodor.nikolov22@gmail.com>2020-04-30 16:05:45 +0200
committerGitHub <noreply@github.com>2020-04-30 16:05:45 +0200
commit9627cbbe1bc116873a0840f486023f0a7ae293c9 (patch)
tree958376db84cfef550e0ea75909f6af0b6c76e252 /var
parent54b71b2b693fd9bac760e164b92952afa7afa4e0 (diff)
downloadspack-9627cbbe1bc116873a0840f486023f0a7ae293c9.tar.gz
spack-9627cbbe1bc116873a0840f486023f0a7ae293c9.tar.bz2
spack-9627cbbe1bc116873a0840f486023f0a7ae293c9.tar.xz
spack-9627cbbe1bc116873a0840f486023f0a7ae293c9.zip
lapackpp and blaspp: added packages (develop branch) (#16373)
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/blaspp/package.py82
-rw-r--r--var/spack/repos/builtin/packages/lapackpp/package.py23
2 files changed, 105 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/blaspp/package.py b/var/spack/repos/builtin/packages/blaspp/package.py
new file mode 100644
index 0000000000..702c33a51f
--- /dev/null
+++ b/var/spack/repos/builtin/packages/blaspp/package.py
@@ -0,0 +1,82 @@
+# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
+# Spack Project Developers. See the top-level COPYRIGHT file for details.
+#
+# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+
+from spack import *
+
+
+class Blaspp(CMakePackage):
+ """BLAS++: C++ API for the Basic Linear Algebra Subroutines (University of
+ Texas)."""
+
+ homepage = "https://bitbucket.org/icl/blaspp"
+ hg = "https://bitbucket.org/icl/blaspp"
+ maintainers = ['teonnik', 'Sely85']
+
+ version('develop', hg=hg, revision="5191c9d")
+
+ variant('gfort',
+ default=False,
+ description=('Use GNU Fortran interface. '
+ 'Default is Intel interface. (MKL)'))
+ variant('ilp64',
+ default=False,
+ description=('Use 64bit integer interface. '
+ 'Default is 32bit. (MKL & ESSL)'))
+ variant('openmp',
+ default=False,
+ description=('Use OpenMP threaded backend. '
+ 'Default is sequential. (MKL & ESSL)'))
+
+ depends_on('blas')
+
+ # 1) The CMake options exposed by `blaspp` allow for a value called `auto`.
+ # The value is not needed here as the choice of dependency in the spec
+ # determines the appropriate flags.
+ #
+ # 2) BLASFinder.cmake handles most options. For `auto`, it searches all
+ # blas libraries listed in `def_lib_list`.
+ #
+ # 3) ?? Custom blas library can be supplied via `BLAS_LIBRARIES`.
+ #
+ def cmake_args(self):
+ spec = self.spec
+ args = ['-DBLASPP_BUILD_TESTS:BOOL={0}'.format(
+ 'ON' if self.run_tests else 'OFF')]
+
+ if '+gfort' in spec:
+ args.append('-DBLAS_LIBRARY_MKL="GNU gfortran conventions"')
+ else:
+ args.append('-DBLAS_LIBRARY_MKL="Intel ifort conventions"')
+
+ if '+ilp64' in spec:
+ args.append('-DBLAS_LIBRARY_INTEGER="int64_t (ILP64)"')
+ else:
+ args.append('-DBLAS_LIBRARY_INTEGER="int (LP64)"')
+
+ if '+openmp' in spec:
+ args.append(['-DUSE_OPENMP=ON',
+ '-DBLAS_LIBRARY_THREADING="threaded"'])
+ else:
+ args.append('-DBLAS_LIBRARY_THREADING="sequential"')
+
+ # Missing:
+ #
+ # - acml : BLAS_LIBRARY="AMD ACML"
+ # BLAS_LIBRARY_THREADING= threaded/sequential
+ #
+ # - apple : BLAS_LIBRARY="Apple Accelerate" (veclibfort ???)
+ #
+ if '^mkl' in spec:
+ args.append('-DBLAS_LIBRARY="Intel MKL"')
+ elif '^essl' in spec:
+ args.append('-DBLAS_LIBRARY="IBM ESSL"')
+ elif '^openblas' in spec:
+ args.append('-DBLAS_LIBRARY="OpenBLAS"')
+ elif '^cray-libsci' in spec:
+ args.append('-DBLAS_LIBRARY="Cray LibSci"')
+ else: # e.g. netlib-lapack
+ args.append('-DBLAS_LIBRARY="generic"')
+
+ return args
diff --git a/var/spack/repos/builtin/packages/lapackpp/package.py b/var/spack/repos/builtin/packages/lapackpp/package.py
new file mode 100644
index 0000000000..1f3ec76924
--- /dev/null
+++ b/var/spack/repos/builtin/packages/lapackpp/package.py
@@ -0,0 +1,23 @@
+# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
+# Spack Project Developers. See the top-level COPYRIGHT file for details.
+#
+# SPDX-License-Identifier: (Apache-2.0 OR MIT)
+
+from spack import *
+
+
+class Lapackpp(CMakePackage):
+ """LAPACK++: C++ API for the Basic Linear Algebra Subroutines (University
+ of Tennessee)"""
+
+ homepage = "https://bitbucket.org/icl/lapackpp"
+ hg = "https://bitbucket.org/icl/lapackpp"
+ maintainers = ['teonnik', 'Sely85']
+
+ version('develop', hg=hg, revision="7ffa486")
+
+ depends_on('blaspp')
+
+ def cmake_args(self):
+ return ['-DBUILD_LAPACKPP_TESTS:BOOL={0}'.format(
+ 'ON' if self.run_tests else 'OFF')]