Experimentation with a Prototype OpenModelica Compiler in ...
OpenModelica Eclipse Setup [email protected] 2013-10-09.
-
Upload
andrew-terence-watts -
Category
Documents
-
view
226 -
download
3
Transcript of OpenModelica Eclipse Setup [email protected] 2013-10-09.
![Page 2: OpenModelica Eclipse Setup Adrian.Pop@liu.se 2013-10-09.](https://reader030.fdocuments.in/reader030/viewer/2022033023/56649ee45503460f94bf375b/html5/thumbnails/2.jpg)
Important notices
• Make sure you use paths with no spaces– For Eclipse workspace – For OpenModelica project
• Make sure your Eclipse is not running until the slide which tells you to start Eclipse
• If you want omc to include the revision number in the omc version install TortoiseSVN command line svn client and put it in your path
![Page 3: OpenModelica Eclipse Setup Adrian.Pop@liu.se 2013-10-09.](https://reader030.fdocuments.in/reader030/viewer/2022033023/56649ee45503460f94bf375b/html5/thumbnails/3.jpg)
Checkout OMDev into C:\OMDev
• OMDev url:https://openmodelica.org/svn/OpenModelica/installers/windows/OMDev • Add OMDEV environment variable pointing to
C:\OMDev• JDK 32bit needs to be installed and Msys
should be able to find it! Put it in your PATH environment variable.
![Page 4: OpenModelica Eclipse Setup Adrian.Pop@liu.se 2013-10-09.](https://reader030.fdocuments.in/reader030/viewer/2022033023/56649ee45503460f94bf375b/html5/thumbnails/4.jpg)
Msys location – use the shortcut
![Page 5: OpenModelica Eclipse Setup Adrian.Pop@liu.se 2013-10-09.](https://reader030.fdocuments.in/reader030/viewer/2022033023/56649ee45503460f94bf375b/html5/thumbnails/5.jpg)
Msys – a Linux like terminal
We will use this one later
![Page 6: OpenModelica Eclipse Setup Adrian.Pop@liu.se 2013-10-09.](https://reader030.fdocuments.in/reader030/viewer/2022033023/56649ee45503460f94bf375b/html5/thumbnails/6.jpg)
Checkout OpenModelica
![Page 7: OpenModelica Eclipse Setup Adrian.Pop@liu.se 2013-10-09.](https://reader030.fdocuments.in/reader030/viewer/2022033023/56649ee45503460f94bf375b/html5/thumbnails/7.jpg)
Copy .project-sample to .project
![Page 8: OpenModelica Eclipse Setup Adrian.Pop@liu.se 2013-10-09.](https://reader030.fdocuments.in/reader030/viewer/2022033023/56649ee45503460f94bf375b/html5/thumbnails/8.jpg)
Checkout OpenModelica - done
![Page 9: OpenModelica Eclipse Setup Adrian.Pop@liu.se 2013-10-09.](https://reader030.fdocuments.in/reader030/viewer/2022033023/56649ee45503460f94bf375b/html5/thumbnails/9.jpg)
Copy OMDev-MINGW-OpenModelicaBuilder.launch-sampleto
OMDev-MINGW-OpenModelicaBuilder.launchin workspace\OpenModelica\.externalToolBuilders
![Page 10: OpenModelica Eclipse Setup Adrian.Pop@liu.se 2013-10-09.](https://reader030.fdocuments.in/reader030/viewer/2022033023/56649ee45503460f94bf375b/html5/thumbnails/10.jpg)
If your project is not named OpenModelica change it in .project
![Page 11: OpenModelica Eclipse Setup Adrian.Pop@liu.se 2013-10-09.](https://reader030.fdocuments.in/reader030/viewer/2022033023/56649ee45503460f94bf375b/html5/thumbnails/11.jpg)
Start Eclipse
Install MDT in Eclipse if you haven’t done that yet:https://trac.openmodelica.org/documents/MDT/install/
![Page 12: OpenModelica Eclipse Setup Adrian.Pop@liu.se 2013-10-09.](https://reader030.fdocuments.in/reader030/viewer/2022033023/56649ee45503460f94bf375b/html5/thumbnails/12.jpg)
Switch to Modelica perspective
![Page 13: OpenModelica Eclipse Setup Adrian.Pop@liu.se 2013-10-09.](https://reader030.fdocuments.in/reader030/viewer/2022033023/56649ee45503460f94bf375b/html5/thumbnails/13.jpg)
Modelica perspective
![Page 14: OpenModelica Eclipse Setup Adrian.Pop@liu.se 2013-10-09.](https://reader030.fdocuments.in/reader030/viewer/2022033023/56649ee45503460f94bf375b/html5/thumbnails/14.jpg)
New Modelica project named OpenModelica(or the name you chose)
![Page 15: OpenModelica Eclipse Setup Adrian.Pop@liu.se 2013-10-09.](https://reader030.fdocuments.in/reader030/viewer/2022033023/56649ee45503460f94bf375b/html5/thumbnails/15.jpg)
Remove Build automatically from Project
![Page 16: OpenModelica Eclipse Setup Adrian.Pop@liu.se 2013-10-09.](https://reader030.fdocuments.in/reader030/viewer/2022033023/56649ee45503460f94bf375b/html5/thumbnails/16.jpg)
Add +g=MetaModelica to omc flags
RESTART ECLIPSEAFTER THIS CHANGE
![Page 17: OpenModelica Eclipse Setup Adrian.Pop@liu.se 2013-10-09.](https://reader030.fdocuments.in/reader030/viewer/2022033023/56649ee45503460f94bf375b/html5/thumbnails/17.jpg)
Important notice
• In Eclipse is best to do refresh on a workspace automatically, via
• Window->Preferences
![Page 18: OpenModelica Eclipse Setup Adrian.Pop@liu.se 2013-10-09.](https://reader030.fdocuments.in/reader030/viewer/2022033023/56649ee45503460f94bf375b/html5/thumbnails/18.jpg)
Refresh project, right click->Refresh
![Page 19: OpenModelica Eclipse Setup Adrian.Pop@liu.se 2013-10-09.](https://reader030.fdocuments.in/reader030/viewer/2022033023/56649ee45503460f94bf375b/html5/thumbnails/19.jpg)
Check settings in Project builder
![Page 20: OpenModelica Eclipse Setup Adrian.Pop@liu.se 2013-10-09.](https://reader030.fdocuments.in/reader030/viewer/2022033023/56649ee45503460f94bf375b/html5/thumbnails/20.jpg)
Check settings in all tabs!
![Page 21: OpenModelica Eclipse Setup Adrian.Pop@liu.se 2013-10-09.](https://reader030.fdocuments.in/reader030/viewer/2022033023/56649ee45503460f94bf375b/html5/thumbnails/21.jpg)
Check settings in all tabs!
Make sure jdk 32 bit is in your
PATH
![Page 22: OpenModelica Eclipse Setup Adrian.Pop@liu.se 2013-10-09.](https://reader030.fdocuments.in/reader030/viewer/2022033023/56649ee45503460f94bf375b/html5/thumbnails/22.jpg)
Build Project
Leave empty and click OK to build omc
…….It does take a while.
Check the builder settingsif there are errors
![Page 23: OpenModelica Eclipse Setup Adrian.Pop@liu.se 2013-10-09.](https://reader030.fdocuments.in/reader030/viewer/2022033023/56649ee45503460f94bf375b/html5/thumbnails/23.jpg)
OpenModelica project was build
Refresh project and check build/bin/
![Page 24: OpenModelica Eclipse Setup Adrian.Pop@liu.se 2013-10-09.](https://reader030.fdocuments.in/reader030/viewer/2022033023/56649ee45503460f94bf375b/html5/thumbnails/24.jpg)
Build the bootstrapped compiler
Use Msys
![Page 25: OpenModelica Eclipse Setup Adrian.Pop@liu.se 2013-10-09.](https://reader030.fdocuments.in/reader030/viewer/2022033023/56649ee45503460f94bf375b/html5/thumbnails/25.jpg)
Setup Eclipse Debugging
Refresh project and checktestsuite/openmodelica/bootstrapping
![Page 26: OpenModelica Eclipse Setup Adrian.Pop@liu.se 2013-10-09.](https://reader030.fdocuments.in/reader030/viewer/2022033023/56649ee45503460f94bf375b/html5/thumbnails/26.jpg)
Change name
![Page 27: OpenModelica Eclipse Setup Adrian.Pop@liu.se 2013-10-09.](https://reader030.fdocuments.in/reader030/viewer/2022033023/56649ee45503460f94bf375b/html5/thumbnails/27.jpg)
Select program
![Page 28: OpenModelica Eclipse Setup Adrian.Pop@liu.se 2013-10-09.](https://reader030.fdocuments.in/reader030/viewer/2022033023/56649ee45503460f94bf375b/html5/thumbnails/28.jpg)
Select program and work directory
![Page 29: OpenModelica Eclipse Setup Adrian.Pop@liu.se 2013-10-09.](https://reader030.fdocuments.in/reader030/viewer/2022033023/56649ee45503460f94bf375b/html5/thumbnails/29.jpg)
Check environment tab
Add OPENMODELICAHOME and OPENMODELICALIBRARY
![Page 30: OpenModelica Eclipse Setup Adrian.Pop@liu.se 2013-10-09.](https://reader030.fdocuments.in/reader030/viewer/2022033023/56649ee45503460f94bf375b/html5/thumbnails/30.jpg)
Have a test example
![Page 31: OpenModelica Eclipse Setup Adrian.Pop@liu.se 2013-10-09.](https://reader030.fdocuments.in/reader030/viewer/2022033023/56649ee45503460f94bf375b/html5/thumbnails/31.jpg)
Add command line parameters
![Page 32: OpenModelica Eclipse Setup Adrian.Pop@liu.se 2013-10-09.](https://reader030.fdocuments.in/reader030/viewer/2022033023/56649ee45503460f94bf375b/html5/thumbnails/32.jpg)
Put a breakpoint
Double click here
![Page 33: OpenModelica Eclipse Setup Adrian.Pop@liu.se 2013-10-09.](https://reader030.fdocuments.in/reader030/viewer/2022033023/56649ee45503460f94bf375b/html5/thumbnails/33.jpg)
Start Debug
![Page 34: OpenModelica Eclipse Setup Adrian.Pop@liu.se 2013-10-09.](https://reader030.fdocuments.in/reader030/viewer/2022033023/56649ee45503460f94bf375b/html5/thumbnails/34.jpg)
Switch to Debug perspective
![Page 35: OpenModelica Eclipse Setup Adrian.Pop@liu.se 2013-10-09.](https://reader030.fdocuments.in/reader030/viewer/2022033023/56649ee45503460f94bf375b/html5/thumbnails/35.jpg)
Debug perspective
console
variables
stack
execution point
![Page 36: OpenModelica Eclipse Setup Adrian.Pop@liu.se 2013-10-09.](https://reader030.fdocuments.in/reader030/viewer/2022033023/56649ee45503460f94bf375b/html5/thumbnails/36.jpg)
The End
• The Eclipse workspace created in this demo (only with the important parts) is here:https://openmodelica.org/documents/
• Also this document should be there
• Contact [email protected] for any issues.