#6407 closed defect (fixed)
The new OpenModelica compiler frontend
Reported by: | Owned by: | Per Östlund | |
---|---|---|---|
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)
by , 4 years ago
Attachment: | OpenPBS.zip added |
---|
comment:1 by , 4 years ago
Component: | Frontend → New Instantiation |
---|---|
Milestone: | NeedsInput → 1.18.0 |
Priority: | normal → blocker |
The package is invalid, there is no package.mo
file in the Manoeuvres director. Can you please fix that first?
comment:2 by , 4 years ago
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 by , 4 years ago
Seems Jenkins is broken once again, so the PR won't be merged for a while.
comment:4 by , 4 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
The PR is now merged in c048acb.
follow-up: 6 comment:5 by , 4 years ago
@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 by , 4 years ago
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:8 by , 4 years ago
The test results didn't show any changes, so I made PR 7278 to port it to maintenance/1.17.
comment:9 by , 4 years ago
@perost, Thanks Per for the fix, The OpenPbs library should now work with the new front end
comment:10 by , 4 years ago
Milestone: | 1.18.0 → 1.17.0 |
---|
a zip file containing the example library.