summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/libxsmm/package.py
diff options
context:
space:
mode:
Diffstat (limited to 'var/spack/repos/builtin/packages/libxsmm/package.py')
-rw-r--r--var/spack/repos/builtin/packages/libxsmm/package.py86
1 files changed, 35 insertions, 51 deletions
diff --git a/var/spack/repos/builtin/packages/libxsmm/package.py b/var/spack/repos/builtin/packages/libxsmm/package.py
index ec1fa2f0bc..0786ec051c 100644
--- a/var/spack/repos/builtin/packages/libxsmm/package.py
+++ b/var/spack/repos/builtin/packages/libxsmm/package.py
@@ -1,41 +1,25 @@
-##############################################################################
-# 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 Todd Gamblin, tgamblin@llnl.gov, 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 *
from glob import glob
-class Libxsmm(Package):
+class Libxsmm(MakefilePackage):
'''Library targeting Intel Architecture
for small, dense or sparse matrix multiplications,
and small convolutions.'''
homepage = 'https://github.com/hfp/libxsmm'
- url = 'https://github.com/hfp/libxsmm/archive/1.8.1.tar.gz'
-
- version('develop', git='https://github.com/hfp/libxsmm.git')
+ url = 'https://github.com/hfp/libxsmm/archive/1.9.tar.gz'
+ git = 'https://github.com/hfp/libxsmm.git'
+ version('develop', branch='master')
+ version('1.9', 'a001a491d9b98239bc2bfd906bd09d90')
+ version('1.8.3', '3415928340929c3a29773934de05c978')
+ version('1.8.2', '8f11ece699244c28dcb6742969a2ccd4')
version('1.8.1', 'ece51ec767580f4542f509655daa5ec0')
version('1.8', '2d513afbdad99e5d04c6c4ab4c9bb25b')
version('1.7.1', 'a938335b1c2c90616dc72c2c1a5824ab')
@@ -60,17 +44,19 @@ class Libxsmm(Package):
description='Unoptimized with call-trace (LIBXSMM_TRACE).')
variant('header-only', default=False,
description='Produce header-only installation')
+ conflicts('+header-only', when='@:1.6.2',
+ msg='Header-only is available since v1.6.2!')
@property
def libs(self):
result = find_libraries(['libxsmm', 'libxsmmf'], root=self.prefix,
- recurse=True)
+ recursive=True)
if len(result) == 0:
result = find_libraries(['libxsmm', 'libxsmmf'], root=self.prefix,
- shared=False, recurse=True)
+ shared=False, recursive=True)
return result
- def patch(self):
+ def edit(self, spec, prefix):
kwargs = {'ignore_absent': False, 'backup': False, 'string': True}
makefile = FileFilter('Makefile.inc')
@@ -83,26 +69,7 @@ class Libxsmm(Package):
makefile.filter('FC = ifort', 'FC ?= ifort', **kwargs)
makefile.filter('FC = gfortran', 'FC ?= gfortran', **kwargs)
- def manual_install(self, prefix):
- spec = self.spec
- install_tree('include', prefix.include)
- if '~header-only' in spec:
- install_tree('lib', prefix.lib)
- doc_path = prefix.share + '/libxsmm/doc'
- mkdirp(doc_path)
- for doc_file in glob('documentation/*.md'):
- install(doc_file, doc_path)
- for doc_file in glob('documentation/*.pdf'):
- install(doc_file, doc_path)
- install('README.md', doc_path)
- install('LICENSE', doc_path)
-
- def install(self, spec, prefix):
- if '+header-only' in spec and '@1.6.2:' not in spec:
- raise InstallError(
- "The variant +header-only is only available " +
- "for versions @1.6.2:")
-
+ def build(self, spec, prefix):
# include symbols by default
make_args = ['SYM=1']
@@ -118,4 +85,21 @@ class Libxsmm(Package):
make_args += ['TRACE=1']
make(*make_args)
- self.manual_install(prefix)
+
+ def install(self, spec, prefix):
+ install_tree('include', prefix.include)
+ if '+header-only' in spec:
+ install_tree('src', prefix.src)
+ else:
+ install_tree('lib', prefix.lib)
+ mkdirp(prefix.doc)
+ for doc_file in glob(join_path('documentation', '*.md')):
+ install(doc_file, prefix.doc)
+ for doc_file in glob(join_path('documentation', '*.pdf')):
+ install(doc_file, prefix.doc)
+ if '@1.8.2:' in spec:
+ install('LICENSE.md', prefix.doc)
+ else:
+ install('README.md', prefix.doc)
+ install('LICENSE', prefix.doc)
+ install('version.txt', prefix.doc)