Opened 5 years ago

Last modified 3 years ago

#5852 new defect

getCommandLineOptions fails with newInst

Reported by: dariomangoni@… Owned by: Per Östlund
Priority: normal Milestone:
Component: New Instantiation Version: v1.16.0-dev
Keywords: getCommandLineOptions newInst Cc: Adrian Pop

Description

call to getCommandLineOptions fails when omc is called with -d=newInst debug option

C:\runtest_oldInst.bat
-d=initialization

C:\runtest_newInst.bat
Error processing file: runtest.mos
# Error encountered! Exiting...
# Please check the error message and the flags.

Execution failed!

To replicate, either:

  • launch runtest.mos with omc -d=newInst
  • use the provided runtest_newInst.bat and runtest_oldInst.bat

Using OpenModelica v1.16.0-dev-189-gf9a0b4816
on Win10

Attachments (1)

newInstGetCommandLineOptions.zip (1.0 KB ) - added by dariomangoni@… 5 years ago.
Minimal example

Download all attachments as: .zip

Change History (7)

by dariomangoni@…, 5 years ago

Minimal example

comment:1 by Francesco Casella, 5 years ago

Component: *unknown*New Instantiation
Milestone: Future1.16.0
Owner: changed from somebody to Per Östlund

comment:2 by Per Östlund, 5 years ago

Cc: Adrian Pop added

The issue is actually the call to sum, getCommandLineOptions works just fine.

The cause is that the old and the new frontend uses different ModelicaBuiltin modules, where most builtin functions and such are defined. When calling the compiler with -d=newInst it will load the ModelicaBuiltin module for the new frontend, but the evaluation of script expressions is still done using the old frontend.

The reason why there are two ModelicaBuiltin modules is simply because some definitions are incompatible between the old and the new frontend, which causes the evaluation of sum to fail in this case.

I'm not sure what the best solution is in this case. Rewriting the script evaluator to use the new frontend will be necessary sooner or later, but will be a lot of work and bring with it its own set of issues. One possible temporary solution would be to change the SCode cache to allow the builtin definitions for both the old and the new frontend to be loaded at the same time.

Any comments on this @adrpo?

comment:3 by Adrian Pop, 5 years ago

Yeah, we would need to load both *ModelicaBuiltin.mo files and have two different initial environments. One to be selected if -d=newInst is on, the other one to be selected if we go into the interactive environment evaluation.

comment:4 by Francesco Casella, 4 years ago

Milestone: 1.16.01.17.0

Retargeted to 1.17.0 after 1.16.0 release

comment:5 by Francesco Casella, 4 years ago

Milestone: 1.17.01.18.0

Retargeted to 1.18.0 because of 1.17.0 timed release.

comment:6 by Francesco Casella, 3 years ago

Milestone: 1.18.0

Ticket retargeted after milestone closed

Note: See TracTickets for help on using tickets.