Is there a known issue compiling the stats toolbox?
1 view (last 30 days)
Show older comments
We're compiling our code as a standalone program, and getting it working has been tricky. From trial and error, we've isolated the problem to a single call to a function in the statistics and machine learning toolbox ('fitcnb'). If I comment out this single line, the code compiles and the program runs; if I don't comment it out, the code compiles but crashes at runtime.
I've seen a couple other questions with issues when compiling the stats toolbox. (Question 1) (Question 2) The only resolution seems to be creating custom functions and avoiding the stats toolbox. This is fine if the functions are simple, but in our case it's a machine learning classifier, and I'd rather not re-write that.
From the current documentation, the stats toolbox is completely supported. However that doesn't seem to be the case. Is this either a known issue with the stats toolbox?
We're using Matlab 2016a, Matlab compiler 9, and OSx 10.11.3.
Edit: To reproduce the error on my machine, I do the following:
% compile the standalone
mcc -m callStatsToolbox.m
% attempt to run the standalone
!./run_callStatsToolbox.sh /Applications/MATLAB/MATLAB_Runtime/v901/
where callStatsToolbox.m is the following function:
function callStatsToolbox()
XX = rand(10^4,5); % make some random data
yy = rand(10^4,1)>0.5; % make random labels
naive_bayes_model = fitcnb(XX,yy);
[predicted_class, score] = predict(naive_bayes_model,XX);
disp('It worked!')
4 Comments
Walter Roberson
on 24 Apr 2017
I took the callStatsToolbox code you posted, and packaged it using Application Compiler, on OS-X El Capitan and R2017a. The only change I made was to convert the disp('It worked!') to a uiwait(msgbox('It worked!')) . There was no difficulty in the building or execution.
Answers (1)
Image Analyst
on 24 Apr 2017
Did you look in mccExcludedFiles.log?
Have you sent the crash log into the Mathworks? They will help you figure out what is crashing the app if you have a current maintenance contract with them.
2 Comments
See Also
Categories
Find more on Introduction to Installation and Licensing in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!