Skip to content
This repository has been archived by the owner on Mar 22, 2021. It is now read-only.

mxGetPi - mxGetPiIsDeprecated error with Matlab R2018a #31

Open
patrikhuber opened this issue May 13, 2018 · 4 comments
Open

mxGetPi - mxGetPiIsDeprecated error with Matlab R2018a #31

patrikhuber opened this issue May 13, 2018 · 4 comments

Comments

@patrikhuber
Copy link
Contributor

Hi!

I'm getting these two errors when compiling with mexplus with Matlab R2018a.
It seems like the mxGetPi function that is used inside mexplus/mxarray.h is deprecated and no longer available in R2018a.

Error	C3861	'mxGetPiIsDeprecated': identifier not found	eos\3rdparty\mexplus\include\mexplus\mxarray.h	1013	
Error	C3861	'mxGetPiIsDeprecated': identifier not found	eos\3rdparty\mexplus\include\mexplus\mxarray.h	1102	

Is there an easy fix for this?
If not, don't worry too much about it - I am probably going to switch to the new Matlab C++ MEX API pretty soon, as soon as I find the time for it. It's pretty nice. Mathworks finally is giving us C++ bindings after 15+ (?) years of horrible C MEX API. link, link, link.

@kyamagu
Copy link
Owner

kyamagu commented May 13, 2018

@patrikhuber Thanks, it seems Mathworks is updating C API with explicit typed accessors. That would require mexplus implementation update.
https://mathworks.com/help/matlab/matlab_external/c-matrix-api-typed-data-access.html

The new C++ API looks good. Perhaps you can give that a try.

@kyamagu
Copy link
Owner

kyamagu commented May 14, 2018

@AchimTuran
Copy link

The mex command in MATLAB seems to define the macro MX_COMPAT_32 or MEX_DOUBLE_HANDLE to swith back to the old API.

If you already build MEX functions, MEX S-functions, or standalone MATLAB engine and MAT-file applications, then you should review the Do I Need to Upgrade My MEX Files to Use Interleaved Complex API? topic. To help transition your MEX files and S-functions to the interleaved complex API, MATLAB maintains a compatibility interface. To build MEX files with the compatibility interface, use the mex -R2017b flag. If your code processes complex numbers, you might notice a performance impact as MATLAB adapts your data to the interleaved complex format.
The mex command uses the -R2017b API by default. However, in a future version of MATLAB, mex will use the interleaved complex API -R2018a by default and then you need to modify your build command. Therefore, to ensure the desired behavior across versions of MATLAB, add the compatibility flag -R2017b to your build scripts.

Source: https://de.mathworks.com/help/matlab/matlab_external/matlab-support-for-interleaved-complex.html

@kyamagu
Copy link
Owner

kyamagu commented Sep 19, 2018

@AchimTuran Thanks. Unfortunately, I do not have Matlab license anymore and cannot check the compatibility.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants