Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add custom easyblock for BLIS #3385

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions easybuild/easyblocks/b/blis.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
"""
Easybuild support for building and installing BLIS, implemented as an easyblock

@author: Pua Cheng Xuan Frederick (National University of Singapore)
"""
from easybuild.easyblocks.generic.configuremake import ConfigureMake
from easybuild.tools.systemtools import get_shared_lib_ext
from easybuild.framework.easyconfig import CUSTOM
from easybuild.tools.systemtools import get_cpu_arch_name


class EB_BLIS(ConfigureMake):
"""Custom easyblock for BLIS"""

@staticmethod
def extra_options():
"""Custom easyconfig parameters for BLIS easyblock."""
extra_vars = {
'enable_cblas': [True, "Enable CBLAS", CUSTOM],
'enable_shared': [True, "Enable builing shared library", CUSTOM],
'multi_threading_type': ["openmp", "Type of multithreading to use", CUSTOM],
}

return ConfigureMake.extra_options(extra_vars)

def configure_step(self):
"""Custom configure step for BLIS."""
if self.cfg['cblas_enable']:
self.cfg.update('configopts', '--enable-cblas')

if self.cfg['shared_enable']:
self.cfg.update('configopts', '--enable-shared')

# arch_name will only be available when archspec is available to easybuild, else arch_name will be unknown
arch_name = get_cpu_arch_name()
if arch_name == "a64fx":
self.cfg.update('configopts', 'CFLAGS="$CFLAGS -DCACHE_SECTOR_SIZE_READONLY"')

self.cfg.update('configopts', '--enable-threading=%s CC="$CC" auto' % self.cfg['multi_threading_type'])

super(EB_BLIS, self).configure_step()

def sanity_check_step(self):
"""Custom sanity check for BLIS"""
shlib_ext = get_shared_lib_ext()

custom_paths = {
'files': ['include/blis/cblas.h', 'include/blis/blis.h',
'lib/libblis.a', 'lib/libblis.%s' % shlib_ext],
'dirs': [],
}
return super(EB_BLIS, self).sanity_check_step(custom_paths=custom_paths)