Matlab mcc Warning "Adding path ... to Compiler path instance"
Asked Answered
I

1

6

I'm compiling my matlab .m functions (and mex files) to run as a standalone program on a Linux server. In the end, I manage to compile all files and even run them, although in the process I do get some warnings:

Warning: Adding path "input_folder1" to Compiler path instance.
Warning: Adding path "input_folder2" to Compiler path instance.
Warning: Adding path "input_folder3" to Compiler path instance.

Basically, my question is what is causing these warnings and how can I avoid them?

And, can I run into trouble if I move this standalone program to a different server?

The mcc line that is causing these warnings is:

mcc -m -d output_folder -I input_folder1 -I input_folder2 -I input_folder3 -a mex_file1.mexa64 -a mex_file2.mexa64 MainScriptFile.m SubFunction1.m SubFunction2.m SubFunction3.m
Invasive answered 18/3, 2014 at 9:29 Comment(0)
C
6

These warnings are caused by a missing path. If you want to shut them off, you can either disable them using warning off or add the input_folders to the Compiler path before compiling. But since mcc does that anyway (and displays a warning), you can safely ignore them.

Basically, they're just mcc telling you "Couldn't you have done that to start with? Now I'll have to do it myself...".

I can't answer your second question the way it is worded, so I'll have to go with this: You will not run into trouble caused by these warnings or any implications. If you do run into trouble, it's for a different reason.

Cushman answered 18/3, 2014 at 9:43 Comment(4)
Thanks for the clarification! I thought that the -I input_folders part in the mcc statement was adding these paths to the Compiler path, so I was confused by the warnings. Could you indicate what the correct way is to add these paths to the compiler path before compiling?Invasive
It is indeed strange. Are you using the stand-alone version of the Compiler or the Matlab toolbox version? Maybe it just displays the warnings by default. Have you tried using the -v option to see when exactly the warnings come?Cushman
@Dennis: After some research, it seems this warning is always displayed and is actually more of a notice to let you know what happpens.Cushman
@Cushman seems the case indeed: building the exact same project using mcc from Matlab R2018a we do not get those warnings anymore - so this was probably rather a bug in mcc, because we would get those warnings for a directory which actually was being added to the pathShieh

© 2022 - 2024 — McMap. All rights reserved.