- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Error when adding path to library
Error when adding path to library
Error when adding path to library
Dear,
I get the following error_msgs;
Code:
Error: Failed to load package Visualization (1.1,default) using MODELICAPATH C:/OpenModelica1.8.1/lib/omlibrary;C:/test
when I try to compile a model with the following mos-script;
Code:
loadModel(Modelica, {"3.2"});
loadModel(PlanarMechanicsForTesting);
cd("C:/ModelicaTests/PendulumTest");
loadFile("package.mo");
translateModel(Pendulum_Sep24.Pendulum_Sep24);
getErrorString();
I'm calling the mos script from python through a subprocess.call(), where I've added "C:\test" to the environment variable OPENMODELICALIBRARY.
(I'm using OpenModelica version : 1.8.1+ r12060)
Where is this package Visualization located? I can't find it in the OpenModelica folder. Any help is appreciated a lot.
Thanks,
cheers,
Patrik
Re: Error when adding path to library
Remove the uses(Visualization) annotation from the library. It does not depend on it and OpenModelica does not supply it.
- sjoelund.se
- 1700 Posts
Re: Error when adding path to library
Hey,
thanks a lot that really helps.
Just to straighten it out... So when I load in a package with env. var. and loadModel, OM looks for the defined dependencies (in the uses-annotation) and tries to load those packages from the paths in OPENMODELICALIBRARY. Whereas when I load a package with loadFile it doesn't care about these dependencies?
cheers,
Patrik
Re: Error when adding path to library
Yup. But if a model has a uses-annotation and you try to simulate it, the library will also be loaded.
- sjoelund.se
- 1700 Posts
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Error when adding path to library