Skip to content

Commit

Permalink
Add an extra_option of cmake_options
Browse files Browse the repository at this point in the history
  • Loading branch information
appolloford authored and c3-builder committed Nov 8, 2023
1 parent c4c52af commit 55a3b64
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions easybuild/easyblocks/s/suitesparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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)"""
Expand Down

0 comments on commit 55a3b64

Please sign in to comment.