Building RCC Workers
The OpenCPI Component Development Guide explains how all workers are built (with ocpidev build worker), and this also applies to RCC workers.
The most common settings for building workers are set as top-level attributes in the worker’s OWD, as described in the CDG. This includes these settings:
any extra include search directories
component libraries to search for slaves for proxy workers
platforms to exclude when building
extra source files to compile with the worker
In the Attributes of a Top-level RCCWorker Element topic, additional build-related attributes specific to RCC workers are defined, such as those for prerequisite libraries.
Occasionally, how RCC workers are built requires more detailed control, and this is accomplished by creating a Makefile for the worker, including the single line:
include $(OCPI_CDK_DIR)/include/worker.mk
The variables shown below can be set in the Makefile before the above single required line in the Makefile.
RCC Compiler and Linking Options
For most RCC workers, the built-in compiler options are suitable and no extra variables are needed, and no Makefile need be created.
Compiler and link option variables exist in several variants, with suffixes to indicate how narrowly to apply them. For each such option variable mentioned in the table below, there are actually 6 potential variables with different suffixes. In the suffixes: <language> is C or CC (upper case) for C or C++, <os> is the operating system of target (e.g. linux or macos), and <platform> is the specific RCC target platform. E.g., for the RccCompileWarnings variable (in the table below) the variations are:
RccCompileWarnings
RccCompileWarnings<language>
RccCompileWarnings_<os>
RccCompileWarnings<language>_<os>
RccCompileWarnings_<platform>
RccCompileWarnings<language>_<platform>
The most specific one overrides all the less specific ones above it. For example, specifying:
RccCompileWarnings_linux=-Wabi
would indicate that you want -Wabi to be the only warning option when building RCC workers for the linux OS. If you also set:
RccCompileWarnings=-Wall
then for all OSs other than linux, the warnings would be -Wall. If you wanted the default for all targets to be -Wall, but to add -Wabi for linux, you would specify:
RccCompileWarnings=-Wall
RccCompileWarnings_linux=$(RccCompilerWarnings) -Wabi
For each variable, like the RccCompileWarnings example above, there are actually 2 variables that each use the suffixes scheme:
RccCompileWarnings– which OpenCPI controls and sets as appropriateRccExtraCompileWarnings– which OpenCPI never sets and whose contents is placed on the compile or link command line after the one without “Extra“.
Thus it is strongly recommended to use the Extra variants when possible. Specifying incorrect options for compilation and linking can easily result in errors. There is no guarantee that any additional options will be compatible with OpenCPI or result in functional worker binary artifacts. When changing these options, it is recommended to first run with default settings and use the showvars make target with the make command line to see how the options are used, before and after modifying these variables.
Makefile Variable |
Description |
|
For controlling compile warnings. Uses option
suffixes and |
|
For controlling compile options (not warnings).
Uses option suffixes and |
|
Options applied when creating the RCC worker
shared object file. Uses option suffixes and
|
|
Library options to specify libraries unknown to
OpenCPI. Uses option suffixes but not
|