### Basic Build and Toolchain Configuration Source: https://github.com/eclipse-4diac/4diac-fbe/blob/release/configurations/inc/minimal.txt Defines fundamental build parameters such as the target architecture, inclusion of external configuration files, dependencies, FORTE architecture, and the installation prefix for the compiled binaries. It also includes options for adding extra C and linker flags to the toolchain. ```Configuration // (cross-)compiler architecture, e.g. arm-linux-musleabihf ARCH=native-toolchain // You can split up configuration into multiple files; list any amount of // file names separated by comma. Settings in this file will always override // included settings. //include= // build additional packages from the ../dependencies/recipes directory, comma // separated list DEPS= // one of: Posix, Win32, MacOs, and others; not usable without extensive adaption FORTE_ARCHITECTURE= // Install path prefix, prepended onto install directories. // Note: the string "${BASEDIR}" (without quotes) will be replaced by the // build environment base directory, i.e. the direcotry that contains compile.py // Also, "${HOME}" will be replaced by the user profile (home) directory. CMAKE_INSTALL_PREFIX= // Add compile/link flags to all packages. Note that you may need :STRING for // parsing robustness. TOOLCHAIN_EXTRA_C_FLAGS= TOOLCHAIN_EXTRA_LINKER_FLAGS= ``` -------------------------------- ### FORTE Bootfile and Debugging Options Source: https://github.com/eclipse-4diac/4diac-fbe/blob/release/configurations/inc/minimal.txt Configures the bootfile location for the FORTE runtime and enables boot file support. This section also specifies debugging parameters, including the CMake build type (e.g., Release, Debug), the logging level for FORTE messages, and options for tracing events and CTF. ```Configuration // Path to the bootfile (forte.fboot) //FORTE_BootfileLocation= //FORTE_SUPPORT_BOOT_FILE=ON /////////////// // Debugging // /////////////// // Possible values: Debug Release RelWithDebInfo MinSizeRel. CMAKE_BUILD_TYPE=Release // Possible values: LOGDEBUG LOGERROR LOGWARNING LOGINFO NOLOG FORTE_LOGLEVEL=NOLOG // log the events received at and sent from function blocks // FORTE_TRACE_EVENTS=OFF // FORTE_TRACE_CTF=OFF ``` -------------------------------- ### Compile 4diac FORTE Runtime Executable Source: https://github.com/eclipse-4diac/4diac-fbe/blob/release/README.md Execute the build process for 4diac FORTE. On Linux/macOS, use the shell script. On Windows, `compile.cmd` allows for double-click execution. All configured builds will be generated, with binaries located in `build//output/bin`. ```Shell ./compile.sh ``` ```Shell compile.cmd ``` -------------------------------- ### I/O and Communication Module Configuration Source: https://github.com/eclipse-4diac/4diac-fbe/blob/release/configurations/inc/minimal.txt Defines the I/O modules and communication protocols to be included in the FORTE build. It allows selection from a list of supported I/O modules (e.g., EMBRICK, PLC01A1) and communication stacks (e.g., ETH, MODBUS, OPC_UA). It also specifies the management interface protocol, currently supporting DEV_MGR. ```Configuration /////////////////////////// // I/O and Communication // /////////////////////////// // I/O Modules: comma-separated list of // EMBRICK, PLC01A1, PLCNEXT IO= // old style I/O block backend: choose either IO= above, OR exactly one of // CONMELEON_C1, I2C_Dev, LMS_EV3, MLPI, Odroid, PiFace, Raspberry_SPS, SysFs, WagoKbus, uMIC //IO_PROCESS= // Communication modules: comma-separated list of // ETH, FBDK, HTTP, LOCAL, MODBUS, OPC_UA, PAHOMQTT, RAW, SER, STRUCT_MEMBER, TSN, XqueryClient // There may be more, those are untested COM=LOCAL // Management interface protocol: currently only DEV_MGR, OPC-UA coming soon FORTE_MGMCOMMANDPROTOCOL=DEV_MGR ``` -------------------------------- ### FORTE External Library Dependencies Source: https://github.com/eclipse-4diac/4diac-fbe/blob/release/configurations/test/test-all.txt Lists the external libraries that the FORTE project depends on for compilation and linking. This includes common industrial communication protocols and XML parsing libraries like libmodbus, open62541, paho.mqtt.c, and tinyxml. ```Configuration ###DEPS=openpowerlink DEPS=libmodbus DEPS=open62541 DEPS=paho.mqtt.c DEPS=tinyxml ``` -------------------------------- ### Developer and Advanced Build Options Source: https://github.com/eclipse-4diac/4diac-fbe/blob/release/configurations/inc/minimal.txt Provides advanced configuration options primarily for developers, influencing aspects like RTTI and exceptions, source modification for missing includes, linked string dictionaries, and stack trace generation. It also includes settings for enabling and configuring various test suites and static analysis tools like Clang-Tidy. ```Configuration /////////////////////// // Developer options // /////////////////////// FORTE_RTTI_AND_EXCEPTIONS:BOOL=FALSE FORTE_MODIFY_SOURCES_ON_MISSING_GENERATED_INCLUDES=OFF FORTE_LINKED_STRINGDICT:BOOL=ON FORTE_STACKTRACE=OFF FORTE_SYSTEM_TESTS=OFF FORTE_TESTS=OFF FORTE_TEST_NEEDED_COMPILER_FEATURES=OFF //FORTE_CLANG_TIDY_MODE=WARNING //FORTE_CLANG_TIDY_MODE=FIX ``` -------------------------------- ### FORTE Core Build Parameters Source: https://github.com/eclipse-4diac/4diac-fbe/blob/release/configurations/test/test-all.txt Defines fundamental build settings for the FORTE project, including the architecture, build type (Debug), logging verbosity, and enabling/disabling of tracing and exception handling. It also references a default configuration file. ```Configuration include=../inc/default.txt ARCH=arm-linux-musleabihf CMAKE_BUILD_TYPE=Debug FORTE_LOGLEVEL=LOGDEBUG ###FORTE_TESTS=ON ###FORTE_SYSTEM_TESTS=ON FORTE_TRACE_EVENTS=ON FORTE_ENABLE_FMU=OFF FORTE_RTTI_AND_EXCEPTIONS:BOOL=ON ``` -------------------------------- ### Simulation and General Feature Enablement Source: https://github.com/eclipse-4diac/4diac-fbe/blob/release/configurations/inc/minimal.txt Configures simulation-related features such as FMU (Functional Mock-up Unit) support and fake time. It also enables general FORTE functionalities like monitoring, query management commands, and support for custom serializable datatypes. This section allows fine-grained control over the runtime's capabilities. ```Configuration //////////////////////// // Simulation options // /////////////////////// //FORTE_ENABLE_FMU=OFF //FORTE_FAKE_TIME=OFF /////////////////////////////////////////////////////////////////////////////// // End of regular configuration. Options for highly specialised builds follow. /////////////////////////////////////////////////////////////////////////////// // Add any other CMake configuration option here. ////////////////////// // General Features // ////////////////////// // FB groups to include: comma-separated list of // ADS, Arrowhead, CONVERT, IEC61131, POWERLINK, RECONFIGURATION, ROS, RT_Events, UTILS // This may be specified multiple times; all enabled modules are joined. // specify MODULE=-FOO to remove a single module from the list of modules MODULE=CONVERT,IEC61131,UTILS // Exclude Function blocks //FORTE_EXCLUDE_FBS= // Enable FORTE monitoring functionalities FORTE_SUPPORT_MONITORING:BOOL=ON // Enable support for the query management commands FORTE_SUPPORT_QUERY_CMD:BOOL=ON // Custom Serializeable Datatypes FORTE_SUPPORT_CUSTOM_SERIALIZABLE_DATATYPES:BOOL=ON // Dynamic type support // FORTE_USE_LUATYPES=LuaJIT // DEPS=luajit ``` -------------------------------- ### FORTE Enabled I/O Interfaces Source: https://github.com/eclipse-4diac/4diac-fbe/blob/release/configurations/test/test-all.txt Identifies the input/output interface modules currently enabled within the FORTE project. The configuration shows 'EMBRICK' as an active I/O module, with 'SysFs' commented out. ```Configuration IO=EMBRICK #IO_PROCESS=SysFs ``` -------------------------------- ### Compile Specific 4diac FORTE Configuration Source: https://github.com/eclipse-4diac/4diac-fbe/blob/release/README.md Demonstrates how to compile a specific configuration file by providing its path to the `compile.sh` script. This allows building individual subdirectories instead of the default set of configurations. ```Shell ./compile.sh configurations/test ``` -------------------------------- ### Define Project Build Configuration Variables Source: https://github.com/eclipse-4diac/4diac-fbe/blob/release/configurations/test/test-native.txt These variables set up the build environment for the 4diac-fbe project. 'include' might reference another configuration file, 'ARCH' specifies the target architecture (e.g., native-toolchain), 'CMAKE_BUILD_TYPE' defines the build optimization level (e.g., Release), and 'FORTE_LOGLEVEL' controls the verbosity of logging during execution. ```Shell include=test-all.txt ARCH=native-toolchain CMAKE_BUILD_TYPE=Release FORTE_LOGLEVEL=NOLOG ``` -------------------------------- ### OPC-UA Server Configuration Source: https://github.com/eclipse-4diac/4diac-fbe/blob/release/configurations/inc/minimal.txt Provides options for configuring the integrated OPC-UA server within FORTE. This includes setting a custom hostname, enabling or disabling multicast support and encryption, and specifying the listening port for the OPC-UA server. These settings are crucial for OPC-UA client connectivity and security. ```Configuration //////////////////// // OPC-UA options // //////////////////// // Custom hostname which is used for the OPC UA app name and app uri FORTE_COM_OPC_UA_CUSTOM_HOSTNAME= // Enable multicast support for OPC UA and registering with LDS // FIXME: there is a build error in open62541 at the moment FORTE_COM_OPC_UA_MULTICAST:BOOL=OFF // enable encryption support FORTE_COM_OPC_UA_ENCRYPTION:BOOL=ON // Port where the OPC_UA server will listen FORTE_COM_OPC_UA_PORT=4840 ``` -------------------------------- ### FORTE Enabled Communication Interfaces Source: https://github.com/eclipse-4diac/4diac-fbe/blob/release/configurations/test/test-all.txt Enumerates the communication interfaces actively enabled for the FORTE project, supporting various protocols like Ethernet, HTTP, MODBUS, OPC UA, and MQTT. It also includes specific settings for OPC UA encryption. ```Configuration COM=ETH COM=FBDK COM=HTTP COM=LOCAL COM=MODBUS COM=OPC_UA COM=PAHOMQTT COM=RAW COM=SER COM=TSN FORTE_COM_OPC_UA_ENCRYPTION=ON ###FORTE_COM_OPC_UA_MULTICAST=ON ``` -------------------------------- ### Debug 4diac FORTE Compile Problems with Verbose Output Source: https://github.com/eclipse-4diac/4diac-fbe/blob/release/README.md Use the `-v` option with `compile.sh` to force a single-threaded build and output individual compiler command lines. This helps in debugging unexplainable compiler errors by providing more readable error output and verifying search paths and compiler options. Note: The build directory must be deleted when switching between verbose and normal builds. ```Shell ./compile.sh -v ... ``` -------------------------------- ### FORTE Enabled Functional Modules Source: https://github.com/eclipse-4diac/4diac-fbe/blob/release/configurations/test/test-all.txt Lists the core functional modules that are enabled for the FORTE project. These modules provide capabilities such as data conversion, IEC 61131 compliance, dynamic reconfiguration, real-time event handling, and general utilities. ```Configuration ###MODULE=Arrowhead MODULE=CONVERT MODULE=IEC61131 ###MODULE=POWERLINK MODULE=RECONFIGURATION MODULE=RT_Events MODULE=UTILS ``` -------------------------------- ### Initialize Directories and Collect Source Files (CMake) Source: https://github.com/eclipse-4diac/4diac-fbe/blob/release/modules/EclipseGeneratedFBs/CMakeLists.txt Sets directory properties, creates necessary directories for generated and edited source files, and then uses `file(GLOB)` to collect lists of C++ header and source files from these directories. This prepares the environment for subsequent file management operations. ```CMake set_directory_properties(PROPERTIES CMAKE_CONFIGURE_DEPENDS generated) file(MAKE_DIRECTORY generated edited edited/original) file(GLOB gen RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/generated generated/*.cpp generated/*.h) file(GLOB edit RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/edited edited/*.cpp edited/*.h) ``` -------------------------------- ### Clean 4diac-fbe Build Directory Source: https://github.com/eclipse-4diac/4diac-fbe/blob/release/README.md To perform a clean rebuild from scratch, delete the `build` subdirectory. This action is typically only necessary if library recipes in the `dependencies` directory have been modified, ensuring a fresh compilation environment. ```Shell rm -rf build ``` ```Shell rd /s /q build ``` -------------------------------- ### Build Specific 4diac FORTE Configuration Source: https://github.com/eclipse-4diac/4diac-fbe/blob/release/README.md To build only a single, specific configuration of 4diac FORTE, provide its base name as an argument to the compile script. This overrides the default behavior of building all configurations, allowing for targeted builds. ```Shell ./compile.sh native-toolchain ``` -------------------------------- ### FORTE Toolchain Flags for Static Linking Source: https://github.com/eclipse-4diac/4diac-fbe/blob/release/configurations/test/test-all.txt Specifies additional compiler and linker flags to optimize the build process. It explicitly disables address sanitizer and link-time optimization, which are incompatible with static linking configurations used in this project. ```Configuration // address sanitizer doesn't work with static linking TOOLCHAIN_EXTRA_C_FLAGS=-fno-sanitize=address -fno-lto TOOLCHAIN_EXTRA_LINKER_FLAGS=-fno-sanitize=address -fno-lto ``` -------------------------------- ### FORTE External Modules Directory Path Source: https://github.com/eclipse-4diac/4diac-fbe/blob/release/configurations/test/test-all.txt Configures the path where the FORTE build system looks for external modules. It is explicitly set to a non-existent directory, indicating that no additional local modules are expected or included in this specific build configuration. ```Configuration // no local additions FORTE_EXTERNAL_MODULES_DIRECTORY=/nonexistant ``` -------------------------------- ### Define Core Build Parameters Source: https://github.com/eclipse-4diac/4diac-fbe/blob/release/configurations/debug.txt This snippet specifies fundamental build parameters for the project. It includes a directive to incorporate default settings from an external file, sets the CMake build type to 'Debug', and configures the FORTE logging level to 'LOGDEBUG'. These settings are crucial for controlling the compilation process and the verbosity of runtime logs. ```Build Configuration include=inc/default.txt CMAKE_BUILD_TYPE=Debug FORTE_LOGLEVEL=LOGDEBUG ``` -------------------------------- ### FORTE Disabled Communication Modules (Reasons) Source: https://github.com/eclipse-4diac/4diac-fbe/blob/release/configurations/test/test-all.txt Documents communication modules that are explicitly disabled in the FORTE build, along with the specific reasons for their exclusion. Reasons include platform-specific issues (e.g., Windows-only OPC) or dependencies on external libraries (e.g., BaseX for XqueryClient). ```Configuration // disabled due to missing external library support // - only on win32, code uses nonstandard VC++ idioms, needs opc library COM=-OPC // - needs https://basex.org/ COM=-XqueryClient ``` -------------------------------- ### 4diac FBE Build Environment Configuration Source: https://github.com/eclipse-4diac/4diac-fbe/blob/release/configurations/test/test-revpi.txt This snippet sets up essential build environment variables for the 4diac FBE project. It specifies the target architecture, build optimization level, logging verbosity, and the I/O interface to be used during compilation and execution. ```Configuration include=../inc/default.txt ARCH=arm-linux-musleabihf CMAKE_BUILD_TYPE=Debug FORTE_LOGLEVEL=LOGDEBUG IO=REVOLUTIONPI ``` -------------------------------- ### FORTE Disabled Functional Modules (Reasons) Source: https://github.com/eclipse-4diac/4diac-fbe/blob/release/configurations/test/test-all.txt Details functional modules that are intentionally excluded from the FORTE build, providing justifications for their disablement. Reasons range from deprecation (ROS1) and missing external library dependencies (ADS, MLPI, WagoKbus) to being classified as IO_PROCESS modules. ```Configuration // - needs full ROS install plus manual tweaking plus dynamic linkng // plus ROS1 is deprecated by now MODULE=-ROS // - needs https://github.com/Beckhoff/ADS/tree/master/AdsLib MODULE=-ADS // - needs external library support for the Bosch Rexroth API MODULE=-MLPI // - needs WAGO support library MODULE=-WagoKbus // disabled due to being IO_PROCESS modules MODULE=-CONMELEON_C1 MODULE=-Odroid MODULE=-PiFace // FIXME: this doesn't even typedef CProcessInterface MODULE=-Raspberry_SPS #MODULE=-SysFs MODULE=-I2C_Dev MODULE=-uMIC ``` -------------------------------- ### Force 4diac-fbe Toolchain Update Source: https://github.com/eclipse-4diac/4diac-fbe/blob/release/README.md If significant toolchain updates occur, run this script to force a re-download of the current toolchain release, ensuring your build environment is up-to-date. This helps in resolving potential issues from outdated dependencies. ```Shell toolchains/etc/bootstrap/clean.sh ``` -------------------------------- ### Configure .gitignore for Custom 4diac FORTE Modules Source: https://github.com/eclipse-4diac/4diac-fbe/blob/release/README.md This .gitignore entry is used within a custom module directory to unignore all files, allowing selective management of modules in local branches or subrepos. By default, the git repository ignores all modules. ```Gitignore !* ``` -------------------------------- ### Configure and Add Custom Function Blocks (CMake) Source: https://github.com/eclipse-4diac/4diac-fbe/blob/release/modules/EclipseGeneratedFBs/CMakeLists.txt Configures the build system to include custom function blocks (FBs) by setting a cache variable and calling a custom `forte_add_module` function. It then globbs all custom C++ source files from the `edited` directory, extracts their base names, and adds them to the build using `forte_add_sourcefile_hcpp`. This integrates the custom FBs into the 4DIAC-FBE project. ```CMake set(FORTE_MODULE_CUSTOM_FBS ON CACHE BOOL "") forte_add_module(CUSTOM_FBS ON "Custom FBs") file(GLOB CUSTOM_SRCS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} edited/*.cpp) foreach(CUSTOM_SRC IN LISTS CUSTOM_SRCS) string(REGEX REPLACE "\\.cpp" "" CUSTOM_SRC "${CUSTOM_SRC}") message(STATUS ">>> Adding custom FB: ${CUSTOM_SRC}") forte_add_sourcefile_hcpp(${CUSTOM_SRC}) endforeach() ``` -------------------------------- ### Synchronize Generated and Edited Source Files (CMake) Source: https://github.com/eclipse-4diac/4diac-fbe/blob/release/modules/EclipseGeneratedFBs/CMakeLists.txt This comprehensive block handles the synchronization of newly generated source files with their manually edited counterparts. It first checks for completely new files, copying them to both the `edited` and `edited/original` directories. Then, it iterates through existing generated files, performing a diff against the `edited/original` version. If changes are detected, it applies patches to the `edited` version and updates the `edited/original` copy, ensuring manual edits are preserved where possible. ```CMake if (NOT gen STREQUAL "") # check for completely new and previously-known new files set(newfiles "${gen}") foreach(src IN LISTS newfiles) if (NOT EXISTS "edited/${src}") message(STATUS "*!* Adding new source file: ${src}") file(COPY "generated/${src}" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/edited/original/") file(COPY "generated/${src}" DESTINATION "${CMAKE_CURRENT_SOURCE_DIR}/edited/") else() message(FATAL_ERROR "New source file would overwrite unknown file: edited/${src}") endif() endforeach() # update changed files foreach(src IN LISTS gen) set(old "${CMAKE_CURRENT_SOURCE_DIR}/edited/original/${src}") set(new "${CMAKE_CURRENT_SOURCE_DIR}/generated/${src}") set(edited "${CMAKE_CURRENT_SOURCE_DIR}/edited/${src}") set(diff "${CMAKE_CURRENT_BINARY_DIR}/${src}.diff") set(patched "${CMAKE_CURRENT_BINARY_DIR}/${src}") execute_process(COMMAND diff -q "${old}" "${new}" OUTPUT_QUIET RESULT_VARIABLE rc) if (rc EQUAL 0) file(REMOVE "${new}" "${diff}") elseif (rc EQUAL 1) message(STATUS "*!* Updating source file: ${src}") execute_process(COMMAND diff -u "${old}" "${edited}" OUTPUT_FILE "${diff}" RESULT_VARIABLE rc) if (NOT (rc EQUAL 0 OR rc EQUAL 1)) message(FATAL_ERROR "Could not diff ${old} and ${edited}!") endif() file(COPY "${new}" DESTINATION "${CMAKE_CURRENT_BINARY_DIR}") execute_process(COMMAND patch -N "${patched}" "${diff}" RESULT_VARIABLE rc) if (NOT rc EQUAL 0) message(FATAL_ERROR "Could not update ${edited}! Please update manually, then copy ${new} to edited/original/") endif() file(RENAME "${patched}" "${edited}") file(COPY "${new}" "${old}") file(REMOVE "${diff}") else() message(FATAL_ERROR "Could not diff ${old} and ${new}!") endif() endforeach() endif() ``` -------------------------------- ### Remove Orphaned Original Source Files (CMake) Source: https://github.com/eclipse-4diac/4diac-fbe/blob/release/modules/EclipseGeneratedFBs/CMakeLists.txt This section identifies and removes source files from the `edited/original` directory that no longer have a corresponding file in the `edited` directory. This ensures that the `edited/original` directory remains synchronized and does not contain outdated or unreferenced files. ```CMake file(GLOB edit_orig RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/edited/original edited/original/*.cpp edited/original/*.h) foreach(src IN LISTS edit_orig) if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/edited/${src}") message(STATUS "*!* Missing source file: ${src}, removing related data...") file(REMOVE "${CMAKE_CURRENT_SOURCE_DIR}/edited/original/${src}") endif() endforeach() ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.