rbaleksandar
rbaleksandar

Reputation: 9701

How to internally call function in executable created using MATLAB compiler (MCC) with multiple M function files?

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.

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

Answers (1)

rbaleksandar
rbaleksandar

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

Related Questions