Wiki source code of Building
Last modified by Alexander Schulz-Rosengarten on 2025/01/30 12:05
Hide last authors
author | version | line-number | content |
---|---|---|---|
![]() |
4.2 | 1 | == Building / Make Script == |
![]() |
1.1 | 2 | |
3 | The build process for the controller consists of two main tasks: | ||
4 | |||
5 | === Compilation from SCChart to C-Code === | ||
6 | |||
![]() |
3.1 | 7 | The SCCharts for the Controller are compiled by KIELER. This can either be done in the usual GUI Version or with the [[doc:KIELER.KIELER Command Line Compiler]]. |
![]() |
1.1 | 8 | |
9 | Before trying to run the code the compiler output should be checked. The compiler generates C-Code even if the Controller isn't fully schedulable, so be careful when trying new controllers. | ||
10 | |||
![]() |
4.1 | 11 | The generated C-Files should be stored in the ///code/// part of the local working copy but not commited to the repository. |
![]() |
1.1 | 12 | |
13 | === Compilation from C-Code to executable === | ||
14 | |||
![]() |
3.1 | 15 | To generate the final executable a python script is provided. This can be found at [[/code/make.py>>url:https://git.rtsys.informatik.uni-kiel.de/projects/PRAK/repos/14ss-railway/browse/code/make.py||shape="rect"]]. The script takes care of including the required modules and adds the needed headers to the controller. |
![]() |
1.1 | 16 | |
17 | Calling the script with the first parameter **rail** and the path to the C-Code compiles the controller for the real railway installation. | ||
18 | |||
19 | {{code language="bash"}} | ||
20 | python make.py rail railway/Tests/TestAll.c | ||
21 | {{/code}} | ||
22 | |||
23 | With the parameter **sim** instead of rail the simulation is built. | ||
24 | |||
25 | {{code language="bash"}} | ||
26 | python make.py sim railway/Tests/TestAll.c | ||
27 | {{/code}} | ||
28 | |||
29 | The generated executables are located in the /code/build/ directory. These files should normally not be commited to the repository. | ||
30 | |||
31 | With the second parameter **run** the code is executed after finishing the compilation. | ||
32 | |||
33 | {{code language="bash" collapse="true"}} | ||
34 | python make.py sim run railway/Tests/TestAll.c | ||
35 | {{/code}} |