#6407 closed defect (fixed)
The new OpenModelica compiler frontend
Reported by: | toheed.ghandriz@… | Owned by: | perost |
---|---|---|---|
Priority: | blocker | Milestone: | 1.17.0 |
Component: | New Instantiation | Version: | 1.16.2 |
Keywords: | Cc: | arunkumar.palanisamy@… |
Description
Hello,
It is unclear for us why we need to switch to the old frontend for compiling our code. It does not work otherwise.
In the attached code please run for example "OpenPBS.Manoeuvres.Longitudinal.mo"
or other midels in "OpenPBS.Manoeuvres". (I was not able to attach the code here, please contact us!)
The problem is seen in OpenModelica v1.17.0-dev.beta3 (64-bit) and v1.16.2.
Regards,
Toheed Ghandriz
Attachments (1)
Change History (11)
Changed 3 years ago by toheed.ghandriz@…
comment:1 Changed 3 years ago by casella
- Component changed from Frontend to New Instantiation
- Milestone changed from NeedsInput to 1.18.0
- Priority changed from normal to blocker
The package is invalid, there is no package.mo file in the Manoeuvres director. Can you please fix that first?
comment:2 Changed 3 years ago by perost
Fixed in PR 7276.
The issue was due to a pattern like this:
model M parameter Boolean b[2]; equation for i in 1:size(b, 1) loop if i == 1 then if b[i + 1] == false then ... end if; end if; end for; end M;
We flattened the if-equations in a depth-first manner, leading to the frontend trying to evaluate b[3] and failing since b only has two elements. The fix was trivial, just don't flatten equations in if-branches that are discarded.
Replying to casella:
The package is invalid, there is no package.mo file in the Manoeuvres director. Can you please fix that first?
It's fine, it just needs an empty package to work.
comment:3 Changed 3 years ago by perost
Seems Jenkins is broken once again, so the PR won't be merged for a while.
comment:4 Changed 3 years ago by perost
- Resolution set to fixed
- Status changed from new to closed
The PR is now merged in c048acb.
comment:5 follow-up: ↓ 6 Changed 3 years ago by casella
@perost, thanks for the quick fix. Can we port it safely to maintenance/1.17, so it will already be available in 1.17?
comment:6 in reply to: ↑ 5 Changed 3 years ago by perost
Replying to casella:
@perost, thanks for the quick fix. Can we port it safely to maintenance/1.17, so it will already be available in 1.17?
Yes, it should be safe since the fix was just to not flatten equations that were immediately discarded anyway. We should of course wait for the test results, but I can't see how this could break anything.
comment:7 Changed 3 years ago by casella
OK, let's wait for tomorrow's library testsuite results.
comment:8 Changed 3 years ago by perost
The test results didn't show any changes, so I made PR 7278 to port it to maintenance/1.17.
comment:9 Changed 3 years ago by arun3688
@perost, Thanks Per for the fix, The OpenPbs library should now work with the new front end
comment:10 Changed 3 years ago by casella
- Milestone changed from 1.18.0 to 1.17.0
a zip file containing the example library.