How do I create a binary for Linux with MATLAB Coder?

20 ビュー (過去 30 日間)
Tom Engels
Tom Engels 2022 年 1 月 27 日
コメント済み: Tom Engels 2022 年 1 月 31 日
Hello all,
I have written several scripts with functions in MATLAB, which together create a small calculation program.
I was also able to compile these successfully with the MATLAB Coder into C code and into an .exe.
However, I would also like to integrate the calculation program into a Linux-based system (server) and execute it there in a superprogram (javascript).
Since Linux cannot execute an .exe directly, I need a linux binary for the MATLAB code.
I see the following approaches:
1. I compile the C code with GCC directly on my Linux system.
2. I install Wine on the Linux system and can then execute the .exe.
With the direct compilation of the code with MATLAB Coder (Hardware[None - select device below] --> Device [AMD] --> x86-64(Linux 64)) I could also only generate an .exe, which doesn´t run on Linux.
Has anyone had any experience in this regard and can show me a good way to make my code executable under Linux?
Many thanks, greetings
Tom

採用された回答

Mark McBroom
Mark McBroom 2022 年 1 月 29 日
If you are running MATLAB from a linux machine, MATLAB Coder will compile and link the code into a LInux exe that you can run on your linux machine. If your MATLAB is on a Windows machine, then you will need to copy the code to a linux machine and use gcc to compile and link into a linux binary.
  1 件のコメント
Tom Engels
Tom Engels 2022 年 1 月 31 日
Thank you, then I now know two good ways to go!

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

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by