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

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.

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.

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