diff options
-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) |