|
|
# Overview
|
|
|
The main command used for building real time models is the `rtcds build <model>` command.
|
|
|
The main command used for building real time models is the `rtcds build <model>` command. This page walks a user through setting up the environment and running the commands to build custom models.
|
|
|
|
|
|
# Build Environment
|
|
|
In order for the `rtcds` command to be able to find your models, code etc. a few environment variables must be set.
|
... | ... | @@ -89,7 +89,7 @@ CDS_IFO_SRC=/home/controls/advligorts/src/include/ |
|
|
```
|
|
|
While `rtcds` has appended some additional paths to the `RCG_LIB_PATH` variable, the path we added (`/home/controls/models/`) is present in the list. Now when we run `rtcds build <model_name>`, `rtcds` will look in `/home/controls/models/` for a file named `<model_name>.mdl`
|
|
|
|
|
|
## Building Custom Models (CyMAC Usecase)
|
|
|
# Building Custom Models (CyMAC Usecase)
|
|
|
Now that the environment has been set up, all we need to do is run the `rtcds build <model_name> ` command. Example output for building a model with the mdl filename of `x1unittest.mdl`:
|
|
|
```shell
|
|
|
controls@x1cymac:~/models$ rtcds build x1unittest
|
... | ... | @@ -113,4 +113,30 @@ Successfully compiled x1unittest |
|
|
Compile Warnings, found in /var/cache/advligorts/rcg-cymac-build//models/x1unittest/logs/x1unittest_warnings.log:
|
|
|
***********************************************
|
|
|
***********************************************
|
|
|
``` |
|
|
\ No newline at end of file |
|
|
```
|
|
|
|
|
|
### Build Output
|
|
|
Build products are stored in `$RCG_BUILDD/models/<model_name>`. Note that `RCG_BUILDD` is not a Linux env variable, so you will have to view it with `rtcds env` and navigate to the displayed path.
|
|
|
|
|
|
Starting with RCG version 5.0+ the structure of the RCG_BUILDD has changed, and is now more modular/intuitive. If you are used to older versions, this output will look different.
|
|
|
|
|
|
For out example the build products are stored in `/var/cache/advligorts/rcg-cymac-build//models/x1unittest`. Doing a tree of that directory the following structure is observed:
|
|
|
```shell
|
|
|
controls@x1cymac:~$ tree -L 1 /var/cache/advligorts/rcg-cymac-build/models/x1unittest/
|
|
|
/var/cache/advligorts/rcg-cymac-build/models/x1unittest/
|
|
|
├── epics
|
|
|
├── include
|
|
|
├── kernel_mod
|
|
|
├── logs
|
|
|
├── target
|
|
|
└── userspace
|
|
|
```
|
|
|
#### Explanation
|
|
|
| Directory | Used For |
|
|
|
| --------- | --------- |
|
|
|
| `epics/` | Stores the generated EPICS process that is built alongside the kernel module |
|
|
|
| `include/` | Contains shared header files for the Kernel module and EPICS process |
|
|
|
| `kernel_mod/` | This has the kernel module build scrips and kernel space generated real time model code|
|
|
|
| `logs/` | Contains log file from the various parts of the model build |
|
|
|
| `target/` | Mirrors what the model will look like when it is install on the system. This stores the kernel module `.ko` EPICS process and configuration and information about the env/code that was used to build.
|
|
|
| `userspace/` | Stores the userspace build scrips and generated model code | |