diff options
author | Sinan <sbulutw@gmail.com> | 2020-03-27 13:28:54 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-27 15:28:54 -0500 |
commit | 829bfb578814d076000d6d0ad8339143322e28ee (patch) | |
tree | 664c16eaef3428822a6273cb831111f5924e1949 | |
parent | d909c6d89d382773152d0c5320babb98d665296a (diff) | |
download | spack-829bfb578814d076000d6d0ad8339143322e28ee.tar.gz spack-829bfb578814d076000d6d0ad8339143322e28ee.tar.bz2 spack-829bfb578814d076000d6d0ad8339143322e28ee.tar.xz spack-829bfb578814d076000d6d0ad8339143322e28ee.zip |
magma now extends CudaPackage class, taking care of the gcc conflicts (#14471)
* magma now extends CudaPackage class, taking care of the gcc conflicts
* enforce +cuda; thus cuda is dependency via CudaPackage class
* add conflict
* use cuda_arch to set GPU_TARGET build option
* get rid of unnecessary constraint
* flake8
* impose cuda version dependency found empirically
* add variant description
* add conflict
Co-authored-by: Sinan81 <Sinan81@github>
Co-authored-by: Sinan81 <sbulut@3vgeomatics.com>
-rw-r--r-- | var/spack/repos/builtin/packages/magma/package.py | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/var/spack/repos/builtin/packages/magma/package.py b/var/spack/repos/builtin/packages/magma/package.py index 27f2f438e9..2e86463018 100644 --- a/var/spack/repos/builtin/packages/magma/package.py +++ b/var/spack/repos/builtin/packages/magma/package.py @@ -7,10 +7,10 @@ from spack import * -class Magma(CMakePackage): - """The MAGMA project aims to develop a dense linear algebra library similar to - LAPACK but for heterogeneous/hybrid architectures, starting with current - "Multicore+GPU" systems. +class Magma(CMakePackage, CudaPackage): + """The MAGMA project aims to develop a dense linear algebra library similar + to LAPACK but for heterogeneous/hybrid architectures, starting with + current "Multicore+GPU" systems. """ homepage = "http://icl.cs.utk.edu/magma/" @@ -28,13 +28,15 @@ class Magma(CMakePackage): description='Enable Fortran bindings support') variant('shared', default=True, description='Enable shared library') + variant('cuda', default=True, description='Build with CUDA') depends_on('blas') depends_on('lapack') - depends_on('cuda') + depends_on('cuda@8:', when='@2.5.1:') # See PR #14471 - conflicts('%gcc@6:', when='^cuda@:8') - conflicts('%gcc@7:', when='^cuda@:9') + conflicts('~cuda', msg='Magma requires cuda') + conflicts('cuda_arch=none', + msg='Please indicate a CUDA arch value or values') patch('ibm-xl.patch', when='@2.2:2.5.0%xl') patch('ibm-xl.patch', when='@2.2:2.5.0%xl_r') @@ -69,11 +71,14 @@ class Magma(CMakePackage): '-DCMAKE_Fortran_COMPILER=%s' % self.compiler.f77 ]) - if spec.satisfies('^cuda@9.0:'): + if spec.satisfies('^cuda'): + cuda_arch = self.spec.variants['cuda_arch'].value if '@:2.2.0' in spec: - options.extend(['-DGPU_TARGET=sm30']) + capabilities = ' '.join('sm{0}'.format(i) for i in cuda_arch) + options.extend(['-DGPU_TARGET=' + capabilities]) else: - options.extend(['-DGPU_TARGET=sm_30']) + capabilities = ' '.join('sm_{0}'.format(i) for i in cuda_arch) + options.extend(['-DGPU_TARGET=' + capabilities]) if '@2.5.0' in spec: options.extend(['-DMAGMA_SPARSE=OFF']) |