Opened 5 years ago

Closed 5 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 Adbdelhak
Priority: blocker Milestone: 1.16.0
Component: Backend Version: v1.14.1
Keywords: Cc: adrien.guironnet@…, Andreas Heuermann

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@… 5 years ago.
Testcase showing the issue

Download all attachments as: .zip

Change History (6)

comment:1 by Francesco Casella, 5 years ago

Cc: Andreas Heuermann added; Karim Adbdelhak removed
Component: *unknown*Backend
Milestone: Future1.16.0
Owner: changed from somebody to Karim Adbdelhak
Priority: highblocker
Status: newassigned

@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 by Andreas Heuermann, 5 years ago

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.

by florentine.rosiere@…, 5 years ago

Attachment: Testcase.zip added

Testcase showing the issue

in reply to:  2 comment:3 by anonymous, 5 years ago

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 by Karim Adbdelhak, 5 years ago

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 by florentine.rosiere@…, 5 years ago

Resolution: fixed
Status: assignedclosed

Works fine. Thanks!

Note: See TracTickets for help on using tickets.