lingua-franca 0.10.1
Lingua Franca code generator
Loading...
Searching...
No Matches
org.lflang.federated.launcher.FedLauncherGenerator Class Reference

Utility class that can be used to create a launcher for federated LF programs. More...

Public Member Functions

void doGenerate (List< FederateInstance > federates, RtiConfig rtiConfig)
 Create the launcher shell scripts.
 FedLauncherGenerator (TargetConfig targetConfig, FederationFileConfig fileConfig, MessageReporter messageReporter)

Protected Attributes

FederationFileConfig fileConfig
MessageReporter messageReporter
TargetConfig targetConfig

Detailed Description

Utility class that can be used to create a launcher for federated LF programs.

Author
Edward A. Lee
Soroush Bateni

Constructor & Destructor Documentation

◆ FedLauncherGenerator()

org.lflang.federated.launcher.FedLauncherGenerator.FedLauncherGenerator ( TargetConfig targetConfig,
FederationFileConfig fileConfig,
MessageReporter messageReporter )
Parameters
targetConfigThe current target configuration.
fileConfigThe current file configuration.
messageReporterA error reporter for reporting any errors or warnings during the code generation

Member Function Documentation

◆ doGenerate()

void org.lflang.federated.launcher.FedLauncherGenerator.doGenerate ( List< FederateInstance > federates,
RtiConfig rtiConfig )

Create the launcher shell scripts.

This will create one or two files in the output path (bin directory). The first has name equal to the filename of the source file without the ".lf" extension. This will be a shell script that launches the RTI and the federates. If, in addition, either the RTI or any federate is mapped to a particular machine (anything other than the default "localhost" or "0.0.0.0"), then this will generate a shell script in the bin directory with name filename_distribute.sh that copies the relevant source files to the remote host and compiles them so that they are ready to execute using the launcher.

A precondition for this to work is that the user invoking this code generator can log into the remote host without supplying a password. Specifically, you have to have installed your public key (typically found in ~/.ssh/id_rsa.pub) in ~/.ssh/authorized_keys on the remote host. In addition, the remote host must be running an ssh service. On an Arch Linux system using systemd, for example, this means running:

sudo systemctl <start|enable> ssh.service

Enable means to always start the service at startup, whereas start means to just start it this once.

On macOS, open System Preferences from the Apple menu and click on the "Sharing" preference panel. Select the checkbox next to "Remote Login" to enable it.

In addition, every host must have OpenSSL installed, with at least version 1.1.1a. You can check the version with

openssl version

Parameters
federatesA list of federate instances in the federation
rtiConfigCan have values for 'host', 'dir', and 'user'

Member Data Documentation

◆ fileConfig

FederationFileConfig org.lflang.federated.launcher.FedLauncherGenerator.fileConfig
protected

◆ messageReporter

MessageReporter org.lflang.federated.launcher.FedLauncherGenerator.messageReporter
protected

◆ targetConfig

TargetConfig org.lflang.federated.launcher.FedLauncherGenerator.targetConfig
protected

The documentation for this class was generated from the following file:
  • /Users/runner/work/lingua-franca/lingua-franca/core/src/main/java/org/lflang/federated/launcher/FedLauncherGenerator.java