LIBXSMM 1.8.2 (#6896)
* Included LIBXSMM 1.8 into the list of available versions. * LIBXSMM 1.8.1 * LIBXSMM 1.8.2 (release notes: https://github.com/hfp/libxsmm/releases/tag/1.8.2). * LIBXSMM: Use join_path instead of hard-coding the separator. Install "version.txt" into the documentation directory. Removed installing "README.md" from LIBXSMM's root directory as it overrides README.md provided there. The latter uses correct relative references to the other documentation parts. Note: Apparently, "FC=/path/to/gfortran spack install libxsmm" is currently needed for Spack since does not pick-up the Fortran compiler (but incorrectly uses the C compiler instead). * LIBXSMM: converted Package into MakefilePackage (to address https://github.com/spack/spack/pull/6896#discussion_r160993923). * LIBXSMM: account for changed file set in 1.8.2 onward (addresses https://github.com/spack/spack/pull/6896#pullrequestreview-88670974). * Fixed incorrect behavior of "+header-only", which did not install the "src" folder. Addressed https://github.com/spack/spack/pull/6896#discussion_r162783180 and https://github.com/spack/spack/pull/6896#discussion_r162783221. * Use conflicts msg argument to present a friendly error message.
This commit is contained in:
parent
6170ca863d
commit
202c413ae0
1 changed files with 25 additions and 24 deletions
|
@ -26,16 +26,17 @@
|
|||
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'
|
||||
url = 'https://github.com/hfp/libxsmm/archive/1.8.2.tar.gz'
|
||||
|
||||
version('develop', git='https://github.com/hfp/libxsmm.git')
|
||||
|
||||
version('1.8.2', '8f11ece699244c28dcb6742969a2ccd4')
|
||||
version('1.8.1', 'ece51ec767580f4542f509655daa5ec0')
|
||||
version('1.8', '2d513afbdad99e5d04c6c4ab4c9bb25b')
|
||||
version('1.7.1', 'a938335b1c2c90616dc72c2c1a5824ab')
|
||||
|
@ -60,6 +61,8 @@ 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):
|
||||
|
@ -70,7 +73,7 @@ def libs(self):
|
|||
shared=False, recurse=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 +86,7 @@ def patch(self):
|
|||
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 +102,21 @@ def install(self, spec, prefix):
|
|||
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)
|
||||
|
|
Loading…
Reference in a new issue