#4528 closed defect (fixed)
buildModelFMU doesn't respect the fileNamePrefix argument
| Reported by: | Lennart Ochel | Owned by: | Lennart Ochel |
|---|---|---|---|
| Priority: | high | Milestone: | 1.13.0 |
| Component: | Code Generation | Version: | |
| Keywords: | Cc: |
Description
- Is there a good reason to replace
.with_in the prefix string? - If the Cpp runtime is selected as target, then the
fileNamePrefixisn't considered at all.
You can use the following script to obtain this behaviour:
loadString(" model A input Real p; input Real u; output Real y; equation y = u * p; end A; "); getErrorString(); buildModelFMU(A, version="2.0", fmuType="me", fileNamePrefix="me.A.c", platforms={"static"}); getErrorString(); setCommandLineOptions("--simCodeTarget=Cpp"); getErrorString(); buildModelFMU(A, version="2.0", fmuType="me", fileNamePrefix="me.A.cpp", platforms={"static"}); getErrorString();
I have expected two FMUs to be generated: me.A.c.fmu and me.A.cpp.fmu
However, the script will generate the following two FMUs: me_A_c.fmu and A.fmu
Change History (5)
comment:1 by , 8 years ago
comment:2 by , 8 years ago
Cpp uses the model name as FMU name (including possible packages separated with dots). What is the use case / work flow for selecting a different fileNamePrefix?
comment:3 by , 8 years ago
This is from the User’s Guide:
input String fileNamePrefix = "<default>" "fileNamePrefix. <default> = \"className\"";
The behaviour should be, that the name of the generated FMU is the class name, containing dots as class separator if no fileNamePrefix (i.e. fileNamePrefix = "<default>") is specified. Otherwise the fileNamePrefix should be used for the file name. This is quite useful to generate several FMUs out of the same Modelica class. I use this for testing purpose, e.g., to compare ME/CS, C/CPP runtime and so on.
comment:4 by , 8 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
This is fixed with OMCompiler#1827 and OMCompiler#1843.
comment:5 by , 8 years ago
| Milestone: | 1.12.0 → 1.13.0 |
|---|

For some reasons the compilation process doesn't work if the target name contains dots:
Can someone have a look?