Skip to content

Issues with lmodel import when using customBuildDirectory #215

Closed as not planned

Description

@BastiJoe

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

  • Python 3.9.13
  • OMPython 3.5.1 master
  • OpenModelica v1.20.0 (64-bit)
  • OS: Windows 10, 64 bit

Activity

  1. syntron commented on Jun 24, 2025

    @syntron
    Contributor

    @BastiJoe Could you check if this is solved by PR #229?

  2. adeas31 commented on Dec 2, 2025

    @adeas31
    Member

    Unable to reproduce the issue with the latest code.
    Please feel free to reopen and provide a MWE for testing.

  3. added this to the 4.0.0 milestone on Sep 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions