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
Dennis
  • 149
  • 4

1 Answers1

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.

scenia
  • 1,609
  • 14
  • 33
  • 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? – Dennis Mar 18 '14 at 10:13
  • 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? – scenia Mar 18 '14 at 10:50
  • @Dennis: After some research, it seems this warning is always displayed and is actually more of a notice to let you know what happpens. – scenia Mar 18 '14 at 12:12
  • @scenia 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 path – stijn Aug 24 '18 at 15:15