Using rtwmakecfg to tell RTW to use precompiled object instead of S-Function code

Hello,
I try to use rtwmakecfg to define that RTW should use a precompiled object of my C S-function instead of the source code. I tried to use makeInfo.linkLibsObjs as well as the makeInfo.library struct but every time, RTW is looking for the source code of the S-Function. Is there any way to tell RTW, that a S-Function does not need to be compiled but a precompiled object is aready available at a specific location?
Thanks,
Christian

3 commentaires

Are you specifying the S-function binary itself in makeInfo.linkLibsObjs or dependency files? Could you also paste the exact line from your rtwmakecfg.m file?
The name of my S-function is hdlc. It needs an additional library to be linked (helper_funcs) The target-specific extension of compiled objects is .m50 Both precompiled objects are located in S:\src\dSpace\objs\ I tried two ways: First, I used:
makeInfo.linkLibsObjs = {'S:\src\dSpace\objs\hdlc.m50','S:\src\dSpace\objs\helper_func.m50'};
Then, I used:
makeInfo.precompile = 1;
makeInfo.library(1).Name = 'hdlc';
makeInfo.library(1).Location = 'S:\src\dSpace\objs';
makeInfo.library(1).Modules = { 'dummy' };
makeInfo.library(2).Name = 'helper_func';
makeInfo.library(2).Location = 'S:\src\dSpace\objs';
makeInfo.library(2).Modules = { 'dummy' };
Both ways did not work, instead, the makefile still contained the source file of my S-function and therefore, RTW tried to compile it.
Do you see something that might be wrong in my rtwmakecfg?
Hi Christian, I am having the problem in having rti1103.tlc to compile my cpp s-function, I basically try to do the same thing as you asked here. I was wondering how did you compile your source file to an object specific to the RTI(.m50)? I am using RTI1103 and it looks like a need a .m04 object file. Do you use other compiler (VS or mex) to do so? and how?
Thanks

Connectez-vous pour commenter.

Réponses (1)

What is the System Target File that you are using for code-generation? Is it specific to your target (since you are attempting to use a custom object extension, .m50)? Note that the makefile generated for the default targets will look for .obj extensions on Windows and .o on *nix platforms, you will need to provide the appropriate object files.

5 commentaires

I am using the rti1005.tlc/rti1005.tmf that comes with my dSPACE Control Desk installation. I think they can handle the specific extension because I was able to do this: When I compile my model without providing the source code for the S-function, I get an error because of missing sources. When I then copy my precompiled objects into the compiler output directory and compile the model again, the compiler finds the precompiled objects and creates the executable.
I just want to skip the step of copying the precompiled objects manually. rtwmakecfg seems to be the way to do it but I am not able to get it running.
Thank you.
Christian: With the rtwmakecfg.m, I presume the error that you see is only for the S-function file, correct, not for helper_func? I think this may be because the Makefile attempts to compile the S-function source itself before coming to dependencies. Does the S-function have a TLC file associated with it, or is Simulink treating it as a non-inlined S-function?
Christian
Christian le 14 Juin 2013
Modifié(e) : Christian le 19 Juin 2013
Correct, there is no problem with helper_func. There is no TLC file for the S-function. Would this be of any help?
Thanks
I am still struggling with this problem. Basically, I am looking for a way to tell RTW that an S-Function does not need to be compiled but that there is the precompiled object available at a specific location.
Webb Wei
Webb Wei le 19 Août 2016
Modifié(e) : Webb Wei le 21 Août 2016
Hi Christian, I am having the problem in having rti1103.tlc to compile my cpp s-function, I basically try to do the same thing as you asked here. I was wondering how did you compile your source file to an object specific to the RTI(.m50)? I am using RTI1103 and it looks like a need a .m04 object file. Do you use other compiler (VS or mex) to do so? and how?
Thanks

Connectez-vous pour commenter.

Catégories

En savoir plus sur Simulink Coder dans Centre d'aide et File Exchange

Produits

Question posée :

le 7 Juin 2013

Commenté :

le 22 Août 2016

Community Treasure Hunt

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

Start Hunting!

Translated by