|
|
# Overview
|
|
|
The main command used for building real time models is the `rtcds build <model>` command.
|
|
|
|
|
|
# Build Environment
|
|
|
In order for the `rtcds` command to be able to find your models, code etc. a few environment variables must be set.
|
|
|
|
|
|
### Listing the `rtcds` Build Environment
|
|
|
The environment can be listed by running the command:
|
|
|
```shell
|
|
|
controls@x1cymac:~$ rtcds env
|
|
|
SITE=TST
|
|
|
site=tst
|
|
|
IFO=X1
|
|
|
ifo=x1
|
|
|
RCG_SRC=/usr/share/advligorts/src
|
|
|
RTS_VERSION=5.0.0~devel
|
|
|
RCG_LIB_PATH=/home/controls/git/advligorts/test/:/usr/share/advligorts/src/src/epics/simLink/:/usr/share/advligorts/src/src/epics/simLink/lib
|
|
|
CHECK_MODEL_IN_HOST=False
|
|
|
IS_DOLPHIN_NODE=False
|
|
|
DOLPHIN_GEN=ix
|
|
|
DAQ_STREAMING=False
|
|
|
USE_KERNEL_MODELS=True
|
|
|
RCG_BUILD_ROOT=/var/cache/advligorts
|
|
|
RCG_BUILDD=/var/cache/advligorts/rcg-5.0.0~devel
|
|
|
RCG_TARGET=/opt/rtcds/tst/x1
|
|
|
CDS_SRC=/home/controls/git/advligorts/test/
|
|
|
CDS_IFO_SRC=/home/controls/git/advligorts/test/
|
|
|
ALLOW_MODEL_ENABLE=True
|
|
|
CDS_MEDM_PATH=/opt/rtcds/tst/x1/medm/templates
|
|
|
CDS_SCRIPTS_PATH=/opt/rtcds/tst/x1/post_build
|
|
|
START_DELAY=15
|
|
|
EPICS_ONLY_MODELS=
|
|
|
```
|
|
|
It is important to note that this environment is being built up from multiple places, and ***not all variables are overridable***. For a complete listing checkout the [full build environment documentation](rtcds-Build-Environment-Variables)
|
|
|
|
|
|
<details>
|
|
|
<summary>Production Build Server Environment Example</summary>
|
|
|
|
|
|
```shell
|
|
|
(diskless)controls@h1build:~$ rtcds env
|
|
|
found host specific environment file '/etc/advligorts/systemd_env_h1build'
|
|
|
Build kernel-mode models by default
|
|
|
RTS_VERSION=4.2.8
|
|
|
SITE=LHO
|
|
|
IFO=H1
|
|
|
RCG_LIB_PATH=/opt/rtcds/userapps/release/als/h1/models:/opt/rtcds/userapps/release/als/common/models:/opt/rtcds/userapps/release/asc/h1/models:/opt/rtcds/userapps/release/asc/common/models:/opt/rtcds/userapps/release/cal/h1/models:/opt/rtcds/userapps/release/cal/common/models:/opt/rtcds/userapps/release/cds/h1/models:/opt/rtcds/userapps/release/cds/common/models:/opt/rtcds/userapps/release/hpi/h1/models:/opt/rtcds/userapps/release/hpi/common/models:/opt/rtcds/userapps/release/imc/h1/models:/opt/rtcds/userapps/release/imc/common/models:/opt/rtcds/userapps/release/ioo/h1/models:/opt/rtcds/userapps/release/ioo/common/models:/opt/rtcds/userapps/release/isc/h1/models:/opt/rtcds/userapps/release/isc/common/models:/opt/rtcds/userapps/release/isi/h1/models:/opt/rtcds/userapps/release/isi/common/models:/opt/rtcds/userapps/release/lsc/h1/models:/opt/rtcds/userapps/release/lsc/common/models:/opt/rtcds/userapps/release/omc/h1/models:/opt/rtcds/userapps/release/omc/common/models:/opt/rtcds/userapps/release/pem/h1/models:/opt/rtcds/userapps/release/pem/common/models:/opt/rtcds/userapps/release/psl/h1/models:/opt/rtcds/userapps/release/psl/common/models:/opt/rtcds/userapps/release/sqz/h1/models:/opt/rtcds/userapps/release/sqz/common/models:/opt/rtcds/userapps/release/sus/h1/models:/opt/rtcds/userapps/release/sus/common/models:/opt/rtcds/userapps/release/sys/h1/models:/opt/rtcds/userapps/release/sys/common/models:/opt/rtcds/userapps/release/tcs/h1/models:/opt/rtcds/userapps/release/tcs/common/models:/opt/rtcds/userapps/release/cds/test/models:/usr/share/advligorts/src/src/epics/simLink/:/usr/share/advligorts/src/src/epics/simLink/lib
|
|
|
RCG_SRC=/usr/share/advligorts/src
|
|
|
RCG_BUILD_ROOT=/opt/rtcds/rtbuild
|
|
|
RCG_BUILDD=/opt/rtcds/rtbuild/rcg-4.2.8
|
|
|
RCG_TARGET=/opt/rtcds/lho/h1
|
|
|
```
|
|
|
|
|
|
Note that the `RCG_LIB_PATH` is very long, pulling in all `h1` specific models.
|
|
|
</details>
|
|
|
|
|
|
### Setting the Build Environment
|
|
|
|
|
|
These paths assume you cloned advligorts into your home directory, you will need to adjust to the paths for the directory you chose.
|
|
|
|
|
|
```shell
|
|
|
export RTS_VERSION=cymac-build
|
|
|
export RCG_SRC=/home/$USER/advligorts/
|
|
|
export CDS_SRC=/home/$USER/advligorts/src/include/
|
|
|
```
|
|
|
|
|
|
|
|
|
## Building Custom Models (CyMAC Usecase)
|
|
|
In order for `rtcds` to find your model (the <model_name>.mdl file) the `RCG_LIB_PATH` env variable needs to have a path to the directory containing it. The best way to do that, is adding the directory path to the `RCG_LIB_PATH` line in the `/etc/advligorts/env` file.
|
|
|
|
|
|
If you have your custom model located at `/home/controls/models/` then you should add that path (colon (:) separated) to your env file.
|
|
|
|
|
|
After adding the line, your `/etc/advligorts/env` file might look like:
|
|
|
```shell
|
|
|
SITE=TST
|
|
|
IFO=X1
|
|
|
RCG_LIB_PATH=/home/controls/git/advligorts/test/:/home/controls/models/
|
|
|
```
|
|
|
Note the `RTS_ENV` environmental variable will override where `rtcds` looks for the env file, so if you want the default functionality make sure it is unset.
|
|
|
|
|
|
### Verification
|
|
|
You can list your `rtcds` environment again with the `rtcds env` command and your output after setting the version/src/build variables and editing the `/etc/advligorts/env` file will look something like:
|
|
|
```shell
|
|
|
controls@x1cymac:~$ rtcds env
|
|
|
...
|
|
|
...
|
|
|
RCG_SRC=/home/controls/advligorts/
|
|
|
RTS_VERSION=cymac-build
|
|
|
RCG_LIB_PATH=/home/controls/git/advligorts/test/:/home/controls/models/:/home/controls/advligorts//src/epics/simLink/:/home/controls/advligorts//src/epics/simLink/lib
|
|
|
...
|
|
|
RCG_BUILD_ROOT=/var/cache/advligorts
|
|
|
RCG_BUILDD=/var/cache/advligorts/rcg-cymac-build
|
|
|
RCG_TARGET=/opt/rtcds/tst/x1
|
|
|
CDS_SRC=/home/controls/advligorts/src/include/
|
|
|
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` |
|
|
\ No newline at end of file |