diff options
Diffstat (limited to 'var/spack/repos/builtin/packages/magma/package.py')
-rw-r--r-- | var/spack/repos/builtin/packages/magma/package.py | 74 |
1 files changed, 40 insertions, 34 deletions
diff --git a/var/spack/repos/builtin/packages/magma/package.py b/var/spack/repos/builtin/packages/magma/package.py index bccac28497..7a28a3bd85 100644 --- a/var/spack/repos/builtin/packages/magma/package.py +++ b/var/spack/repos/builtin/packages/magma/package.py @@ -1,49 +1,40 @@ -############################################################################## -# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC. -# Produced at the Lawrence Livermore National Laboratory. +# Copyright 2013-2018 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. # -# This file is part of Spack. -# Created by Serban Maerean, serban@us.ibm.com, All rights reserved. -# LLNL-CODE-647188 -# -# For details, see https://github.com/spack/spack -# Please also see the NOTICE and LICENSE files for our notice and the LGPL. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License (as -# published by the Free Software Foundation) version 2.1, February 1999. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the IMPLIED WARRANTY OF -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the terms and -# conditions of the GNU Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this program; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -############################################################################## +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + + 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. + """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/" url = "http://icl.cs.utk.edu/projectsfiles/magma/downloads/magma-2.2.0.tar.gz" - version('2.2.0', '6c1ebf4cdf63eb302ff6258ff8c49217') + version('2.4.0', sha256='4eb839b1295405fd29c8a6f5b4ed578476010bf976af46573f80d1169f1f9a4f') + version('2.3.0', sha256='010a4a057d7aa1e57b9426bffc0958f3d06913c9151463737e289e67dd9ea608') + version('2.2.0', sha256='df5d4ace417e5bf52694eae0d91490c6bde4cde1b0da98e8d400c5c3a70d83a2') variant('fortran', default=True, description='Enable Fortran bindings support') + variant('shared', default=True, + description='Enable shared library') + depends_on('blas') depends_on('lapack') - depends_on('cuda@9.0:', when='%gcc@6.0:6.9.9') - depends_on('cuda@8.0:', when='%gcc@5.0:') + depends_on('cuda') + + conflicts('%gcc@6:', when='^cuda@:8') + conflicts('%gcc@7:', when='^cuda@:9') + patch('ibm-xl.patch', when='@2.2:%xl') patch('ibm-xl.patch', when='@2.2:%xl_r') + patch('magma-2.3.0-gcc-4.8.patch', when='@2.3.0%gcc@:4.8') def cmake_args(self): spec = self.spec @@ -52,10 +43,17 @@ class Magma(CMakePackage): options.extend([ '-DCMAKE_INSTALL_PREFIX=%s' % prefix, '-DCMAKE_INSTALL_NAME_DIR:PATH=%s/lib' % prefix, - '-DLAPACK_LIBRARIES=%s;%s' % (spec['blas'].libs, - spec['lapack'].libs) + '-DBLAS_LIBRARIES=%s' % spec['blas'].libs.joined(';'), + # As of MAGMA v2.3.0, CMakeLists.txt does not use the variable + # BLAS_LIBRARIES, but only LAPACK_LIBRARIES, so we need to + # explicitly add blas to LAPACK_LIBRARIES. + '-DLAPACK_LIBRARIES=%s' % + (spec['lapack'].libs + spec['blas'].libs).joined(';') ]) + options += ['-DBUILD_SHARED_LIBS=%s' % + ('ON' if ('+shared' in spec) else 'OFF')] + if '+fortran' in spec: options.extend([ '-DUSE_FORTRAN=yes' @@ -66,8 +64,16 @@ class Magma(CMakePackage): ]) if spec.satisfies('^cuda@9.0:'): - options.extend([ - '-DGPU_TARGET=sm30' - ]) + if '@:2.2.0' in spec: + options.extend(['-DGPU_TARGET=sm30']) + else: + options.extend(['-DGPU_TARGET=sm_30']) return options + + @run_after('install') + def post_install(self): + install('magmablas/atomics.cuh', self.prefix.include) + install('control/magma_threadsetting.h', self.prefix.include) + install('control/pthread_barrier.h', self.prefix.include) + install('control/magma_internal.h', self.prefix.include) |