Compiler and shared C library

1 回表示 (過去 30 日間)
Leor Greenberger
Leor Greenberger 2013 年 6 月 8 日
Hi all,
I am trying to understand how to use the Compiler toolbox to distribute a shared C library. What I currently have in MATLAB is 5 functions, each in its own .m file, and each one can be run essentially as a standalone. That is, you call one of the functions, pass some arguments, it runs for a few minutes and returns some values. I also have a separate directory in the MATLAB path that contains all sorts of functions that I am calling from my 5 main functions. I will refer to this as the '.m library folder'. Some of these I created myself, some I downloaded from FEX. What I want to do is generate each of the 5 functions as a separate C shared library, so that each can be called separately from C. How do I go about doing this? Do I create 5 separate projects in the Compiler toolbox? Do I include the .m library folder with each project or can I compile each of those files separately and link them later?
  2 件のコメント
Walter Roberson
Walter Roberson 2013 年 6 月 8 日
Do you need 5 different entry points to the same library, or do you need 5 different libraries? If you used different libraries the implication would be that each different library would be able to do just one thing and users would have to link multiple libraries if they wanted to be able to call more than one function. If you used one library with 5 entry points, all the code would be in one library and the user could link just the one and use any of the functions from it.
Leor Greenberger
Leor Greenberger 2013 年 6 月 8 日
Thanks Walter. I have to think about this. Another problem I am having is in finding clear and concise documentation for the C programmer on how he can integrate the compiled matlab shared libraries in his C code. He has no knowledge or experience with MATLAB. I downloaded the Compiler toolbox pdf documentation here http://www.mathworks.com/help/pdf_doc/compiler/compiler.pdf but its so disorganized. And it sends you to different documents for various things. For example, it doesn't cover MATLAB data types and their C equivalent.. it refers you to the External Interface document (<http://www.mathworks.com/help/pdf_doc/matlab/apiext.pdf>) under the MEX chapter to learn about data types. And other documents for the MCR API. It's so just confusing and hard to follow. Do you know if there is something written that details everything he has to know in one place? Thanks!

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

回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by