フィルターのクリア

Any trick to generate MEX functions for Linux by using Matlab Coder in Windows?

1 回表示 (過去 30 日間)
Moritz
Moritz 2011 年 6 月 17 日
Hi,
Using Matlab Coder in R2011a, I can generate MEX functions easily in Windows. However my Linux cluster has an older version of Matlab (R2009a). I tried the following approach to generate MEX function for my Linux, but I was unsuccessful:
1)In Windows, I generated C source files by using this configuration in Coder : "output type=MEX function" and ticked "Generate code only".
2) I copied the generated folder to linux, and ran: !make -f myfilename.mk
3) Got the following error : * target pattern contains no `%'. Stop.
Also
mex -v filename.c filename2.c …… was also unsuccessful.
How can I generate MEX functions for my Linux by considering that I have Matlab Coder only in Winodws?
Thanks in advance

回答 (2 件)

John Elliott
John Elliott 2011 年 6 月 17 日
Code generated for one platform will not necessarily work on other platforms because of differences in register sizes etc. Similarly, make files created on one platform almost certainly won't work on another platform because the 'make' tool is different as are compiler and linker flags etc.
You should consider upgrading your Linux system to the current release.
  2 件のコメント
Moritz
Moritz 2011 年 6 月 18 日
Thanks a lot,
What about if I compile my MEX function in Ubuntu and then use it in another distribution of linux like SUSE or Red Hat?
Chirag Gupta
Chirag Gupta 2011 年 6 月 22 日
As long as the architecture remains the same, as well as the MATLAB version, them it should most probably work

サインインしてコメントする。


Alexander Bottema
Alexander Bottema 2011 年 6 月 21 日
Even if you managed to rewrite the generated makefiles for Linux you cannot in general expect MEX code generated in a later version (say R2011a) to be compatible with an earlier version (say R2009a). This is because we generate calls to a runtime library which is version specific. Therefore, some calls in the generated MEX code may refer to functions in R2011a MATLAB runtime system that do not exist in R2009a.

カテゴリ

Help Center および File ExchangeMATLAB Coder についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by