Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FMU instantiation in SPAWN fails if installation directory has space, even though the problem has been addressed in the past. #3993

Closed
Mov0 opened this issue Sep 10, 2024 · 2 comments · Fixed by #4089
Assignees
Labels
spawn Development for Spawn of EnergyPlus

Comments

@Mov0
Copy link

Mov0 commented Sep 10, 2024

Describe the bug
If the Buildings library is installed in a directory with spaces, such as in Buildings 11.0.0, then creating the fmu for Spawn fails. The problem was addressed in #2507 but is still present with Buildings 11.0.0.

To Reproduce
Steps to reproduce the behavior:

  1. Download and unzip Buildings 11.0.0
  2. Run Buildings.ThermalZones.EnergyPlus_9_6_0.Examples.SingleFamilyHouse.Radiator
  3. See error

Expected behavior
The examples for SPAWN should run with a fresh installation of the Buildings library.

Screenshots
grafik

Version

  • Modelica Buildings Library: 11.0.0
  • Modelica simulation environment: Dymola 2024x
  • Operating system: Windows: Windows 10 Education 22H2 64-bit
@mwetter
Copy link
Member

mwetter commented Jan 7, 2025

@Mov0
This model should run with Dymola if change the working directory of Dymola to be outside of Buildings 11.0.0 (which always is a good idea so you don't clutter up the installation with temporary files).
To do so, you can enter in Dymola's command prompt

cd ..

and then run the model.

Note that this is not needed in OMEdit as OMEdit runs in a temporary directory.

Also, the CI tests work with a space in the installation directory (such as Buildings x.y.z) as tested in

@cp $(ROOT)/Buildings/Resources/Scripts/travis/SpawnTest.mo $(TMP)

but here again the working directory is outside of Buildings x.y.z.
The issue is caused inside the function call to the FMI library, which is invoked at


It turns out that for this function to work, the working directory must not have spaces, whereas the installation directory can have spaces.
This was tested by removing the check on the spaces in the source directory, moving the Buildings library to ~/test/my directory with spaces/modelica-buildings/Buildings 12.0.0 and running the model as

cd
/home/mwetter/test
 = true
RunScript("/home/mwetter/test/my dir with spaces/modelica-buildings/Buildings 12.0.0/Resources/Scripts/Dymola/ThermalZones/EnergyPlus_24_2_0/Examples/SingleFamilyHouse/Radiator.mos");
simulateModel("Buildings.ThermalZones.EnergyPlus_24_2_0.Examples.SingleFamilyHouse.Radiator", stopTime=259200, method="Cvode", tolerance=1e-06, resultFile="Radiator");
 = true

So, the proper test should be whether the current working directory contains a space in its name, and not whether the library installation folder has a space.

@mwetter
Copy link
Member

mwetter commented Jan 7, 2025

Todo

  • Update release notes.
  • Compile Windows binaries

This will not be ported to EnergyPlus 9.6.0 and hence not for the maintenance branch as the new test is more stringent and could break old models that may work with some Modelica tools.

@mwetter mwetter added this to the Release 11.1.0 milestone Jan 7, 2025
@mwetter mwetter added the spawn Development for Spawn of EnergyPlus label Jan 7, 2025
@mwetter mwetter modified the milestones: Release 11.1.0, Release 12.0.0 Jan 7, 2025
@mwetter mwetter self-assigned this Jan 7, 2025
mwetter added a commit that referenced this issue Jan 10, 2025
* Improved test for spaces in directory names that can fail Spawn simulation

For #3993
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
spawn Development for Spawn of EnergyPlus
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants