diff --git a/Custom_EasyBlocks/sundials.py b/Custom_EasyBlocks/sundials.py new file mode 100644 index 0000000000000000000000000000000000000000..a05d08e20ddec4efc36c4879ed156057184afc5e --- /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()