Repository navigation
Conversation
The CLI's set_env exports PACE_MCR_VERSION as e.g. 'R2024a' when PACE_MCR_DIR is set, and worker_v4 passes it on to Matlab(matlab_version=...), but the compiled CTFs are keyed by '2024a'. The lookup therefore failed with 'Compiled library for MATLAB version R2024a not found', breaking parallel workers whenever PACE_MCR_DIR was used. Strip a leading 'R' before matching.
get_mlpath derived the runtime version from the mclmcrrt library name by splitting on the first '.', which only works for the Windows name (mclmcrrt24_1.dll). On Linux the library is libmwmclmcrrt.so.24.1, giving an empty version and a KeyError, so PACE_MCR_DIR could not be used with the pace_neutrons or worker_v4 entry points there.
Matlab() now falls back to these environment variables when matlab_path or matlab_version are not given, so a site or container can configure the runtime once instead of every script passing it. When only a path is known, the available versions are checked inside that path rather than in the default search locations. The -d/--matlab-dir option was parsed but never used; it now sets PACE_MCR_DIR. worker_v4 no longer needs to forward PACE_MCR_VERSION itself. The installation docs claimed -d was remembered between runs, which was never implemented; they now describe the environment variables.
mducle
approved these changes
Oct 28, 2026
mducle
left a comment
Member
There was a problem hiding this comment.
Thanks! Changes look good.
The CI failed at the first step to build PACE but with a non-helpful Jenkins error... I'm going to assume it all passes as I don't want to touch Jenkins again and will migrate the CI to self-hosted github actions (at a later date!)
runtime/glnxa64 also holds the libmwmclmcrrt.so symlink, and inside a SIF the glob lists it first, so the version pattern found nothing and pace_neutrons failed with AttributeError. Take the version from the first library name that has one.
Member
Author
|
I've now actually tested this branch in an apptainer SIF image running on ESS VISA; and as far as I can tell everything works (following the minor change in the latest commit). |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This lets a site or container set the MATLAB Runtime location once, through environment variables, instead of every script passing
matlab_pathandmatlab_versiontoMatlab(). It also fixes three bugs that kept the existingPACE_MCR_DIRsupport from working on Linux.We hit these while packaging pace_neutrons in an Apptainer image for ESS's VISA analysis machines. That image sets the runtime location in its environment, and users call
Matlab()with no arguments.Changes
Matlab()readsPACE_MCR_DIRandPACE_MCR_VERSION(76b5cb3)pace_neutrons -d/--matlab-dirwas parsed but never used. It now setsPACE_MCR_DIR.worker_v4no longer passesPACE_MCR_VERSIONon itself, sinceMatlab()reads it.-dlocation is remembered between runs, which was never implemented. They now describe the environment variables instead.Version strings with an
Rprefix are accepted (95183ce)PACE_MCR_DIRis set,pace_neutrons_cli.utils.set_envexportsPACE_MCR_VERSION=R2024a, andworker_v4passed that toMatlab(matlab_version=...). But the CTFs are keyed2024a, so the call failed:PACE_MCR_DIRwas set.Matlab()now strips a leadingR, soR2024aand2024aboth work.The runtime library version is parsed on Linux and macOS (e8299f9)
get_mlpathderived the version by splitting the library name at the first.. That only works for Windows'mclmcrrt24_1.dll.libmwmclmcrrt.so.24.1, which gave an empty string andKeyError: ''. SoPACE_MCR_DIR, and with this PR-d, never worked through thepace_neutronsandworker_v4entry points on Linux.Testing
R2024a/runtime/glnxa64/libmwmclmcrrt.so.24.1.Matlab(matlab_version=...)withR2024a,2024aorr2024Anow gets past the CTF lookup.PACE_MCR_DIRset,Matlab()picks the 2024a CTF and reaches_libpymcr.get_mlpath()returns(<dir>, 'R2024a').