Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mxGetPi is deprecated #127

Open
willGraham01 opened this issue Oct 10, 2022 · 1 comment
Open

mxGetPi is deprecated #127

willGraham01 opened this issue Oct 10, 2022 · 1 comment
Labels
wontfix This will not be worked on

Comments

@willGraham01
Copy link
Collaborator

This will be resolved should #70 be completed.

The mxGetPi function, widely used in iterator.cpp and other places in the codebase, has a deprecated warning. The function should be replaced with it's recommended replacement.

The purpose of this function is to return a pointer (of type mxDouble) to the imaginary components of a complex MATLAB array. Since then, this function is deprecated, with MATLAB recommending the use of mxGetComplexDoubles being called on complex array, which returns a mxComplexDouble * pointing to the complex array that is passed in.

mxComplexDouble has a converter to std::complex<double>, but for the record one accesses mxComplexDouble via mxComplexDouble.real and mxComplexDouble.imag. This is in slight contrast to std::complex<double>, which are just double[2] arrays, and use [0] and [1] to access real and imagainary parts.

@willGraham01
Copy link
Collaborator Author

Writing the unit tests for #136 has given me some more insights about this.

TLDR

We probably just need to accept that we should skip this and move onto finding an alternative HD5 reader. This will render all the MATLAB-API calls to mxGetPi, plus mxGetPr, mxCreateNumericArray, etc redundant.


Including the MATLAB mex headers forces us to use TARGET_API_VERSION=700, which is not recommended with the latest MATLAB release. However, forcing TDMS to use the updated headers (version 800) requires us to flag that the pre-processor macro MX_COMPAT_32 should not be defined. If compiling with mex we can just pass -R2018a as a compile option, but obviously we are not doing that. MATLAB has some instructions on compiling files with compilers other than mex, however these aren't in a great state to apply to TDMS.

@willGraham01 willGraham01 added the wontfix This will not be worked on label Nov 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants