Reputation: 9701
mcc
can have multiple M files and even MAT files as input when building an executable (command prompt only, my OS is Linux).
According to the documentation the first M file is always regarded as the entrypoint for the executable. I have conducted simple compilation test with a single M file so far and it works.
Now I need to add multiple M files.
Original M file - this file contains a function (e.g. functionXYZ(a1, a2, a3)
)
Wrapper M file - this is a wrapper function (e.g. functionXYZWrapper(workspace)
), which represents the entrypoint of the executable, loads the workspace with the arguments required by the original function, calls it and returns its value(s). It is generated automatically and has the following format:
function res = functionXYZWrapper(workspace)
load(workspace);
res = functionXYZ(a1, a2, a3);
end
The problem is that once I run run_functionXYZWrapper.sh
, which I generated by doing
mcc -mv tests/functionXYZ/functionXYZWrapper.m functionXYZ.m
inside my CI job I receive the following error when I download and run the artifacts from that job:
user$~: ./run_functionXYZWrapper.sh /usr/local/MATLAB/R2018a/ ../test.mat
------------------------------------------
Setting up environment variables
---
LD_LIBRARY_PATH is .:/usr/local/MATLAB/R2018a//runtime/glnxa64:/usr/local/MATLAB/R2018a//bin/glnxa64:/usr/local/MATLAB/R2018a//sys/os/glnxa64:/usr/local/MATLAB/R2018a//sys/opengl/lib/glnxa64
Cannot find an exact (case-sensitive) match for 'functionXYZ'
The closest match is: functionXYZ in /home/user/.mcrCache9.4/getMid1/functionXYZ.m
Error in functionXYZWrapper (line 3)
MATLAB:dispatcher:InexactCaseMatch
I am very new to MATLAB and don't really plan on getting into it. All I would like to do is setup the CI pipeline.
NOTE: I do know that mcc
allows the binding of MAT files when generating the executable. However, there are multiple reasons why I would not like to do that, e.g.
Upvotes: 1
Views: 68
Reputation: 9701
It works. The problem was a small typo in the function call inside the wrapper, e.g. functionxYZ(...)
instead of functionXYZ(...)
.
Upvotes: 0