From 55a3b6436430b0b9515bde6676f5c22a02c7aec4 Mon Sep 17 00:00:00 2001 From: Chia-Jung Hsu Date: Wed, 8 Nov 2023 16:07:50 +0100 Subject: [PATCH] Add an extra_option of `cmake_options` --- easybuild/easyblocks/s/suitesparse.py | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/easybuild/easyblocks/s/suitesparse.py b/easybuild/easyblocks/s/suitesparse.py index 7afd352080..a4bd5be038 100644 --- a/easybuild/easyblocks/s/suitesparse.py +++ b/easybuild/easyblocks/s/suitesparse.py @@ -39,6 +39,7 @@ from distutils.version import LooseVersion from easybuild.easyblocks.generic.configuremake import ConfigureMake +from easybuild.framework.easyconfig import CUSTOM from easybuild.tools.build_log import EasyBuildError from easybuild.tools.filetools import mkdir, write_file from easybuild.tools.modules import get_software_root @@ -49,6 +50,14 @@ class EB_SuiteSparse(ConfigureMake): """Support for building SuiteSparse.""" + @staticmethod + def extra_options(extra_vars=None): + """Define extra easyconfig parameters""" + extra_vars = { + 'cmake_options': ['-DBLA_VENDOR=FlexiBLAS', "CMAKE_OPTIONS used by SuiteSparse since v6.0", CUSTOM], + } + return ConfigureMake.extra_options(extra_vars) + def __init__(self, *args, **kwargs): """Custom constructor for SuiteSparse easyblock, initialize custom class parameters.""" super(EB_SuiteSparse, self).__init__(*args, **kwargs) @@ -172,8 +181,11 @@ def configure_step(self): else: # after v6.0.0, no option for metis, its own metis is used anyway - # nothing to do here, set the CMAKE_OPTIONS in easyconfigs - pass + # set CMAKE_OPTIONS if it is not specified in easyconfigs + # CMAKE_INSTALL_PREFIX is managed by easybuild + base_cmake_options = '-DCMAKE_INSTALL_PREFIX=%s' % self.installdir + cmake_options = " ".join([base_cmake_options, self.cfg['cmake_options']]) + self.cfg.update('preinstallopts', 'CMAKE_OPTIONS="%s"' % cmake_options) def install_step(self): """Install by copying the contents of the builddir to the installdir (preserving permissions)"""