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 @@ def cmake_args(self): '-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 @@ def scalapack_libs(self): 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 @@ def lapack_libs(self): 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'),