I have some code that compiles to .mex and to C++ fine in R2018a, but in R2024b, it errors after running out of memory.

19 次查看(过去 30 天)
I can't post my code on a public place like this. Is there any way this can be done privately?
I have looked at coder.config('mex') and coder.config('lib') for both versions and can't see anything obvious.
  2 个评论
Walter Roberson
Walter Roberson 2024-10-13
You could offer to send links to private repositories on dropbox or google; the question is whether you would get anyone interested who would be willing to sign a Non-Disclosure Agreement for free consultation.
Dr W Kurt
Dr W Kurt 2024-10-14
I went ahead and cut down the codebase to just what fails, then submitted another ASK that includes the testbench, and the subroutine that errors on compile.
Best,
Kurt

请先登录,再进行评论。

采纳的回答

Subhajyoti
Subhajyoti 2024-10-22,7:44
编辑:Subhajyoti 2024-10-22,7:44
It is my understanding that you are able to generate the MEX files for your code. But when you are trying to generate C/C++ files, it is throwing out of memory error.
This error is due to implicit expansion operation occurring during run-time.
Refer to following MathWorks Documentation link to know more about ‘Optimize Implicit Expansion in Generated Code’ in MATLAB:
While generating MEX file, the MATLAB Coder generates C or C++ files (as mentioned in code-generation parameter) and the MEX file acts like an API between MATLAB and the C/C++ file. You can also use these C/C++ files directly as a workaround for code-generation error. The C/C++ build files are generated in the following path:
./codegen/mex/OFDMRxR1/
Additionally, you can refer to the following resources to know more about Analysis and Generation of C/C++ Code from MATLAB Code Using "MATLAB Coder":
  1 个评论
Dr W Kurt
Dr W Kurt 2024-10-22,15:05
Thank you, I will look this over and try the suggestions you mention. I am somewhat surprised because R2018 compiles the exact code to C/C++ without any issues whatsoever.
Best,
Kurt

请先登录,再进行评论。

更多回答(0 个)

产品


版本

R2024b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by