update MotionCor2 easyblock to consider to locations for built binary#2541
Conversation
|
see also: |
| @staticmethod | ||
| def extra_options(extra_vars=None): | ||
| extra = { | ||
| 'skip_rpath_check': [False, "Skip rpath check", None], |
There was a problem hiding this comment.
I would clarify the help string a bit here, and maybe also rename to skip_rpath_sanity_check
"Skip RPATH sanity check"@stefan-wolfsheimer Can you clarify why you need this option, in which context?
| else: | ||
| raise EasyBuildError( | ||
| "Found multiple, or no, matching MotionCor2 binary named %s*" % self.motioncor2_bin | ||
| "Found multiple, or no, matching MotionCor2 binary named %s" % pattern |
There was a problem hiding this comment.
@stefan-wolfsheimer This is clearly wrong, since there is no variable named pattern....
You probably still want to use self.motioncor2_bin like it was before (and leave the * in place too)?
| if (LooseVersion(self.version) >= LooseVersion("1.4")): | ||
| matches = glob.glob(os.path.join(self.builddir, '%s*' % self.motioncor2_bin)) | ||
| pattern1 = os.path.join(self.builddir, '%s*' % self.motioncor2_bin) | ||
| pattern2 = os.path.join(self.builddir, |
There was a problem hiding this comment.
Maybe this deserves a comment: it seems like you're expecting to find the binary either directly in the build directory, or in a subdirectory named <name>_<version>?
Do you have any idea in which case it's in a subdirectory exactly?
There was a problem hiding this comment.
I just tried to build MotionCor2 and the binary is in a subdirectory in the zipball distributed on https://emcore.ucsf.edu/ucsf-software. As far as I can tell this has changed since v1.4.0, for older version the binary was not in a subdirectory.
There was a problem hiding this comment.
1.4.2 doesn't have a subdir so this needs more specified version checking. Or does that handle both at once?
There was a problem hiding this comment.
hum right... However 1.4.0 does have a subdirectory.
Then I would say @stefan-wolfsheimer was right checking both directly in the build directory and in the subdirectory.
| if not os.path.isfile(fp): | ||
| raise EasyBuildError("File not installed {}".format(fp)) | ||
| if not self.cfg.get('skip_rpath_check', False): | ||
| super(EB_MotionCor2, self).sanity_check_step(custom_paths) |
There was a problem hiding this comment.
There's an easier way to only skip the RPATH sanity check:
def sanity_check_rpath(self, *args, **kwargs):
"""Custom implementation of RPATH sanity check: allow skipping via skip_rpath_sanity_check."""
if self.cfg.get('skip_rpath_sanity_check', False):
self.log.info("Skipping RPATH sanity check, as specified via 'skip_rpath_sanity_check'...")
else:
super(EB_MotionCor2, self).sanity_check_rpath(*args, **kwargs)Then you don't have to partially replicate the sanity check for files yourself either...
And maybe we should make skip_rpath_sanity_check a general easyconfig parameter in framework instead?
| if (LooseVersion(self.version) >= LooseVersion("1.4")): | ||
| matches = glob.glob(os.path.join(self.builddir, '%s*' % self.motioncor2_bin)) | ||
| pattern1 = os.path.join(self.builddir, '%s*' % self.motioncor2_bin) | ||
| pattern2 = os.path.join(self.builddir, |
There was a problem hiding this comment.
1.4.2 doesn't have a subdir so this needs more specified version checking. Or does that handle both at once?
|
|
||
| if (LooseVersion(self.version) >= LooseVersion("1.4")): | ||
| matches = glob.glob(os.path.join(self.builddir, '%s*' % self.motioncor2_bin)) | ||
| matches = glob.glob(os.path.join(self.builddir, '%s_%s' % (self.name, self.version), '%s*' % self.motioncor2_bin)) |
There was a problem hiding this comment.
This is now wrong for 1.4.2
| else: | ||
| raise EasyBuildError( | ||
| "Found multiple, or no, matching MotionCor2 binary named %s*" % self.motioncor2_bin | ||
| "Found multiple, or no, matching MotionCor2 binary named %s or %s" % (pattern1, patter2) |
There was a problem hiding this comment.
And once again, please do not change this.
|
I hope the latest commit answers all comments :)
|
| super(EB_MotionCor2, self).sanity_check_step(custom_paths) | ||
|
|
||
| def sanity_check_rpath(self, *args, **kwargs): | ||
| """Custom implementation of RPATH sanity check: allow skipping via skip_rpath_sanity_check.""" |
There was a problem hiding this comment.
Please add comment on why we need to skip the rpath check
There was a problem hiding this comment.
Actually looking at this again I think this is a workaround for a broader issue with RPATH for binary installs, and it is not the right approach:
- we use RPATH on our supercomputer at SURF, and we usually fix the issues with binary install by customizing the easyconfig (or adding hooks) to run
patchelfcommands to add the missing rpaths in the binary. - this is an issue for all binary installs. Ideally, the rpath check in the case of binary install would also automatically fix the missing rpaths using
patchelf. Howeverpatchelfcannot be used in the easyblock as it is not necessarily available on the system. So we have to do it at the easyconfig level. - In the case of the current PR, this custom
sanity_check_rpathis in my opinion not the right solution. In fact this is a binary install, and theEB_MotionCor2class should derive from thePackedBinaryclass instead of directly from theEasyBlockclass. SincePackedBinaryskips the rpath check, that would remove the need for a customsanity_check_rpath.
A real fix for binary installs using RPATH should in my opinion be implemented in the Binary class rather than in software specific easyblocks, so we should not change the sanity_check_rpath at this level.
@akesandgren: my suggestion is to make EB_MotionCor2 derive from PackedBinary instead of EasyBlock, and remove the custom sanity_check_rpath completely. Does that sound good to you?
There was a problem hiding this comment.
Not sure, I need to check what PackedBinary does. Probably won't have time the coming days/week
There was a problem hiding this comment.
Lets consider that in a separate PR.
|
Test report by @akesandgren Overview of tested easyconfigs (in order)
Build succeeded for 5 out of 5 (5 easyconfigs in total) |
|
@akesandgren which In fact, I agree with Maxime Moge that it may make more sense to derive from Anyway, having |
|
I used my own which is a copy of the old 1.4.2 but with the required changes for use in 10.3.0 toolchain and deps updated accordingly. I.e. one that does not explicitly call unzip -j in the source section. |
|
@casparvl Yes, using PackedBinary is probably a good idea, but as I said before, lets leave that to a separate PR. |
|
Going in, thanks @stefan-wolfsheimer! |
Partial revert of easybuilders#2541: Do not modify `cfg['configopts']` but simply read them and pass the combined result to `run_cmd`. This fixes an issue with templating while iterating over e.g. multiple Pythons and also avoids keeping values in configopts over multiple iterations/builds. Fixes easybuilders#2881
No description provided.