Opened 4 years ago

Closed 4 years ago

#5916 closed defect (fixed)

Call to external "C" does not work when DAE mode is activated

Reported by: florentine.rosiere@… Owned by: Karim.Abdelhak
Priority: blocker Milestone: 1.16.0
Component: Backend Version: v1.14.1
Keywords: Cc: adrien.guironnet@…, AnHeuermann

Description

Hello,

Compilation fails systematically when DAE mode is activated and a model contains a call to an external C fonction with an additional include:
function myFunc

input Integer a;
external "C" myExternalFunc(a) annotation(Include = "#include \"MyHeader.h\"");

end myFunc;

It seems that the include is not properly added in the generated files.

Please note that it works fine without DAE mode.

Regards,
Florentine ROSIERE

Attachments (1)

Testcase.zip (1.3 KB) - added by florentine.rosiere@… 4 years ago.
Testcase showing the issue

Download all attachments as: .zip

Change History (6)

comment:1 Changed 4 years ago by casella

  • Cc AnHeuermann added; Karim.Abdelhak removed
  • Component changed from *unknown* to Backend
  • Milestone changed from Future to 1.16.0
  • Owner changed from somebody to Karim.Abdelhak
  • Priority changed from high to blocker
  • Status changed from new to assigned

@Karim, @AnHeuermann, this is probably an oversight, can you please check if this is a quick fix? Of course we need external functions in DAE mode as well

comment:2 follow-up: Changed 4 years ago by AnHeuermann

Do you have a minimal working example for me? Like calling a helloWorld-C-function.Then I can have a quick look into it.
I guess either the annotation is lost in the DAE case or copying / compiling / linking is wrong.

Changed 4 years ago by florentine.rosiere@…

Testcase showing the issue

comment:3 in reply to: ↑ 2 Changed 4 years ago by anonymous

Replying to AnHeuermann:

Do you have a minimal working example for me? Like calling a helloWorld-C-function.Then I can have a quick look into it.
I guess either the annotation is lost in the DAE case or copying / compiling / linking is wrong.

Hi,
I added an attachment in the ticket with a minimal example showing the issue.
It works fine without the daeMode flag, and fails with it.
Regards,
Florentine

comment:4 Changed 4 years ago by Karim.Abdelhak

This small commit did the trick for your minimal model. It seems like the full path and the simple name string for includes got mixed up here.

Feel free to close the ticket if it also works for the intended model!

comment:5 Changed 4 years ago by florentine.rosiere@…

  • Resolution set to fixed
  • Status changed from assigned to closed

Works fine. Thanks!

Note: See TracTickets for help on using tickets.