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

Building model fails

Building model fails

I recently installed OpenModelica 1.9.0 on on a windows xp. When I call buildModel in OMShell it returns {"",""} without any error. This happens for any model (even an empty one). It creates the .c .h .xml and .makefile files, but the .exe file is not created.
Any other attempt to run a simulation (with OMNotebook, OMEdit) failed too probably for the same reason.
OpenModelica worked for me on other computers.
Any idea how i can fix this problem?

Re: Building model fails

Run getErrorString() to get error-messages.

Re: Building model fails

Hi,

Have you tried a restart after installing? Or at least logout/login.

To test more I would suggest to run omc from command line:

Code:


> c:\OpenModelica1.9.0\bin\omc script.mos

where script.mos contains:

Code:


loadModel(Modelica); getErrorString();
simulate(Modelica.Blocks.Examples.Filter); getErrorString();

Then see what the output is and let us know.

sjoelund.se, i think OMShell runs getErrorString() automatically after each command.

I would also suggest to install the latest nightly build:
https://build.openmodelica.org/omc/buil … ly-builds/
as is far better than 1.9.0.

Cheers,
Adrian Pop/

Re: Building model fails

Thank you both for the fast replies! I didn't expect that.

I ran omc just as you said and got:

true
""
'"C:/OpenModelica1.9.0//share/omc/scripts/Compile"' is not recongnized as an internal or external command,
operable program or batch file.
record SimulationResult
    resultFile = ""
    ...
end SimulationResult
""

(note i copied that by hand so I probably misprinted a few letters)

I checked and the file exists, but has a .bat extention.
also I had to add .exe when i ran omc:

> c:\OpenModelica1.9.0\bin\omc.exe script.mos

It seems that the problem is that the computer doesn't ignore the filename extention where it should.

Re: Building model fails

Did you install a custom shell that could mess with extensions not being auto-completed?

Re: Building model fails

Maybe .exe and .bat file associations are corrupted somehow.
You could run a tool like this (or search google for something else):
https://support.kaspersky.com/viruses/disinfection/3732
to get them back.

Cheers,
Adrian Pop/

Re: Building model fails

I found that the enviroment variable PATHEXT of my user was just ".py;.pyc". so I add ".com; .exe;.bat" and it worked.
Then I got another problem, the simulation .exe file did not work (it gave some error that had to do with mingw), I solved it by copying the system PATH to the user PATH.

I think the problem was this: I installed python(x,y)  only for my user, and it created PATH and PATHEXT variables for this user, that override the system variables.

now everything works, but I feel that there is something wrong with my eviroment variables. do you think this is because of a bug in python(x,y)?

Re: Building model fails

Unfortunately, I have no idea if the python installation broke the Windows XP handling. Maybe.
Anyway, I'm glad that you found out what the problem was with OpenModelica.

Cheers,
Adrian Pop/

Re: Building model fails

Hello everyone,

I have a model named "test.mo" and I am trying to simulate this model with omc command from cmd window. When I use the omc command I receive an error which says "Failed to build model: test". But I simulate the model with OMEdit without any problem. There is nothing wrong with the model and I do not understand why when I try to simulate it with omc command it says model cannot be built. I would be extremely grateful if you could help me out current/smile

Best,
Pouya

There are 0 guests and 0 other users also viewing this topic