Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

FMU not generated

FMU not generated

Hello,

I am new to OpenModelica so there is probably a newbie mistake somwhere but here goes.
I am trying to use OMPython to compile a model into an FMU, but I fail.

I have tried some models from MSL, and they succeed but when I try with a model from my library only some files and a folder is generated:
- Folder: model.fmutmp
- model.libs
- model_FMU_libs
- model_FMU.log
- model_FMU.makefile
- model_info.json

Calling getErrorString returns an empty string and the log only contain the following info:
rm -f model.fmutmp/sources/model_init.xml
cp -a C:/OpenModelica1.9.7//include/omc/c/* model.fmutmp/sources/include/
cp -a C:/OpenModelica1.9.7//share/omc/runtime/c/fmi/buildproject/* model.fmutmp/sources
cp -a model_FMU.libs model.fmutmp/sources/
RESULT: 0

I am using OM 1.9.7 since there were bugs in OMPython that prevented me form using using version 1.11.0.

Is this something you recognize?

Best regards,
Johan Ylikiiskilä

Re: FMU not generated

Never used OMPython, but did you try to compile the FMU from command line?
in %OPENMODELICAHOME%\bin you should have the omc compiler;
you should try to build your FMU this way:

suppose that your file is model.mo and that depends on model_dependency.mo and on the Modelica library, then you should create a build_model.mos that contains the following text

loadModel(Modelica);
loadFile("model.mo");
loadFile("modelica_dependency.mo");
buildModelFMU(model, version="2.0", fmuType="cs");
getErrorString()

and then run omc build_model.mos

in this way you should be able to produce a working FMU build.

Edited by: DarioMangoni - Jan-12-18 11:31:29
There are 0 guests and 0 other users also viewing this topic