Wiki source code of Running KEITH
Version 28.1 by Soeren Domroes on 2019/07/09 12:57
Hide last authors
author | version | line-number | content |
---|---|---|---|
![]() |
7.1 | 1 | = Running KEITH = |
![]() |
6.1 | 2 | |
![]() |
7.1 | 3 | |
4 | |||
![]() |
16.1 | 5 | {{toc maxLevel="2"/}} |
![]() |
6.1 | 6 | |
![]() |
5.1 | 7 | == Setting up your eclipse == |
![]() |
1.1 | 8 | |
![]() |
8.1 | 9 | For everything not mentioned here refer to [[Getting Eclipse>>doc:KIELER.Getting Eclipse||shape="rect"]] guide. |
![]() |
1.1 | 10 | |
![]() |
15.1 | 11 | Use the installer go to advanced mode, add the KIELER url. Then select first pragmatics and after that semantics (**that is very** **important**). |
![]() |
1.1 | 12 | |
![]() |
15.1 | 13 | Select the Theia stream for semantics and the Keith stream for pragmatics and use the latest eclipse if possible. Set the targetplatform to photon (or latest?) and finish. |
![]() |
1.1 | 14 | |
![]() |
8.1 | 15 | Wait till everything installs and the setup tasks finish. If you have any problems in this stage refer to the [[Getting Eclipse>>doc:KIELER.Getting Eclipse||shape="rect"]] guide. |
![]() |
1.1 | 16 | |
![]() |
5.1 | 17 | \\ |
![]() |
1.1 | 18 | |
![]() |
13.1 | 19 | The setup tasks for Modular Target will fail. Disable it after this happens and execute them again via //Help>Perform Setup Tasks//. Open the //plug-in development// perspective. Select working sets as top level elements. Run //clean build//. Several pragmatics projects have errors. Just close them and you will be fine. |
![]() |
1.1 | 20 | |
![]() |
5.1 | 21 | To run the language server go to //Run Configurations// create a new //eclipse application// run configuration and select //Run an application// and //de.cau.cs.kieler.language.server.LanguageServer// |
![]() |
1.1 | 22 | |
![]() |
5.1 | 23 | == [[image:attach:Screenshot from 2019-02-15 14-10-50.png]] == |
![]() |
1.1 | 24 | |
![]() |
5.1 | 25 | \\ |
![]() |
1.1 | 26 | |
![]() |
5.1 | 27 | You have to edit the arguments too. The Vm arguments host and port are added to connect the LS via socket. |
![]() |
1.1 | 28 | |
![]() |
5.1 | 29 | [[image:attach:Screenshot from 2019-02-15 14-13-34.png]] |
![]() |
1.1 | 30 | |
![]() |
5.1 | 31 | The default port to which KEITH tries to connect is 5007. |
![]() |
1.1 | 32 | |
33 | == Setting up a KEITH developer setup... == | ||
34 | |||
35 | General requirements: | ||
36 | |||
![]() |
28.1 | 37 | * node (see [[Theia developer guide>>url:https://github.com/theia-ide/theia/blob/master/doc/Developing.md||shape="rect"]]) |
![]() |
1.1 | 38 | * npm (whatever node installs) |
39 | * yarn (latest version) | ||
40 | * Python (2.7.X) | ||
41 | * gcc, g++, and make (for native dependencies of some npm packages) | ||
42 | * [[Visual Studio Code>>url:https://code.visualstudio.com/||shape="rect"]] (latest version) | ||
43 | * a cloned [[keith >>url:https://git.rtsys.informatik.uni-kiel.de/projects/KIELER/repos/keith/browse||shape="rect"]]repository | ||
44 | |||
45 | == ... on linux: == | ||
46 | |||
47 | (Theia has a [[guide >>url:https://www.theia-ide.org/doc/authoring_extensions||shape="rect"]]for extension development that might be helpful) | ||
48 | |||
49 | install node 8: | ||
50 | |||
51 | {{code}} | ||
52 | curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.5/install.sh | bash | ||
53 | nvm install 8 | ||
54 | {{/code}} | ||
55 | |||
56 | Install python if you haven't (remember: Python 2: , Python 3: ). | ||
57 | |||
58 | {{code language="none"}} | ||
59 | Install yarn (a package manager build on the package manager npm): | ||
60 | {{/code}} | ||
61 | |||
62 | {{{}}} | ||
63 | |||
64 | \\ | ||
65 | |||
66 | {{code}} | ||
67 | npm install -g yarn | ||
68 | {{/code}} | ||
69 | |||
70 | \\ | ||
71 | |||
72 | == ... on windows: == | ||
73 | |||
74 | Install [[node 8>>url:https://nodejs.org/download/release/v8.15.0/||shape="rect"]] for windows. I personally used the {{code language="none"}}.msi{{/code}}. | ||
75 | |||
![]() |
11.1 | 76 | Use that to install windows-build-tools by executing the command in an administrative powershell. |
![]() |
1.1 | 77 | |
78 | {{code}} | ||
79 | npm install -g windows-build-tools | ||
80 | {{/code}} | ||
81 | |||
![]() |
15.1 | 82 | This installs make, gcc, g++, python and all this. Somehow this does not really terminate. If nothing happens anymore it may be finished, just kill the process if it does not terminate. |
![]() |
1.1 | 83 | |
![]() |
15.1 | 84 | All the installed executables are not in the path and that is okay. This is not needed since yarn/npm knows how to call them when needed. |
85 | |||
![]() |
14.1 | 86 | Yarn can be downloaded and installed from [[here>>url:https://yarnpkg.com/lang/en/docs/install/#windows-stable||shape="rect"]]. |
87 | |||
![]() |
11.1 | 88 | === Known Problems in this step === |
89 | |||
![]() |
15.1 | 90 | If python3 was already installed this may cause some problems. |
![]() |
11.1 | 91 | |
![]() |
1.1 | 92 | == ... on mac: == |
93 | |||
94 | Get a package manager, something like [[brew>>url:https://brew.sh/index_de||shape="rect"]]. | ||
95 | |||
96 | Use brew to install all necessary stuff. | ||
97 | |||
98 | Apparently there is an issue with xcode-select: [[Theia developers>>url:https://github.com/theia-ide/theia/blob/master/doc/Developing.md||shape="rect"]] recommend the following: | ||
99 | |||
100 | {{code}} | ||
101 | xcode-select --install | ||
102 | {{/code}} | ||
103 | |||
![]() |
5.1 | 104 | After doing this for your OS all that is missing is running KEITH (in developer setup) and setting up your eclipse for language server development). |
![]() |
1.1 | 105 | |
![]() |
5.1 | 106 | = Stuff that may help = |
![]() |
1.1 | 107 | |
![]() |
5.1 | 108 | == Running the already build LS == |
![]() |
1.1 | 109 | |
![]() |
5.1 | 110 | Go to the latest [[Bamboo build>>url:https://rtsys.informatik.uni-kiel.de/bamboo/browse/KISEMA-NSI||shape="rect"]] and go to Artifacts. |
![]() |
1.1 | 111 | |
![]() |
5.1 | 112 | [[image:attach:image2019-2-7_17-46-58.png]] |
![]() |
1.1 | 113 | |
![]() |
5.1 | 114 | Select Language Server Zip and download the LS and unpack it somewhere. |
115 | |||
116 | Locate the kieler.ini file. Depending on the OS it has a different location (linux; toplevel, windows, toplevel, mac: Content/Eclipse/kieler.ini) | ||
117 | |||
118 | Paste the following at the beginning of the ini-file: | ||
119 | |||
![]() |
1.1 | 120 | {{code language="bash"}} |
![]() |
5.1 | 121 | -application |
122 | de.cau.cs.kieler.language.server.LanguageServer | ||
123 | -noSplash | ||
![]() |
1.1 | 124 | {{/code}} |
125 | |||
![]() |
5.1 | 126 | Since an eclipse application is built, this is needed to start the LS without a splashscreen. |
![]() |
1.1 | 127 | |
![]() |
5.1 | 128 | If you want to connect that LS via socket to your Theia application (KEITH) add the following to the vmargs: |
![]() |
3.1 | 129 | |
![]() |
5.1 | 130 | {{code}} |
131 | -Dport=5007 | ||
132 | {{/code}} | ||
![]() |
1.1 | 133 | |
![]() |
5.1 | 134 | 5007 is the standard port KEITH is currently connecting to in socket mode. You can find this port in your Theia application at the following location: |
![]() |
1.1 | 135 | |
![]() |
5.1 | 136 | Assume you are in the [[keith >>url:https://git.rtsys.informatik.uni-kiel.de/projects/KIELER/repos/keith/browse||shape="rect"]]repository. Go to {{code language="none"}}keith-app{{/code}}, you should see something like this: |
![]() |
1.1 | 137 | |
![]() |
5.1 | 138 | [[image:attach:image2019-2-7_17-58-22.png]] |
![]() |
1.1 | 139 | |
![]() |
5.1 | 140 | Open the {{code language="none"}}package.json{{/code}}. In the{{code language="none"}} package.json{{/code}} are several scripts defined. |
![]() |
3.1 | 141 | |
![]() |
26.1 | 142 | {{code language="js"}} |
143 | "scripts": { | ||
144 | "prepare": "yarn run clean && yarn build", | ||
145 | "clean": "theia clean", | ||
146 | "build": "theia build --mode development", | ||
147 | "start": "theia start --root-dir=../workspace", | ||
148 | "socket": "node ./src-gen/backend/main.js --root-dir=../workspace --LSP_PORT=5007 --port=3000 --loglevel=debug", | ||
149 | "watch": "theia build --watch --mode development" | ||
150 | }, | ||
151 | {{/code}} | ||
![]() |
1.1 | 152 | |
![]() |
26.1 | 153 | \\ |
154 | |||
![]() |
5.1 | 155 | The {{code language="none"}}LSP_PORT{{/code}} option is used to activate the connection via socket. It is also possible to specify a relative location to a LS via {{code language="none"}}LS_PATH=<path to LS>{{/code}}. |
![]() |
3.1 | 156 | |
![]() |
5.1 | 157 | == How run KEITH in developer setup (socket) == |
![]() |
3.1 | 158 | |
![]() |
5.1 | 159 | Run the following to build and run KEITH in its developer setup (in socket mode, so the LS has to be started separately) |
![]() |
3.1 | 160 | |
![]() |
26.1 | 161 | === Running KEITH in the browser === |
162 | |||
163 | \\ | ||
164 | |||
![]() |
5.1 | 165 | {{code language="bash"}} |
166 | yarn && cd keith-app && yarn run socket | ||
167 | {{/code}} | ||
168 | |||
![]() |
13.1 | 169 | //yarn// builds all the stuff. //yarn run socket// in keith-app starts the application. After an initial build via yarn you can run //yarn watch // to watch the changes in your repository. In another console you run yarn run socket in keith-app. Now refreshing your browser is enough to apply the changes. |
170 | |||
![]() |
5.1 | 171 | Per default the KEITH opens on localhost:3000. |
172 | |||
![]() |
26.1 | 173 | {{info}} |
![]() |
27.1 | 174 | If you previously build keith electron, you have to execute {{code language="none"}}yarn run rebuild:browser{{/code}} |
![]() |
26.1 | 175 | {{/info}} |
![]() |
7.1 | 176 | |
![]() |
26.1 | 177 | \\ |
178 | |||
179 | === Running KEITH as (unbundled) electron app === | ||
180 | |||
181 | {{code language="bash"}} | ||
182 | yarn && yarn run rebuild:electron && cd keith-app-electron && yarn run socket | ||
183 | {{/code}} | ||
184 | |||
185 | //yarn// builds all the stuff. //yarn run socket// in keith-app-electron starts the application. After an initial build via yarn you can run //yarn watch // to watch the changes in your repository. In another console you run yarn run socket in keith-app-electron. Now refreshing your browser is enough to apply the changes. | ||
186 | |||
187 | {{info}} | ||
![]() |
27.1 | 188 | If you previously build keith electron, you have to execute {{code language="none"}}yarn run rebuild:electron{{/code}} |
![]() |
26.1 | 189 | {{/info}} |
190 | |||
![]() |
13.1 | 191 | === Known issues for windows: === |
192 | |||
193 | nsfw.code not found: In the top level package.json exists a script called postinstall. Remove this on windows, delete the node_modules folder and rebuilt the application. This is a known issue of electron-builder. | ||
194 | |||
195 | === Known issues on mac: === | ||
196 | |||
197 | Since SWT is still used as part of the diagram synthesis (but is not relevant anymore). Since it is not called on the main thread this causes a deadlock. Therefore mac just does not work. | ||
198 | |||
199 | === Known issues: === | ||
200 | |||
![]() |
26.1 | 201 | * KEITH works in the browser/electron app, but not in the electron app/browser with the following error message:((( |
202 | {{code language="none"}}symbol lookup error: ... symbol lookup error: .../keith/node_modules/nsfw/build/Release/nsfw.node: undefined symbol: _ZN2v816FunctionTemplate3NewEPNS_7IsolateEPFvRKNS_20FunctionCallbackInfoINS_5ValueEEEENS_5LocalIS4_EENSA_INS_9SignatureEEEiNS_19ConstructorBehaviorENS_14SideEffectTypeE {{/code}}{{code language="none"}}Done in 0.90s.{{/code}} | ||
![]() |
13.1 | 203 | |
![]() |
26.1 | 204 | * run |
205 | |||
206 | {{code language="none"}} | ||
207 | yarn run rebuild:electron/browser | ||
208 | {{/code}} after yarn to fix this. | ||
209 | ))) | ||
210 | |||
![]() |
21.1 | 211 | \\ |