diff options
author | Mark C. Miller <markcmiller86@gmail.com> | 2017-04-07 13:00:32 -0700 |
---|---|---|
committer | Adam J. Stewart <ajstewart426@gmail.com> | 2017-04-07 15:00:32 -0500 |
commit | a2afe984c054f6ecbb21ad0303a8a882544901fb (patch) | |
tree | e967192d42886b90048c1f1116bbefe8b297c554 | |
parent | 28e20313ac5a2a50cdbc4747cd4acbf252ae6ec0 (diff) | |
download | spack-a2afe984c054f6ecbb21ad0303a8a882544901fb.tar.gz spack-a2afe984c054f6ecbb21ad0303a8a882544901fb.tar.bz2 spack-a2afe984c054f6ecbb21ad0303a8a882544901fb.tar.xz spack-a2afe984c054f6ecbb21ad0303a8a882544901fb.zip |
Adding ZFP version 0.5.1 and variant for uint8 bit stream word type (#3753)
* adding 0.5.1 and variant for uint8 bit stream word type
* Revisions as per davydden
* fixing style (flake8) issues
* - switched to derive from MakefilePackage
- fixed typo in variant check
- Confirmed installs correctly with bswtuint8 variant
* added build method; changed zfp_incdir to incdir
-rw-r--r-- | var/spack/repos/builtin/packages/zfp/package.py | 37 |
1 files changed, 28 insertions, 9 deletions
diff --git a/var/spack/repos/builtin/packages/zfp/package.py b/var/spack/repos/builtin/packages/zfp/package.py index a898ab03d3..b2c5fc4e19 100644 --- a/var/spack/repos/builtin/packages/zfp/package.py +++ b/var/spack/repos/builtin/packages/zfp/package.py @@ -25,29 +25,48 @@ from spack import * -class Zfp(Package): +class Zfp(MakefilePackage): """zfp is an open source C library for compressed floating-point arrays that supports very high throughput read and write random acces, target error bounds or bit rates. Although bit-for-bit lossless compression is not always possible, zfp is usually accurate to within machine epsilon in near-lossless mode, and is often orders - of magnitude more accurate than other lossy compressors. - + of magnitude more accurate than other lossy compressors. Versions + of zfp 0.5.1 or newer also support compression of integer data. """ homepage = "http://computation.llnl.gov/projects/floating-point-compression" - url = "http://computation.llnl.gov/projects/floating-point-compression/download/zfp-0.5.0.tar.gz" + url = "http://computation.llnl.gov/projects/floating-point-compression/download/zfp-0.5.1.tar.gz" + version('0.5.1', '0ed7059a9b480635e0dd33745e213d17') version('0.5.0', '2ab29a852e65ad85aae38925c5003654') - def install(self, spec, prefix): + variant('bswtuint8', default=False, + description='Build with bit stream word type of uint8') + + def edit(self, spec, prefix): + if '+bswtuint8' in self.spec: + config_file = FileFilter('Config') + config_file.filter( + '^\s*#\s*DEFS\s*\+=\s*-DBIT_STREAM_WORD_TYPE\s*=\s*uint8', + 'DEFS += -DBIT_STREAM_WORD_TYPE=uint8') + + def build(self, spec, prefix): make("shared") + def install(self, spec, prefix): + incdir = 'include' if spec.satisfies('@0.5.1:') else 'inc' + # No install provided mkdirp(prefix.lib) mkdirp(prefix.include) install('lib/libzfp.so', prefix.lib) - install('inc/zfp.h', prefix.include) - install('inc/types.h', prefix.include) - install('inc/bitstream.h', prefix.include) - install('inc/system.h', prefix.include) + install('%s/zfp.h' % incdir, prefix.include) + install('%s/bitstream.h' % incdir, prefix.include) + if spec.satisfies('@0.5.1:'): + mkdirp('%s/zfp' % prefix.include) + install('%s/zfp/system.h' % incdir, '%s/zfp' % prefix.include) + install('%s/zfp/types.h' % incdir, '%s/zfp' % prefix.include) + else: + install('%s/types.h' % incdir, prefix.include) + install('%s/system.h' % incdir, prefix.include) |