From c0ceece9ccc251a8f9c0dd51b0504bd54d9dfae5 Mon Sep 17 00:00:00 2001 From: Stephen McDowell Date: Wed, 10 May 2017 09:13:14 -0400 Subject: enable cuda support for suite-sparse (#4163) * enable cuda support for suite-sparse * do not use spec.satisfies * cuda restructure, give clearer comment of why * str format compatibility * flake8 checks --- .../repos/builtin/packages/suite-sparse/package.py | 28 +++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'var') diff --git a/var/spack/repos/builtin/packages/suite-sparse/package.py b/var/spack/repos/builtin/packages/suite-sparse/package.py index 375af78a48..ab0df75410 100644 --- a/var/spack/repos/builtin/packages/suite-sparse/package.py +++ b/var/spack/repos/builtin/packages/suite-sparse/package.py @@ -37,8 +37,9 @@ class SuiteSparse(Package): version('4.5.3', '8ec57324585df3c6483ad7f556afccbd') version('4.5.1', 'f0ea9aad8d2d1ffec66a5b6bfeff5319') - variant('tbb', default=False, description='Build with Intel TBB') - variant('pic', default=True, description='Build position independent code (required to link with shared libraries)') + variant('tbb', default=False, description='Build with Intel TBB') + variant('pic', default=True, description='Build position independent code (required to link with shared libraries)') + variant('cuda', default=False, description='Build with CUDA') depends_on('blas') depends_on('lapack') @@ -48,6 +49,8 @@ class SuiteSparse(Package): # flags does not seem to be used, which leads to linking errors on Linux. depends_on('tbb', when='@4.5.3:+tbb') + depends_on('cuda', when='+cuda') + patch('tbb_453.patch', when='@4.5.3:+tbb') def install(self, spec, prefix): @@ -65,19 +68,16 @@ class SuiteSparse(Package): 'CC=%s' % self.compiler.cc, 'CXX=%s' % self.compiler.cxx, 'F77=%s' % self.compiler.f77, - 'CUDA_ROOT =', - 'GPU_BLAS_PATH =', - 'GPU_CONFIG =', - 'CUDA_PATH =', - 'CUDART_LIB =', - 'CUBLAS_LIB =', - 'CUDA_INC_PATH =', - 'NV20 =', - 'NV30 =', - 'NV35 =', - 'NVCC = echo', - 'NVCCFLAGS =', + # CUDA=no does NOT disable cuda, it only disables internal search + # for CUDA_PATH. If in addition the latter is empty, then CUDA is + # completely disabled. See + # [SuiteSparse/SuiteSparse_config/SuiteSparse_config.mk] for more. + 'CUDA=no', + 'CUDA_PATH={0}'.format( + spec['cuda'].prefix if '+cuda' in spec else '' + ) ]) + if '+pic' in spec: make_args.extend([ 'CFLAGS={0}'.format(self.compiler.pic_flag), -- cgit v1.2.3-70-g09d2