fix GCC-system without Intel license #3402
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(created using
eb --new-pr
)Python MRO causes trouble here due to multi-inheritance:
SystemCompiler
inherits fromEB_GCC
andEB_ifort
EB_ifort
inherits fromEB_icc
and both fromIntelBase
prepare_step
calls e.g.EB_GCC.prepare_step
super(EB_GCC, self).prepare_step(*args, **kwargs)
prepare_step
inIntelBase
prepare_step
inConfigureMake
IntelBase
) continues, then fails:This is due to the MRO which here is
(<class 'easybuild.easyblocks.generic.systemcompiler.SystemCompiler'>, <class 'easybuild.easyblocks.generic.bundle.Bundle'>, <class 'easybuild.easyblocks.gcc.EB_GCC'>, <class 'easybuild.easyblocks.generic.configuremake.ConfigureMake'>, <class 'easybuild.easyblocks.ifort.EB_ifort'>, <class 'easybuild.easyblocks.icc.EB_icc'>, <class 'easybuild.easyblocks.generic.intelbase.IntelBase'>, <class 'easybuild.framework.easyblock.EasyBlock'>, <class 'object'>)
Only GCC, IntelBase and EasyBlock define a
prepare_step
so going up from GCC the one in IntelBase is called next.If there was one in ConfigureMake that one would be called between GCC and IntelBase.
My solution here is to directly call
ConfigureMake.prepare_step
from GCC which ends inEasyBlock.prepare_step
.This works for now but will cause the same issue if
ConfigureMake.prepare_step
with asuper()
call is added at some point.It also will be a problem if someone inherits (e.g. transitively) from
GCC
and some other class providingprepare_step
and expects both to be called.I can't think of any other easy solution.
Fixes #2815