Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#3447 closed enhancement (fixed)

Use of msvc flag in OMEdit

Reported by: Julian Ophey Owned by: Adeel Asghar
Priority: normal Milestone: 1.9.4
Component: OMEdit Version: trunk
Keywords: msvc Cc: Niklas Worschech

Description

When I use any model out of the MSL, and add the flags in the options:

+d=initialization +simCodeTarget=Cpp +target=msvc

then the simulation failed with the error log:
Modelica.Blocks.Examples.PID_Controller.makefile:17: * missing separator. Stop.
Compilation process failed. Exited with code 2.

Thanks for your support.

Change History (18)

comment:1 by Lennart Ochel, 9 years ago

Cc: Niklas Worschech added; Niklas Worschech removed

comment:2 by Adeel Asghar, 9 years ago

Milestone: 1.9.31.9.4
Status: newaccepted

comment:3 by Adeel Asghar, 9 years ago

This is now fixed in a development branch https://github.com/adeas31/OMEdit/commit/3af330536bb03c5f413c83c0048f5084a5243257. The fix will be available in 1.9.4 final release.

comment:4 by Adeel Asghar, 9 years ago

Resolution: fixed
Status: acceptedclosed

The fix is now available via the nightly build.

comment:5 by Niklas Worschech, 9 years ago

I tested it with the nightly build version 525-gf0bcb4f but i still get the same error
I used the tools -> options dialog and added to the simulation tab the omc flags +simCodeTarget=Cpp +target=msvc
Is this the correct way to change the simCode target and the compiler target?

comment:6 by Adeel Asghar, 9 years ago

No. You should choose Cpp from drop-down options of Target Language and msvc from drop-down options of Target Compiler in Tools->Options->Simulation.

comment:7 by Niklas Worschech, 9 years ago

Thank you, the compilation works now. But the simulations chrashes with this error

stdout | OMEditInfo | C:/Users/niklwors/AppData/Local/Temp/OpenModelica/OMEdit/Modelica.Blocks.Examples.PID_Controller.exe -port=46411 -logFormat=xml -override=startTime=0,stopTime=4,stepSize=0.008,tolerance=0.0001,solver=dassl,outputFormat=mat,variableFilter=.* -r=Modelica.Blocks.Examples.PID_Controller_res.mat -dasslJacobian=coloredNumerical -w -lv=LOG_STATS
stdout | error |Process crashed
Simulation process failed. Exited with code -1073741515.

Do you know what the problem is?

comment:8 by Adeel Asghar, 9 years ago

Do you know which binaries are required to run the executable? I set OPENMODELICAHOME/bin as the process environment. If the executable needs more binaries than the ones in bin then it will fail.

Can you run dependency walker on the executable and share a screenshot of it?

comment:9 by Adrian Pop, 9 years ago

I think you need to have also in the path: $OPENMODELICAHOME\lib\omc\msvc if the target is msvc.

comment:10 by Adrian Pop, 9 years ago

If the runtime is CPP then I guess you also need to add to the path: $OPENMODELICAHOME\lib\omc\cpp\msvc

comment:11 by Adeel Asghar, 9 years ago

I added paths in 4ef774e/OMEdit. Lets see how it works now.

comment:12 by Niklas Worschech, 9 years ago

Thank you, if add the paths to the path variable it works.
I noticed that I have to open the tools dialog when I started OMEdit to change the codegenrator, otherwise the codegenerator would no be changed. So OMedit did forget the codgenerator settings.

Last edited 9 years ago by Niklas Worschech (previous) (diff)

in reply to:  12 comment:13 by Adeel Asghar, 9 years ago

Replying to niklwors:

Thank you, if add the paths to the path variable it works.

You don't have to add the paths to path variable manually. My last commit will add them and set a proper environment automatically. Test it and let me know.

I noticed that I have to open the tools dialog when I started OMEdit to change the codegenrator.

Yes, but you only have to do it once and then OMEdit will remember your settings.

comment:14 by Niklas Worschech, 9 years ago

the nightly build v1.9.4-dev-667-g37ad4ee still crashes with the same error

comment:15 by Martin Sjölund, 9 years ago

See my comment on 4ef774e

comment:16 by Adeel Asghar, 9 years ago

Corrected in 04984ba/OMEdit

comment:17 by Martin Sjölund, 9 years ago

Milestone: 1.9.41.9.4-1.9.x

Milestone renamed

comment:18 by Martin Sjölund, 9 years ago

Milestone: 1.9.4-1.9.x1.9.4

Milestone renamed

Note: See TracTickets for help on using tickets.