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
This commit is contained in:
parent
28e20313ac
commit
a2afe984c0
@ -25,29 +25,48 @@
|
|||||||
from spack import *
|
from spack import *
|
||||||
|
|
||||||
|
|
||||||
class Zfp(Package):
|
class Zfp(MakefilePackage):
|
||||||
"""zfp is an open source C library for compressed floating-point arrays
|
"""zfp is an open source C library for compressed floating-point arrays
|
||||||
that supports very high throughput read and write random acces,
|
that supports very high throughput read and write random acces,
|
||||||
target error bounds or bit rates. Although bit-for-bit lossless
|
target error bounds or bit rates. Although bit-for-bit lossless
|
||||||
compression is not always possible, zfp is usually accurate to
|
compression is not always possible, zfp is usually accurate to
|
||||||
within machine epsilon in near-lossless mode, and is often orders
|
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"
|
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')
|
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")
|
make("shared")
|
||||||
|
|
||||||
|
def install(self, spec, prefix):
|
||||||
|
incdir = 'include' if spec.satisfies('@0.5.1:') else 'inc'
|
||||||
|
|
||||||
# No install provided
|
# No install provided
|
||||||
mkdirp(prefix.lib)
|
mkdirp(prefix.lib)
|
||||||
mkdirp(prefix.include)
|
mkdirp(prefix.include)
|
||||||
install('lib/libzfp.so', prefix.lib)
|
install('lib/libzfp.so', prefix.lib)
|
||||||
install('inc/zfp.h', prefix.include)
|
install('%s/zfp.h' % incdir, prefix.include)
|
||||||
install('inc/types.h', prefix.include)
|
install('%s/bitstream.h' % incdir, prefix.include)
|
||||||
install('inc/bitstream.h', prefix.include)
|
if spec.satisfies('@0.5.1:'):
|
||||||
install('inc/system.h', prefix.include)
|
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)
|
||||||
|
Loading…
Reference in New Issue
Block a user