diff --git a/var/spack/repos/builtin/packages/strumpack/package.py b/var/spack/repos/builtin/packages/strumpack/package.py index e19aadcff3..9bc99b4737 100644 --- a/var/spack/repos/builtin/packages/strumpack/package.py +++ b/var/spack/repos/builtin/packages/strumpack/package.py @@ -72,7 +72,8 @@ class Strumpack(CMakePackage, CudaPackage, ROCmPackage): depends_on("butterflypack@1.2.0:", when="@4.0.0: +butterflypack+mpi") depends_on("butterflypack@2.1.0:", when="@6.3.0: +butterflypack+mpi") depends_on("cuda", when="@4.0.0: +cuda") - depends_on("zfp", when="+zfp") + depends_on("zfp@0.5.5", when="@:7.0.1 +zfp") + depends_on("zfp", when="@7.0.2: +zfp") depends_on("hipblas", when="+rocm") depends_on("hipsparse", type="link", when="@7.0.1: +rocm") depends_on("rocsolver", when="+rocm") diff --git a/var/spack/repos/builtin/packages/zfp/package.py b/var/spack/repos/builtin/packages/zfp/package.py index 1ef972aa9b..3f80596bc1 100644 --- a/var/spack/repos/builtin/packages/zfp/package.py +++ b/var/spack/repos/builtin/packages/zfp/package.py @@ -18,16 +18,18 @@ class Zfp(CMakePackage, CudaPackage): # Package info homepage = "https://zfp.llnl.gov" - url = "https://github.com/LLNL/zfp/releases/download/0.5.5/zfp-0.5.5.tar.gz" + url = "https://github.com/LLNL/zfp/releases/download/1.0.0/zfp-1.0.0.tar.gz" git = "https://github.com/LLNL/zfp.git" maintainers = ["lindstro", "GarrettDMorrison"] tags = ["radiuss", "e4s"] # Versions version("develop", branch="develop") + version("1.0.0", sha256="0ea08ae3e50e3c92f8b8cf41ba5b6e2de8892bc4a4ca0c59b8945b6c2ab617c4") version("0.5.5", sha256="fdf7b948bab1f4e5dccfe2c2048fd98c24e417ad8fb8a51ed3463d04147393c5") version("0.5.4", sha256="746e17aaa401c67dcffd273d6e6f95c76adfbbd5cf523dcad56d09e9d3b71196") version("0.5.3", sha256="a5d2f8e5b47a7c92e2a5775b82cbfb3a76c87d0ac83d25abb4ac10ea75a2856e") + version( "0.5.2", sha256="9c738ec525cc76b4bb80b2b3f7c9f07507eeda3a341470e5942cda97efbe9a4f", @@ -39,20 +41,29 @@ class Zfp(CMakePackage, CudaPackage): url="https://github.com/LLNL/zfp/archive/0.5.1/zfp-0.5.1.tar.gz", ) + # Dependencies + depends_on("cmake@3.9.0:", type="build") + depends_on("cuda@7:", type=("build", "test", "run"), when="+cuda") + depends_on("python", type=("build", "test", "run"), when="+python") + depends_on("py-numpy", type=("build", "test", "run"), when="+python") + depends_on("py-cython", type="build", when="+python") + # Build targets - # TODO: variant('utilities', default=True, description='Build utilities') variant("shared", default=True, description="Build shared libraries") + variant("utilities", default=True, description="Build zfp utilities") # Language bindings - variant("c", default=False, description="Enable C bindings") - variant("python", default=False, description="Enable Python bindings") - variant("fortran", default=False, description="Enable Fortran bindings") + variant("c", default=False, when="@0.5.4:", description="Enable compressed array C bindings") + variant("python", default=False, when="@0.5.5:", description="Enable Python bindings") + variant("fortran", default=False, when="@0.5.5:", description="Enable Fortran bindings") # Execution policies - variant("openmp", default=False, description="Enable OpenMP execution") - variant("cuda", default=False, description="Enable CUDA execution") + variant("openmp", default=False, when="@0.5.3:", description="Enable OpenMP execution") + variant("cuda", default=False, when="@0.5.4:", description="Enable CUDA execution") + + # Advanced settings + variant("aligned", default=False, description="Enable aligned memory allocation") - # Advanced options variant( "bsws", default="64", @@ -62,55 +73,82 @@ class Zfp(CMakePackage, CudaPackage): "use smaller for finer rate granularity. " "Use 8 for H5Z-ZFP filter.", ) + variant( - "strided", default=False, description="Enable strided access for progressive zfp streams" + "daz", + default=False, + when="@1.0.0:", + description="Denormals are zero: " + "Treat denormal-only blocks as containing " + "all zeroes", ) - variant("aligned", default=False, description="Enable aligned memory allocation") - variant("twoway", default=False, description="Use two-way skew-associative cache") + variant( "fasthash", default=False, + when="@0.5.2:", description="Use a faster but more collision prone hash function", ) - variant("profile", default=False, description="Count cache misses") + + variant("profile", default=False, when="@0.5.2:", description="Count cache misses") + + variant( + "round", + default="never", + values=("never", "first", "last"), + multi=False, + when="@1.0.0:", + description="EXPERIMENTAL: Set coefficient rounding method", + ) + + variant( + "strided", default=False, description="Enable strided access for progressive zfp streams" + ) + + variant( + "tight-error", + default=False, + when="@1.0.0:", + description="EXPERIMENTAL: Use tighter error bound when rounding is enabled", + ) + + variant("twoway", default=False, description="Use two-way skew-associative cache") # Conflicts - conflicts("+c", when="@:0.5.3", msg="+c requires zfp 0.5.4 or later") - conflicts("+python", when="@:0.5.4", msg="+python requires zfp 0.5.5 or later") - conflicts("+fortran", when="@:0.5.4", msg="+fortran requires zfp 0.5.5 or later") - conflicts("+openmp", when="@:0.5.2", msg="+openmp requires zfp 0.5.3 or later") - conflicts("+cuda", when="@:0.5.3", msg="+cuda requires zfp 0.5.4 or later") - conflicts("+fasthash", when="@:0.5.1", msg="+fasthash requires zfp 0.5.2 or later") - conflicts("+profile", when="@:0.5.1", msg="+profile requires zfp 0.5.2 or later") - - # Dependencies - depends_on("cmake@3.4.0:", type="build") - depends_on("cuda@7:", type=("build", "test", "run"), when="+cuda") - depends_on("python", type=("build", "test", "run"), when="+python") - depends_on("py-numpy", type=("build", "test", "run"), when="+python") - depends_on("py-cython", type="build", when="+python") + conflicts( + "+tight-error", + when="round=never", + msg="Using zfp with tight error requires a rounding mode other than never", + ) + # CMake options def cmake_args(self): spec = self.spec - # CMake options args = [ - # TODO: self.define_from_variant('BUILD_UTILITIES', 'utilities'), self.define("BUILD_TESTING", self.run_tests), self.define_from_variant("BUILD_SHARED_LIBS", "shared"), + self.define_from_variant("BUILD_UTILITIES", "utilities"), self.define_from_variant("BUILD_CFP", "c"), self.define_from_variant("BUILD_ZFPY", "python"), self.define_from_variant("BUILD_ZFORP", "fortran"), self.define_from_variant("ZFP_WITH_OPENMP", "openmp"), self.define_from_variant("ZFP_WITH_CUDA", "cuda"), - self.define("ZFP_BIT_STREAM_WORD_SIZE", spec.variants["bsws"].value), - self.define_from_variant("ZFP_WITH_BIT_STREAM_STRIDED", "strided"), self.define_from_variant("ZFP_WITH_ALIGNED_ALLOC", "aligned"), - self.define_from_variant("ZFP_WITH_CACHE_TWOWAY", "twoway"), + self.define("ZFP_BIT_STREAM_WORD_SIZE", spec.variants["bsws"].value), + self.define_from_variant("ZFP_WITH_DAZ", "daz"), self.define_from_variant("ZFP_WITH_CACHE_FAST_HASH", "fasthash"), self.define_from_variant("ZFP_WITH_CACHE_PROFILE", "profile"), + self.define_from_variant("ZFP_WITH_BIT_STREAM_STRIDED", "strided"), + self.define_from_variant("ZFP_WITH_TIGHT_ERROR", "tight-error"), + self.define_from_variant("ZFP_WITH_CACHE_TWOWAY", "twoway"), ] + if "round" in spec.variants: + args.append( + "ZFP_ROUNDING_MODE=ZFP_ROUND_{0}".format(spec.variants["round"].value.upper()) + ) + if "+cuda" in spec: args.append("-DCUDA_BIN_DIR={0}".format(spec["cuda"].prefix.bin))