Opened 6 years ago
Closed 5 years ago
#4836 closed defect (fixed)
Red warnings show up in OMEdit when using --daeMode=new
Reported by: | casella | Owned by: | wbraun |
---|---|---|---|
Priority: | high | Milestone: | 1.13.0 |
Component: | Code Generation | Version: | |
Keywords: | Cc: | sjoelund.se, adeas31 |
Description
When compiling models with -daeMode=new, I get red lines in the compilation window about this issue:
ScalablePowerGrids.Tests.GridBusSimpleControl_N_1_M_1_16dae.c:2151:1: warning: 'optimize' attribute ignored [-Wattributes] static void (*functionDAERes_systems[3])(DATA *, threadData_t *threadData) = { ^
Please make sure this is fixed before the release.
Change History (6)
comment:1 follow-up: ↓ 3 Changed 6 years ago by wbraun
- Cc sjoelund.se adeas31 added
- Status changed from new to accepted
comment:2 follow-up: ↓ 4 Changed 6 years ago by sjoelund.se
The attributes are added by Susan since compilation is too slow for example for large functions containing simple bindings. I cannot reproduce this in OMEdit or in a terminal.
You can re-compile the OMEdit-generated sources by running:
make -C /tmp/OpenModelica_userName/OMEdit/ModelName/ -f ModelName.makefile
comment:3 in reply to: ↑ 1 Changed 6 years ago by wbraun
Replying to wbraun:
Although it's hard to debug, since OMEdit deletes the sources or I'm just unable to find them.
@adeas31 Does OMEdit delete all sources? Would it possible to suppress that somehow?
Ah, I found the check box "Delete intermediate compilation files".
comment:4 in reply to: ↑ 2 Changed 6 years ago by wbraun
Replying to sjoelund.se:
The attributes are added by Susan since compilation is too slow for example for large functions containing simple bindings. I cannot reproduce this in OMEdit or in a terminal.
It depends on a model and is related to separated partitions. The relevant code looks like:
OMC_DISABLE_OPT static void (*functionDAERes_systems[3])(DATA *, threadData_t *threadData) = { functionDAERes_system0, functionDAERes_system1, functionDAERes_system2 };
comment:5 Changed 6 years ago by sjoelund.se
Ah, yes. If it's split you put the OMC_DISABLE_OPT on functionDAERes_system0, functionDAERes_system1, and functionDAERes_system2 and you can remove it for the array of function pointers.
comment:6 Changed 5 years ago by casella
- Resolution set to fixed
- Status changed from accepted to closed
As of OMEdit v1.13.0-dev-253-g8f7c38ac OMC-v1.13.0-dev-1052-g5c466368f, there are no more red lines in the C code showing up.
Okay, I'm able to reproduce it in OMEdit, but not in a terminal.
Although it's hard to debug, since OMEdit deletes the sources or I'm just unable to find them.
@adeas31 Does OMEdit delete all sources? Would it possible to suppress that somehow?
Also I'm unsure when and where this optimization attributes are added.
@sjoelund.se Can you enlighten me?