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

How to properly run executable file compiled by OME?

How to properly run executable file compiled by OME?

Hi all,

I wanted to run the executable generated by simulating the model. However, when I started the program, the executable will prompt up error or "The application was unable to start correctly (0xc0000007b). Click OK to close the application".

What I did:
1. compile/simulate the model in OpenModelica Editor, or compile through command line using the provided makefile.
2. copy the command ome uses to execute the model, eg: Filter.exe -port=60198 -logFormat=xmltcp -override=startTime=0,stopTime=0.9,stepSize=0.0018,tolerance=1e-06,solver=dassl,outputFormat=mat,variableFilter=.* -r=<> -w -lv=LOG_STATS -inputPath=<> -outputPath=<>


I was wondering if I did anything incorrectly?

Thanks,

Re: How to properly run executable file compiled by OME?

Hey shunfan2,

Use a shell that has omc (OpenModelica compiler) in it's PATH to run the executable. You can start cmd with that from OMEdit->Tools->OpenModelica Command Prompt. If you want to re-compile it best to use OMDev (see https://github.com/OpenModelica/OpenMod … -MINGW.md), basically a Linux-like shell with all tools needed to compile.

Change directory to the place where your executable was generated. There are local files the executable needs.

Only use the simulation flags you need. You can find them in the User's Guide. In your example above you don't need the -port and -logFormat=xmltcp. The default values are okay, so dumping the log to stdout.

For example if I have simulated Modelica.Blocks.Examples.Filter from OMEdit I can change into the directory and run it again:

Start OpenModelica Command Prompt from OMEdit and run:

Code:


C:\Users\Username\AppData\Local\Temp\OpenModelica\OMEdit> cd C:/Users/Username/AppData/Local/Temp/OpenModelica/OMEdit/Modelica.Blocks.Examples.Filter/
C:\Users\Username\AppData\Local\Temp\OpenModelica\OMEdit\Modelica.Blocks.Examples.Filter> Filter.exe
LOG_SUCCESS       | info    | The initialization finished successfully without homotopy method.
LOG_SUCCESS       | info    | The simulation finished successfully.

Re: How to properly run executable file compiled by OME?

From version 1.18.0 you can also activate "Use static linking" in OMEdit->Tools->Options->Simulation. That will generate you an executable that does not need any extra dlls to run (well, except if you have some in your library).

https://pasteboard.co/3ufiTsk1mJMR.png

Edited by: adrpo - Apr-11-22 09:54:30
There are 0 guests and 0 other users also viewing this topic
You are here: