Skip to content
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
26 changes: 24 additions & 2 deletions easybuild/easyblocks/b/blis.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@
EasyBuild support for BLIS and AOCL-BLAS, implemented as an easyblock

@author: Samuel Moors (Vrije Universiteit Brussel)
@author: Pua Cheng Xuan Frederick (National University of Singapore)
"""
import re

from easybuild.easyblocks.generic.configuremake import ConfigureMake
from easybuild.framework.easyconfig import CUSTOM
from easybuild.tools.build_log import EasyBuildError
from easybuild.tools.modules import MODULE_LOAD_ENV_HEADERS
from easybuild.tools.systemtools import get_shared_lib_ext
from easybuild.tools.systemtools import get_cpu_arch_name, get_shared_lib_ext


class EB_BLIS(ConfigureMake):
Expand All @@ -44,17 +45,38 @@ def extra_options(extra_vars=None):
"""Extra easyconfig parameters."""
extra_vars = {
'cpu_architecture': ['auto', 'CPU architecture (default is autodetect)', CUSTOM],
'enable_cblas': [True, "Enable CBLAS", CUSTOM],
'enable_shared': [True, "Enable builing shared library", CUSTOM],
'threading_implementation': ["openmp", "Multithreading implementation(s) to build for", CUSTOM],
}

return ConfigureMake.extra_options(extra_vars)

def configure_step(self):
"""Custom configopts."""

if self.cfg['enable_cblas']:
self.cfg.update('configopts', '--enable-cblas')

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

if self.toolchain.options.get('openmp', None):
if self.cfg['threading_implementation'] != 'openmp':
error_msg = ("Conflicting multithreading implementations specified: `openmp=True` in `toolchainopts`"
f" vs. `threading_implemenation = {self.cfg['threading_implementation']}`")
raise EasyBuildError(error_msg)
self.cfg.update('configopts', '--enable-threading=openmp')
else:
self.cfg.update('configopts', f"--enable-threading={self.cfg['threading_implementation']}")

self.cfg.update('configopts', f'CC="$CC" {self.cfg["cpu_architecture"]}')

self.cfg.update('configopts', f'--enable-cblas --enable-shared CC="$CC" {self.cfg["cpu_architecture"]}')
# 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 self.version in ('0.9.0', '1.0', '1.1') and arch_name == 'a64fx':
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't have access to an a64fx machine, so i cannot test whether this is also needed for blis 2.0

# see https://github.com/flame/blis/issues/800
self.cfg.update('configopts', 'CFLAGS="$CFLAGS -DCACHE_SECTOR_SIZE_READONLY"')

output = super().configure_step()

Expand Down