summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorjthies <jonas.thies@dlr.de>2018-03-20 09:23:45 -0700
committerAdam J. Stewart <ajstewart426@gmail.com>2018-03-20 11:23:45 -0500
commit35e7b9ac44a28646340df139b07a0b689a0f2edf (patch)
treec999f8fdb37552ddd902d0b2beee014057dc045b /var
parented4640c75b8493bb733879b8582cf0104cc34e69 (diff)
downloadspack-35e7b9ac44a28646340df139b07a0b689a0f2edf.tar.gz
spack-35e7b9ac44a28646340df139b07a0b689a0f2edf.tar.bz2
spack-35e7b9ac44a28646340df139b07a0b689a0f2edf.tar.xz
spack-35e7b9ac44a28646340df139b07a0b689a0f2edf.zip
Ghost as cuda package (#7501)
* add headers property to netlib-lapack and intel-mkl * ghost: fix finding cblas header and libs (at least for mkl and netlib-lapack, which provide headers()) * fix flake8 errors * ghost: remove unnecessary query parameter * fix flake8 errors * ghost: make it a CudaPackage (as suggested by @davydden, thanks!) * ghost: missing whitespace
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/ghost/package.py20
-rw-r--r--var/spack/repos/builtin/packages/intel-mkl/package.py12
-rw-r--r--var/spack/repos/builtin/packages/netlib-lapack/package.py10
3 files changed, 30 insertions, 12 deletions
diff --git a/var/spack/repos/builtin/packages/ghost/package.py b/var/spack/repos/builtin/packages/ghost/package.py
index 8964ee6404..46f884e0f6 100644
--- a/var/spack/repos/builtin/packages/ghost/package.py
+++ b/var/spack/repos/builtin/packages/ghost/package.py
@@ -26,7 +26,7 @@
from spack import *
-class Ghost(CMakePackage):
+class Ghost(CMakePackage, CudaPackage):
"""GHOST: a General, Hybrid and Optimized Sparse Toolkit.
This library provides highly optimized building blocks for implementing
sparse iterative eigenvalue and linear solvers multi- and manycore
@@ -44,8 +44,6 @@ class Ghost(CMakePackage):
description='Enables the build of shared libraries')
variant('mpi', default=True,
description='enable/disable MPI')
- variant('cuda', default=False,
- description='enable/disable CUDA')
variant('scotch', default=False,
description='enable/disable matrix reordering with PT-SCOTCH')
variant('zoltan', default=False,
@@ -58,17 +56,14 @@ class Ghost(CMakePackage):
depends_on('hwloc')
depends_on('blas')
depends_on('mpi', when='+mpi')
- depends_on('cuda@8:', when='+cuda')
depends_on('scotch', when='+scotch')
depends_on('zoltan', when='+zoltan')
def cmake_args(self):
spec = self.spec
- cblas_include_dir = ''
- if '^mkl' not in spec:
- cblas_include_dir = '-DCBLAS_INCLUDE_DIR=' + \
- spec['blas'].prefix.include
-
+ # note: we require the cblas_include_dir property from the blas
+ # provider, this is implemented at least for intel-mkl and
+ # netlib-lapack
args = ['-DGHOST_ENABLE_MPI:BOOL=%s'
% ('ON' if '+mpi' in spec else 'OFF'),
'-DGHOST_USE_CUDA:BOOL=%s'
@@ -78,9 +73,12 @@ class Ghost(CMakePackage):
'-DGHOST_USE_ZOLTAN:BOOL=%s'
% ('ON' if '+zoltan' in spec else 'OFF'),
'-DBUILD_SHARED_LIBS:BOOL=%s'
- % ('ON' if '+shared' in spec else 'OFF'), cblas_include_dir
+ % ('ON' if '+shared' in spec else 'OFF'),
+ '-DCBLAS_INCLUDE_DIR:STRING=%s'
+ % format(spec['blas'].headers.directories[0]),
+ '-DBLAS_LIBRARIES=%s'
+ % spec['blas:c'].libs.joined(';')
]
-
return args
def check(self):
diff --git a/var/spack/repos/builtin/packages/intel-mkl/package.py b/var/spack/repos/builtin/packages/intel-mkl/package.py
index 6cbf355e56..67002bda7f 100644
--- a/var/spack/repos/builtin/packages/intel-mkl/package.py
+++ b/var/spack/repos/builtin/packages/intel-mkl/package.py
@@ -182,6 +182,18 @@ class IntelMkl(IntelPackage):
return libs
+ @property
+ def headers(self):
+ prefix = self.spec.prefix
+ if sys.platform != 'darwin':
+ include_dir = prefix.compilers_and_libraries.linux.mkl.include
+ else:
+ include_dir = prefix.include
+
+ cblas_h = join_path(include_dir, 'mkl_cblas.h')
+ lapacke_h = join_path(include_dir, 'mkl_lapacke.h')
+ return HeaderList([cblas_h, lapacke_h])
+
def setup_dependent_environment(self, spack_env, run_env, dependent_spec):
# set up MKLROOT for everyone using MKL package
if sys.platform == 'darwin':
diff --git a/var/spack/repos/builtin/packages/netlib-lapack/package.py b/var/spack/repos/builtin/packages/netlib-lapack/package.py
index 27d70e9c7a..bc74a99c59 100644
--- a/var/spack/repos/builtin/packages/netlib-lapack/package.py
+++ b/var/spack/repos/builtin/packages/netlib-lapack/package.py
@@ -48,7 +48,8 @@ class NetlibLapack(Package):
version('3.4.0', '02d5706ec03ba885fc246e5fa10d8c70')
version('3.3.1', 'd0d533ec9a5b74933c2a1e84eedc58b4')
- variant('debug', default=False, description='Activates the Debug build type')
+ variant('debug', default=False,
+ description='Activates the Debug build type')
variant('shared', default=True, description="Build shared library version")
variant('external-blas', default=False,
description='Build lapack with an external blas')
@@ -123,6 +124,13 @@ class NetlibLapack(Package):
libraries, root=self.prefix, shared=shared, recursive=True
)
+ @property
+ def headers(self):
+ include_dir = self.spec.prefix.include
+ cblas_h = join_path(include_dir, 'cblas.h')
+ lapacke_h = join_path(include_dir, 'lapacke.h')
+ return HeaderList([cblas_h, lapacke_h])
+
def install_one(self, spec, prefix, shared):
cmake_args = [
'-DBUILD_SHARED_LIBS:BOOL=%s' % ('ON' if shared else 'OFF'),