OpenModelica / OMPython

A Python interface to OpenModelica communicating via CORBA or ZeroMQ
Other
107 stars 58 forks source link

Issues with lmodel import when using customBuildDirectory #215

Open BastiJoe opened 6 months ago

BastiJoe commented 6 months ago

Description

I have issues with the import of other models (lmodel) when setting a customBuildDirectory.

Steps to reproduce

model_path = "C:\LocalData\Gitlab\SBC\sbc-modelica-app\app\files_io\2598988031648\neptune.mo"
INNER_MODELPATH = "Buildingpackage.Buildingmodel"

_dependencies = ["Modelica",
    "C:/LocalData/Gitlab/SBC/sbc-modelica-app/libraries/ExternData/ExternData/package.mo",
    "C:/LocalData/Gitlab/SBC/sbc-modelica-app/libraries/BuildingSystems/BuildingSystems/package.mo"]

self.__workdir = "C:\LocalData\Gitlab\SBC\sbc-modelica-app\app\files_io\2598988031648"
model = ModelicaSystem(
                fileName=model_path,
                modelName=INNER_MODELPATH,
                lmodel=_dependencies,
                variableFilter=OUTPUT_VARIABLE_FILTER,
                customBuildDirectory=self.__workdir,
            )

on initialization i get the following message. The simulation is executed but runs forever.

Warning: Could not find library bsxml-json in either of: C:/LocalData/OpenModelica/lib//omc/bsxml-json.dll /usr/lib//bsxml-json.dll /lib//bsxml-json.dll /usr/lib//bsxml-json.dll /lib//bsxml-json.dll C:/LocalData/OpenModelica/bin//bsxml-json.dll C:/LocalData/OpenModelica/lib//omc/bsxml-json.dll C:/LocalData/OpenModelica/lib//bsxml-json.dll C:/Users/A200209509/AppData/Roaming/.openmodelica/binaries/Buildingpackage/bsxml-json.dll C:/LocalData/Gitlab/SBC/sbc-modelica-app/app/files_io/2598988031648/Resources/Library/mingw64/bsxml-json.dll C:/LocalData/Gitlab/SBC/sbc-modelica-app/app/files_io/2598988031648/Resources/Library/win64/bsxml-json.dll C:/LocalData/Gitlab/SBC/sbc-modelica-app/app/files_io/2598988031648/Resources/Library/bsxml-json.dll

actually the file could be found here:

C:\LocalData\Gitlab\SBC\sbc-modelica-app\libraries\ExternData\ExternData\Resources\Library\win64\bsxml-json.lib

this is a subpath of the lmodel.

But it is only checking in the customBuildDirectory:

C:/LocalData/Gitlab/SBC/sbc-modelica-app/app/files_io/2598988031648

Expected behavior

Successful import of the lmodel from the absolute path defined in the _dependencies variable

Version and OS