latest version is not compatible with R2018a for linux

Michal Kvasnicka 6 years ago updated by Pavel Holoborodko 6 years ago 10

>> mp
Invalid MEX-file '/home/kva/Documents/MATLAB/AdvanpixMCT/mpimpl.mexa64': /home/kva/Documents/MATLAB/AdvanpixMCT/mpimpl.mexa64: undefined symbol:

Error in mp (line 1255)
           if nargin == 0,     this.id = mpimpl(0);             % create mp-entity of default precision

The latest version of AdvanpixMCT is not compatible with Matlab R2018a (linux version). Please could you fix it?

Under review

Hi Michal,

R2018a has introduced massive changes in MEX API. 

(MEX API defines how third-party toolboxes interact with MATLAB's kernel. TMW has changed the API without any thought of backward compatibility and existing third-party toolboxes.)

We are investigating the situation in search for reliable workarounds. I hope to release update soon.

Please use R2017b for the moment.

Hi Pavel, you are right.

I just testing all my MEX files. TMW changed the MEX API so massively, that significant number of third-party MEX files I use (~20% in my case)  does not work with R2018a. This is terrible situation for all third-party matlab toolbox users!!!

I am a bit disappointed, how quietly is TMW  able to change the MEX API, without any warning to all third-party toolbox developers.

Hi Pavel,

during last days I tried to clarify the above mentioned problem with "incompatibility" of your mex file on Matlab R2018a.

If I understand well information available here: https://www.advanpix.com/2013/07/19/undocumented-mex-api

you are using exactly this kind of undocumented functions and recent "incompatibilty" problem with R2018a could be caused by any change in these undocumented functions by TMW. Am I right?

In this case, is very important your statement:

"Please note that there is a risk in using the functions – MathWorks can

change / remove some of them in next versions. It is additional burden
for developer to stay tuned and update their toolboxes on time."

And moreover, undocumented function mxGetPropertyShared is called via C++ API (not via C API which is already exist for this function, but again as undocumented). This is already two serious reasons for potential problems! Direct calling via C interface is definitely more stable in every cases and scenarios.

I fully understand your main reason to choose these undocumented functions to get speed-efficient code. But on the other hand, you should definitely provide more thorough testing with latest Matlab version compatibility. 

Hi Michal,

Well, pre-release version of 2018a didn't have the issues. 

TMW introduced the changes only in the final release without any heads-up for toolbox developers (as they always do).

As for technical side - first of all, thank you for reading our blog :).

Changes in undocumented functions is just tip of the iceberg. In fact, fix is quite trivial for this issue alone.

TMW has also changed: (a) compilers they use for MATLAB, (b) the way they re-destribute CRT, (c) the way they re-distribute Windows API (on Windows they moved to universal CRT, which is compatible only with MSVC2015). These are what I referred to as "massive" changes/incompatibility.

We are working on making toolbox compatible with all these, without loss in speed.

But, still, this is also only part of the equation - unlike to TMW we must be backward compatible with previous versions of MATLAB. Almost every version of MATLAB has its own glitches in MEX interface and now we are including extra workarounds for R2018a.

In any case, updated version of toolbox for Windows is already available for download (was released in the morning).

GNU Linux & MacOSX versions will follow very shortly, if no new surprises will be found.  


Thank you very much for quick response ...!!!

New pre-release version of toolbox for GNU Linux is available for download.

Could you please download and test it with R2018a and older MATLAB(s) you have?

Thank you in advance, this would help us a lot.

Pavel ... well done!!!

New pre-release version 4.4.6 Build 12725 (Linux) works well on Matlab releases R2016b, R2017b and R2018a (Ubuntu 16.04 64bit).

Thanks for your quick response and effort!


P.S. I just solve the same incompatibility problem with TOMLAB toolbox and few other third-party commercial matlab toolboxes :)


Thank you very much for doing the tests! This is very helpful for us.

I just solve the same incompatibility problem with TOMLAB toolbox and few other third-party commercial matlab toolboxes. 

Great! Do you have access to its source code or did you use some different approach?

Thank you and your team for excellent support. Now is MCT again fully compatible with Matlab R2018a.

Thank you for your help! We have just published a changelog for new version: