Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#6261 closed discussion (fixed)

How can I load the last Modelica & Complex versions?

Reported by: jean-philippe.tavella@… Owned by: Francesco Casella
Priority: high Milestone: NeedsInput
Component: *unknown* Version: 1.16.0
Keywords: Cc:

Description

From Dymola 2021x, the last versions of Modelica & Complex are:
Modelica(version="4.0.0"), Complex(version="4.0.0")

How can I load these last Modelica & Complex versions?

Kind regards

Change History (24)

comment:1 by Martin Sjölund, 4 years ago

updatePackageIndex();
installPackage(Modelica, "4.0.0+maint.om");

And change your OMEdit to load it instead of 3.2.3. Be prepared for packages breaking since there is no automatic conversion of older libraries to Modelica 4.0.0.

in reply to:  1 comment:2 by jean-philippe.tavella@…, 4 years ago

Replying to sjoelund.se:

updatePackageIndex();
installPackage(Modelica, "4.0.0+maint.om");

And change your OMEdit to load it instead of 3.2.3. Be prepared for packages breaking since there is no automatic conversion of older libraries to Modelica 4.0.0.

Please can you be more explicit for me as I don't know how and where to run these commands?

comment:3 by Adrian Pop, 4 years ago

Make a script.mos file containing these commands. Then run in a terminal via:

omc script.mos

Then restart OMEdit.
I think is also possible to run these via OMEdit CLI but I'm not sure how.
I will find out and will get back here with the answer.

comment:4 by Adrian Pop, 4 years ago

Ah, in OMEdit->Tools->OpenModelica Compiler CLI at the bottom you can write commands and then click send.

comment:5 by Francesco Casella, 4 years ago

@jean-philippe, as developer of PowerSysPro you have to make a strategic decision when to transition it to use MSL 4.0.0. This has many benefits, since the new MSL is much better structured, but it is an irreversible move. Once you do it, you need to convert all of your existing models using PowerSysPro to continue using them, and there is no way to convert them back to 3.2.3.

Eventually we will have to integrate the management of library upgrades into OMEdit, but it is too late to do that for 1.17.0, so we plan to do it for 1.18.0, due in July 2021.

Currently, you will have to perform the upgrade of PowerSysPro and of all the models you developed with it, by means of Dymola, and then select MSL 4.0.0 as the default Modelica library in OMEdit. This could be a bit inconvenient if you are also using OMEdit for other projects that still use MSL 3.2.3, proper handling of these situations will come with version 1.18.0.

Last edited 4 years ago by Francesco Casella (previous) (diff)

comment:6 by Francesco Casella, 4 years ago

@jean-philippe, one more thing. I understand version 1.5 of your library now use MSL 4.0.0. As such, it is not backwards compatible with 1.4, meaning that any model that was built with 1.4 needs conversion scripts to be able to run in 1.5, because it will be using a non-backwards-compatible version of MSL.

I would suggest you to start using semantic versioning for the version numbers of you library, see http://www.semver.org, which is becoming the de-facto standard in the Modelica community. If you do, 1.5 should be renamed 2.0.0 (i.e., major revision).

in reply to:  6 comment:7 by jean-philippe.tavella@…, 4 years ago

Replying to casella:

@jean-philippe, one more thing. I understand version 1.5 of your library now use MSL 4.0.0. As such, it is not backwards compatible with 1.4, meaning that any model that was built with 1.4 needs conversion scripts to be able to run in 1.5, because it will be using a non-backwards-compatible version of MSL.

I would suggest you to start using semantic versioning for the version numbers of you library, see http://www.semver.org, which is becoming the de-facto standard in the Modelica community. If you do, 1.5 should be renamed 2.0.0 (i.e., major revision).

I will change the versionning and rename the recent version as 2.0.0.

in reply to:  3 comment:8 by jean-philippe.tavella@…, 4 years ago

Replying to adrpo:

Make a script.mos file containing these commands. Then run in a terminal via:

omc script.mos

Then restart OMEdit.
I think is also possible to run these via OMEdit CLI but I'm not sure how.
I will find out and will get back here with the answer.

When I do that the result from omc is false.

comment:9 by Adrian Pop, 4 years ago

Ok, let's try to change the script.mos a bit to get more info:

updatePackageIndex(); getErrorString();
installPackage(Modelica, "4.0.0+maint.om"); getErrorString();

comment:10 by Adrian Pop, 4 years ago

I tried myself in Windows and it doesn't work because the Windows installer sets OPENMODELICALIBRARY environment variable and that one somehow interferes with the library package manager. In Linux this works fine as this variable is not set.
To fix this in Windows just remove (or maybe better to rename it) the OPENMODELICALIBRARY environment variable, then run the script and it should install the 4.0.0 Modelica library in your %APPDATA%/.openmodelica folder.

in reply to:  10 comment:11 by Francesco Casella, 4 years ago

Replying to adrpo:

I tried myself in Windows and it doesn't work because the Windows installer sets OPENMODELICALIBRARY environment variable and that one somehow interferes with the library package manager. In Linux this works fine as this variable is not set.
To fix this in Windows just remove (or maybe better to rename it) the OPENMODELICALIBRARY environment variable, then run the script and it should install the 4.0.0 Modelica library in your %APPDATA%/.openmodelica folder.

I guess we should try to get the command-line package manager to work in Windows also. From what you wrote, I have the impression that it only works in Linux. Do I miss something?

comment:12 by Adrian Pop, 4 years ago

Works fine în Windows as well, I tested it but you need to remove the OPENMODELICALIBRARY environment variable. We also need to change the installer to not set it.

in reply to:  12 comment:13 by jean-philippe.tavella@…, 4 years ago

Replying to adrpo:

Works fine în Windows as well, I tested it but you need to remove the OPENMODELICALIBRARY environment variable. We also need to change the installer to not set it.

No OPENMODELICALIBRARY environment variable is defined on my computer.
But I'm very sorry as it still doesn't work.
I cannot attach a screenshot of the error detected as I get a captcha error (rejected as potential spam).
NB: if you can answer me the MSL 4.0.0 will automatically be available with next 1.17.0 it could be enough for me.

comment:14 by jean-philippe.tavella@…, 4 years ago

My error is:
"Error: Curl error for URL https://libraries.openmodelica.org/index/v1/index.json: Couldn't connect to server
Error: Failed to download package index https://libraries.openmodelica.org/index/v1/index.json to file C:/Users/a37619/AppData/Roaming/.openmodelica/libraries/index.json."

Maybe due to my stupid EDF vpn...

comment:15 by Adrian Pop, 4 years ago

Ouch, I don't think we have a way yet to set any proxy setting.

in reply to:  15 ; comment:16 by jean-philippe.tavella@…, 4 years ago

Replying to adrpo:

Ouch, I don't think we have a way yet to set any proxy setting.

Don't worry but can you confirm me that Modelica(version="4.0.0") and Complex(version="4.0.0") will automatically be available with the next 1.17.0?

comment:17 by Adrian Pop, 4 years ago

I don't know. I'll bring this up in the OSMC developers meeting tomorrow and we'll decide which Modelica version should be shipped / default in 1.17.0.

comment:18 by anonymous, 4 years ago

In case of difficulties with installPackage you could just download Modelica 4.0 from modelica.org, and use it.

in reply to:  16 ; comment:19 by Francesco Casella, 4 years ago

Replying to jean-philippe.tavella@…:

Replying to adrpo:

Ouch, I don't think we have a way yet to set any proxy setting.

Don't worry but can you confirm me that Modelica(version="4.0.0") and Complex(version="4.0.0") will automatically be available with the next 1.17.0?

That's a good question, if that is a requirement for you, we can discuss that. For sure we still won't have proper version management in OMEdit, so we need to make sure everything works properly.

comment:20 by Francesco Casella, 4 years ago

Resolution: fixed
Status: newclosed

@jean-philippe, see #6274.

in reply to:  18 ; comment:21 by jean-philippe.tavella@…, 4 years ago

Replying to anonymous:

In case of difficulties with installPackage you could just download Modelica 4.0 from modelica.org, and use it.

I successfully tested this proposal. Thank you.

in reply to:  19 comment:22 by jean-philippe.tavella@…, 4 years ago

Replying to casella:

Replying to jean-philippe.tavella@…:

Replying to adrpo:

Ouch, I don't think we have a way yet to set any proxy setting.

Don't worry but can you confirm me that Modelica(version="4.0.0") and Complex(version="4.0.0") will automatically be available with the next 1.17.0?

That's a good question, if that is a requirement for you, we can discuss that. For sure we still won't have proper version management in OMEdit, so we need to make sure everything works properly.

Not a requirement, just a wish.

in reply to:  21 comment:23 by Francesco Casella, 4 years ago

Replying to jean-philippe.tavella@…:

Replying to anonymous:

In case of difficulties with installPackage you could just download Modelica 4.0 from modelica.org, and use it.

This is not always going to work. For example, the Modelica package depends on ModelicaServices, and that needs to be tool-specific. Most models will probably work, but I won't recommend this as a fail-safe solution.

comment:24 by Martin Sjölund, 4 years ago

This is not always going to work. For example, the Modelica package depends on ModelicaServices, and that needs to be tool-specific. Most models will probably work, but I won't recommend this as a fail-safe solution.

I would recommend grabbing
https://github.com/OpenModelica/OpenModelica-ModelicaStandardLibrary/tree/OM/maint/4.0.x
or
https://github.com/OpenModelica/OpenModelica-ModelicaStandardLibrary/tree/OM/master

Those are the patched versions, as used by the package manager (of course that filters out some things though)

Note: See TracTickets for help on using tickets.