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

adopt module_load_environment in PerlModule + custom easyblock for FlexiBLAS #3529

Open
wants to merge 4 commits into
base: 5.0.x
Choose a base branch
from
Open
Show file tree
Hide file tree
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
12 changes: 3 additions & 9 deletions easybuild/easyblocks/f/flexiblas.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ def __init__(self, *args, **kwargs):

self.obj_builddir = os.path.join(self.builddir, 'easybuild_obj')

# custom CPATH to FlexiBLAS headers
self.module_load_environment.CPATH = [os.path.join('include', 'flexiblas')]

def configure_step(self):
"""Custom configuration for FlexiBLAS, based on which BLAS libraries are included as dependencies."""

Expand Down Expand Up @@ -223,12 +226,3 @@ def sanity_check_step(self):
custom_commands.append("flexiblas list | grep %s" % blas_lib.upper())

super(EB_FlexiBLAS, self).sanity_check_step(custom_paths=custom_paths, custom_commands=custom_commands)

def make_module_req_guess(self):
"""Customize CPATH for FlexiBLAS."""

guesses = super(EB_FlexiBLAS, self).make_module_req_guess()

guesses.update({'CPATH': [os.path.join('include', 'flexiblas')]})

return guesses
15 changes: 7 additions & 8 deletions easybuild/easyblocks/generic/perlmodule.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,13 @@ def sanity_check_step(self, *args, **kwargs):
"""
return ExtensionEasyBlock.sanity_check_step(self, EXTS_FILTER_PERL_MODULES, *args, **kwargs)

def make_module_req_guess(self):
"""Customized dictionary of paths to look for with PERL*LIB."""
majver = get_major_perl_version()
def make_module_step(self, *args, **kwargs):
"""
Custom paths to look for with PERL*LIB
"""
perl_lib_var = f"PERL{get_major_perl_version()}LIB"
sitearchsuffix = get_site_suffix('sitearch')
sitelibsuffix = get_site_suffix('sitelib')
setattr(self.module_load_environment, perl_lib_var, ['', sitearchsuffix, sitelibsuffix])

guesses = super(PerlModule, self).make_module_req_guess()
guesses.update({
"PERL%sLIB" % majver: ['', sitearchsuffix, sitelibsuffix],
})
return guesses
return super().make_module_step(*args, **kwargs)
4 changes: 2 additions & 2 deletions easybuild/easyblocks/p/perl.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ def get_major_perl_version():
Returns the major verson of the perl binary in the current path
"""
cmd = "perl -MConfig -e 'print $Config::Config{PERL_API_REVISION}'"
res = run_shell_cmd(cmd)
res = run_shell_cmd(cmd, hidden=True)
return res.output


Expand All @@ -212,7 +212,7 @@ def get_site_suffix(tag):
"""
perl_cmd = 'my $a = $Config::Config{"%s"}; $a =~ s/($Config::Config{"siteprefix"})//; print $a' % tag
cmd = "perl -MConfig -e '%s'" % perl_cmd
res = run_shell_cmd(cmd)
res = run_shell_cmd(cmd, hidden=True)
sitesuffix = res.output
# obtained value usually contains leading '/', so strip it off
return sitesuffix.lstrip(os.path.sep)
Loading