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

Model that simulates in OMEdit fails the "Templates" phase using the OpenModelicaLibraryTesting scripts #46

Open
AndreaBartolini opened this issue Oct 18, 2023 · 6 comments
Assignees

Comments

@AndreaBartolini
Copy link
Contributor

Recently I started to use the OpenModelicaLibraryTesting scripts to test my Modelica libraries under Win. To do so I've modified some rows in the Python scripts:

  • the paths according to the win conventions (\, .exe ....)
  • the cmd line to run the C compiler
  • some properties of the subrocess calls that are not available under Win

The calls to the OMCompiler have been leave unchanged.

Most of the libraries pass the test without problems, some models that simulate in OMEdit fail the "Templates" phase, giving the following error:
[C:/OM122/OM64bit/OMCompiler/Compiler/SimCode/SimCodeMain.mo:532:7-532:78:writable] Error: Internal error C:\Program Files\OpenModelica1.22.0-dev.beta.4-64bit\bin\omc.exe: [unknown function name] failed

In order to reproduce the issue I reduced as much as possible a simple teaching library, leaving only one test that fails ad described above.

The steps to reproduce the issue are the following:

  • unzip the attached STTLibrary.zip file,
  • open OMEdit and simulate the model STTlibrary.Components.DigitalController.Examples.ControlledTank, the simulation finished successfully,
  • run the OpenModelicaLibraryTesting scripts by using the command test.py --noclean -j=1 configs\conf.json and the attached conf.json file, the same model fails the "templates" phase and produces the error above.

Attached also the ProducedFile.zip that contains all the files produced by the script on my PC.

OMEdit - OpenModelica Connection Editor
Connected to OpenModelica v1.22.0-dev.beta.4 (64-bit)
Sysop: Win11 pro - 64 bit

ProducedFiles.zip
conf.json
STTlibrary.zip

@casella
Copy link
Collaborator

casella commented Oct 19, 2023

@adrpo this is weird, maybe another instance of issues related to the 200-something character limits in Windows pathnames?

@AndreaBartolini
Copy link
Contributor Author

@adrpo this is weird, maybe another instance of issues related to the 200-something character limits in Windows pathnames?

Regarding the path limit issue, I done the following tests:

  1. moved the testing library to a short path --> nothing changed
  2. moved also the scripts (so the working directory) to a short path --> it solves the issue

So the problem is the path of both the testing library and the working dir.

Waiting the resolution of this known issue, I'll try to add the possibility to set the working directory in the scripts...

@casella
Copy link
Collaborator

casella commented Nov 27, 2023

@AndreaBartolini it would really help if we had an MWE, with bogus pathnames of the same length

@AndreaBartolini
Copy link
Contributor Author

AndreaBartolini commented Nov 29, 2023

Here one complete pathname that generate the issue:

C:\xxx\XXXXXXXXXXXXX\XXXXXXXX-XXXXXXXX\OMCContinuousIntegration\localopenmodelicalibrarytesting\OMLibraryTesting\STTlibrary_STTlibrary.Components.DigitalController.Examples.ControlledTank\STTlibrary_STTlibrary.Components.DigitalController.Examples.ControlledTank.bat

some other may have around 10 characters more.

The MWE is attached to the first message of this thread.

@AndreaBartolini
Copy link
Contributor Author

I will upload the scripts to run the test under win asap

@casella
Copy link
Collaborator

casella commented Dec 1, 2023

I looked a bit into this issue with Andrea. Turns out, it's exactly the same problem as in #11554.

The Python test script builds a string for fileNamePrefix which is the nameOfTheLibrary_FullPathNameOfModel, which is totally useless. It could just be replaced with "sim" or "foo".

Ditto for #11554.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants