Opened 6 years ago
Last modified 4 years ago
#5852 new defect
getCommandLineOptions fails with newInst
| Reported by: | 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.moswith omc-d=newInst - use the provided
runtest_newInst.batandruntest_oldInst.bat
Using OpenModelica v1.16.0-dev-189-gf9a0b4816
on Win10
Attachments (1)
Change History (7)
by , 6 years ago
| Attachment: | newInstGetCommandLineOptions.zip added |
|---|
comment:1 by , 6 years ago
| Component: | *unknown* → New Instantiation |
|---|---|
| Milestone: | Future → 1.16.0 |
| Owner: | changed from to |
comment:2 by , 6 years ago
| Cc: | 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 , 6 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:5 by , 5 years ago
| Milestone: | 1.17.0 → 1.18.0 |
|---|
Retargeted to 1.18.0 because of 1.17.0 timed release.

Minimal example