diff --git a/easybuild/easyblocks/f/flexiblas.py b/easybuild/easyblocks/f/flexiblas.py index b3d5129385..feee155280 100644 --- a/easybuild/easyblocks/f/flexiblas.py +++ b/easybuild/easyblocks/f/flexiblas.py @@ -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.""" @@ -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 diff --git a/easybuild/easyblocks/generic/perlmodule.py b/easybuild/easyblocks/generic/perlmodule.py index c3c537f299..7e5d168d76 100644 --- a/easybuild/easyblocks/generic/perlmodule.py +++ b/easybuild/easyblocks/generic/perlmodule.py @@ -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) diff --git a/easybuild/easyblocks/p/perl.py b/easybuild/easyblocks/p/perl.py index 159f755273..de9fe30153 100644 --- a/easybuild/easyblocks/p/perl.py +++ b/easybuild/easyblocks/p/perl.py @@ -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 @@ -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)