From 62c27b192476f4b4238b91bd60d9213888a8b03b Mon Sep 17 00:00:00 2001
From: Freifrau von Bleifrei <freifrauvonbleifrei@users.noreply.github.com>
Date: Tue, 7 Nov 2023 23:58:48 +0100
Subject: discotec: add compression variant (#40925)

---
 var/spack/repos/builtin/packages/discotec/package.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/var/spack/repos/builtin/packages/discotec/package.py b/var/spack/repos/builtin/packages/discotec/package.py
index 7693f97c83..31b03bb766 100644
--- a/var/spack/repos/builtin/packages/discotec/package.py
+++ b/var/spack/repos/builtin/packages/discotec/package.py
@@ -18,6 +18,7 @@ class Discotec(CMakePackage):
 
     version("main", branch="main")
 
+    variant("compression", default=False, description="Write sparse grid files compressed")
     variant("ft", default=False, description="DisCoTec with algorithm-based fault tolerance")
     variant("gene", default=False, description="Build for GENE (as task library)")
     variant("hdf5", default=True, description="Interpolation output with HDF5")
@@ -31,6 +32,7 @@ class Discotec(CMakePackage):
     depends_on("cmake@3.24.2:", type="build")
     depends_on("glpk")
     depends_on("highfive+mpi+boost+ipo", when="+hdf5")
+    depends_on("lz4", when="+compression")
     depends_on("mpi")
     depends_on("selalib", when="+selalib")
     depends_on("vtk", when="+vtk")
@@ -38,6 +40,7 @@ class Discotec(CMakePackage):
     def cmake_args(self):
         args = [
             self.define("DISCOTEC_BUILD_MISSING_DEPS", False),
+            self.define_from_variant("DISCOTEC_WITH_COMPRESSION", "compression"),
             self.define_from_variant("DISCOTEC_ENABLEFT", "ft"),
             self.define_from_variant("DISCOTEC_GENE", "gene"),
             self.define_from_variant("DISCOTEC_OPENMP", "openmp"),
-- 
cgit v1.2.3-70-g09d2