Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

Translation error... Class Concentration not found in scope DEMO_v10..

Translation error... Class Concentration not found in scope DEMO_v10..

I work with an example of dividing in library code and application code.
The library code contain an example and can be run alone.
The enclosed file can run very well in JModelica but with OpenModelica I get compilation error:

Translation error:
... Class Concentration not found in scope DEMO_v10.EquipmentMedium
... Class Medium.Concentration not found in scope DEMO_v10.Equipment.LiquidCon

I have struggled back and forth with this example during the week and I am stuck.

Would appreciate some "fresh eyes" on the code.

To make it complete I also enclose the application code d10_app7.mo that also works well in JModelica
together with the library DEMO_v10.mo. But not yet tested in OM. And I do not know how to put these two
files so that the application code read the library file. Would appreciate instruction here too.

Jan Peter

PS. I work with another example DEMO_v11 where I get rid of the base model EquipmentMedium and that
does not even work in JModelica. I thought understanding the error for DEMO_v10 in OpenModelica might shed light
on the next problem too - hopefully.




Edited by: janpeter - Mar-15-19 16:35:01

Re: Translation error... Class Concentration not found in scope DEMO_v10..

This looks like some redeclare issue in the current frontend of OM. The model works using the new frontend though, which can be enabled by using the "-d=newInst" flag (in recent nightly builds you can also enable it with the "Enable experimental new instantiation phase" option under Tools->Options->Simulation in OMEdit).

Re: Translation error... Class Concentration not found in scope DEMO_v10..

Good! Today I run 1.13.0 on a Virtualbox VM with Linux downloaded from you homepage last spring and then updated during the fall.
I do not know how to set this flag you are talking about.
I tried Tools/Options/Simulation and found field with a flag - and I tried your suggestion, although this likely was only
possible on recent highly builds. So it did not work.

With new frontend do you mean OM 1.4 or perhaps 2.0?
There are otherwise cases where JModelica is much more "forgiving" than OpenModelica
and that what almost expected here.

Look forward to you response.

Re: Translation error... Class Concentration not found in scope DEMO_v10..

If you use an older version you can add the flag in the "Additional Translation Flags" field, but 1.13.0 is likely too old for the new frontend to work well. It looks like we have a VM image of OM 1.13.2 that's probably recent enough to work, but I'd recommend installing one of the nightly builds (Download->Nightly Builds at the top of this page) when using the new frontend since it's constantly improved.

Edited by: perost - Mar-15-19 18:06:24

Re: Translation error... Class Concentration not found in scope DEMO_v10..

Hi,

I have installed VBox pre-built 64-bit stable VM about a year ago and updated in the fall to 1.13.0.
That installation I got help from https://www.youtube.com/watch?v=LGo8oT5NmkM

However, your routine for installation has shifted somehow.
What I get from your homepage is a vdi (not an ovf).

So I am not sure how to proceed actually - can you give me some instruction?
I decided to follow your recommendation to use nightly build and have that downloaded 7.68 GB only.

Would be good to know if this VM is actually building on VirtualBox or it is some other software.
The VM I installed a year ago have some problem with mounting VBox goest-additions and I found with help
from VBox forum that your VM was actually done on other software that made if not possible to run with
for instance re-sizing of the window etc, when I run it in VBox.

Thanks

Jan Peter




Re: Translation error... Class Concentration not found in scope DEMO_v10..

Hi,

I have installed VBox pre-built 64-bit stable VM about a year ago and updated in the fall to 1.13.0.
That installation I got help from https://www.youtube.com/watch?v=LGo8oT5NmkM

However, your routine for installation has shifted somehow.
What I get from your homepage is a vdi (not an ovf).

So I am not sure how to proceed actually - can you give me some instruction?
I decided to follow your recommendation to use nightly build and have that downloaded 7.68 GB only.

Would be good to know if this VM is actually building on VirtualBox or it is some other software.
The VM I installed a year ago have some problem with mounting VBox goest-additions and I found with help
from VBox forum that your VM was actually done on other software that made if not possible to run with
for instance re-sizing of the window etc, when I run it in VBox.

Thanks

Jan Peter




Re: Translation error... Class Concentration not found in scope DEMO_v10..

A vdi file is a VirtualBox Disk Image. To use it you just create a new virtual machine in VirtualBox, and select the vdi file when it asks you whether you want to create a new disk or use an existing image.

Re: Translation error... Class Concentration not found in scope DEMO_v10..

Good. It seems to work. Couple of related VBox questions

1) When I update software system ask is I want PC-GRUB installation something.
After some hesitation I said yes to that.

2) VBox guest additions need to be installed and I get err "Invalid byte sequence in version input"
Do you happen to know what to do? I will also check with VBox forum.
Just thought you may know.

Found this link. but not really not sure https://forums.virtualbox.org/viewtopic … nce#p42479

Thanks

Jan Peter

Edited by: janpeter - Mar-18-19 13:08:12

Re: Translation error... Class Concentration not found in scope DEMO_v10..

I try to get a dialog on the issue with VBox forum. A key aspect is whether the VM you have on nighly built is made from VirtualBox,
or it is still another software (Vagrant?). If it is not done form VirtualBox it complicates trouble-shooting, I am afraid. So it was list time when I discussed with people there and we started to look at error logs.

Another aspect of the VM is why "auto-run" of virtual discs are disabled.? Is there a good reason for that?
Best would likely be to enable auto-run since with every upgrade of VBox guest additions need to be updated too
and I want a simple, safe procedure.  / Jan Peter

Edited by: janpeter - Mar-19-19 19:37:19

Re: Translation error... Class Concentration not found in scope DEMO_v10..

I have never seen any Linux distribution enable auto-run since it's a huge security risk. The image will automatically mount the CD-ROM and it will open up the directory where the installer exists. Just right-click and open a terminal to run the shell-script (which is not marked executable, so you can't double-click it and expect it to run). Just type: "sh autorun.sh" and it installs fine.

The base disk image was created in VirtualBox (manually). OpenModelica is then installed using chroot and vdi-image is created from this; for this reason grub is not updated during the installation. We could include the virtualbox additions in the image, but I think this is not a great idea due to different virtualbox versions out there.

Re: Translation error... Class Concentration not found in scope DEMO_v10..

Good! The installation of guest additions worked with your instruction.
Now I finally can have a larger window! But problems with shared folders but I will
sort that out with VBox community.

I tried to simulate some model but needed to get back to very, very basic models
to have something that works directly.

I get the warning that 1.14 use Modelica 3.2.3 an not 3.2.2 that I am used to before.
But I am willing to adapt code to the newer standard. Where can I see the major basic
changes that likel affect most of the code I want to run?

Looking at Modelicas homepage https://www.modelica.org/documents
I do not find anything about ver 3.2.3 do you actually mean 3.3 (3.3.1 or 3.3.2) or?

Jan Peter

Re: Translation error... Class Concentration not found in scope DEMO_v10..

Good! The installation of guest additions worked with your instruction.
Now I finally can have a larger window! But problems with shared folders but I will
sort that out with VBox community.

I tried to simulate some model but needed to get back to very, very basic models
to have something that works directly.

I get the warning that 1.14 use Modelica 3.2.3 an not 3.2.2 that I am used to before.
But I am willing to adapt code to the newer standard. Where can I see the major basic
changes that likel affect most of the code I want to run?

Looking at Modelicas homepage https://www.modelica.org/documents
I do not find anything about ver 3.2.3 do you actually mean 3.3 (3.3.1 or 3.3.2) or?

Is 3.2.3 mainly about including MSL 3.2.3?
This document central https://doc.modelica.org/Modelica%203.2 … _2_3.html.

Jan Peter

Edited by: janpeter - Mar-21-19 09:47:41

Re: Translation error... Class Concentration not found in scope DEMO_v10..

It's just that the default loaded MSL is 3.2.3 and the model you load has a uses-annotation for MSL 3.2.2. It is possible to change the default MSL in OMEdit if you want to use the old library (Tools->Options->Libraries.

There are 0 guests and 0 other users also viewing this topic
You are here: