From c0ab44ee3b4d3e8cf433862d370252c62a9caece Mon Sep 17 00:00:00 2001
From: Inge Gutheil <i.gutheil@fz-juelich.de>
Date: Thu, 10 Feb 2022 12:24:01 +0100
Subject: [PATCH] SUNDIALS-6.1.0

---
 Custom_EasyBlocks/sundials.py | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
 create mode 100644 Custom_EasyBlocks/sundials.py

diff --git a/Custom_EasyBlocks/sundials.py b/Custom_EasyBlocks/sundials.py
new file mode 100644
index 000000000..a05d08e20
--- /dev/null
+++ b/Custom_EasyBlocks/sundials.py
@@ -0,0 +1,17 @@
+from easybuild.easyblocks.generic.cmakemake import CMakeMake
+from easybuild.tools.modules import get_software_root
+
+class EB_SUNDIALS(CMakeMake):     
+    """Support for building Sundials."""
+
+    def __init__(self, *args, **kwargs):
+        """Custom constructor for SuiteSparse easyblock, initialize custom class parameters."""        
+        super(EB_SUNDIALS, self).__init__(*args, **kwargs)
+
+    def configure_step(self):        
+        cuda = get_software_root('CUDA')
+        if cuda:            
+            cuda_cc_space_sep = self.cfg.template_values['cuda_cc_space_sep'].replace('.','').split()            
+            _max = max(cuda_cc_space_sep)
+            self.cfg['configopts'] += '-DCMAKE_CUDA_ARCHITECTURES=\"%s\"' %_max            
+        super(EB_SUNDIALS, self).configure_step()
-- 
GitLab