OpenModelica / OpenModelicaLibraryTesting

Test script for OMCompiler+OpenModelicaLibraries
Other
8 stars 13 forks source link

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

Open AndreaBartolini opened 11 months ago

AndreaBartolini commented 11 months ago

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 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:

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 commented 11 months ago

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

AndreaBartolini commented 9 months ago

@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 commented 9 months ago

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

AndreaBartolini commented 9 months ago

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 commented 9 months ago

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

casella commented 9 months ago

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.