Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standalone rti #395

Merged
merged 24 commits into from
Jul 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
7b34ddf
Use fileConfig.compilerMode
Soroosh129 Jul 3, 2021
9c36a64
Moved federated files into their own folder
Soroosh129 Jul 3, 2021
5c43a15
Moved RTI-related global fields to a RTI_instance_t
Soroosh129 Jul 3, 2021
d518668
Updated usage. Made instance definitions local
Soroosh129 Jul 3, 2021
ca0a631
First working version of standalone RTI. Tests will fail because RTI …
Soroosh129 Jul 5, 2021
bc18580
Adjusted RTI arguments
Soroosh129 Jul 5, 2021
66da5d4
Updated the README file with instructions on how to enable DEBUG mess…
Soroosh129 Jul 5, 2021
bd492dd
Updated CMakeLists.txt with support of enabling DEBUG messages for th…
Soroosh129 Jul 5, 2021
a791bda
Fixed an issue with clock sync levels
Soroosh129 Jul 5, 2021
3938227
Updated comment to reflect how clock sync period is given to the RTI now
Soroosh129 Jul 5, 2021
79c4cea
Fixed incorrect time value
Soroosh129 Jul 5, 2021
57a8ca8
First attempt at installing the RTI on Github Actions
Soroosh129 Jul 5, 2021
6c893e8
Second attempt at installing the RTI on Github Actions
Soroosh129 Jul 5, 2021
ffb15fb
Updated federated launcher to use the latest package format
Soroosh129 Jul 5, 2021
ed34e23
Fixed an issue where the log directory for the RTI was not being crea…
Soroosh129 Jul 5, 2021
e8840c7
Fixed time format
Soroosh129 Jul 5, 2021
cb0a162
Updates to comments and minor fix for RTI's launch command
Soroosh129 Jul 6, 2021
ffd610b
Fix for type conversions
Soroosh129 Jul 6, 2021
39e9b48
Enable debug messages for the RTI to see more information
Soroosh129 Jul 6, 2021
d03fc04
Disable debug
Soroosh129 Jul 6, 2021
75a1014
Comments only
Soroosh129 Jul 6, 2021
1f71b13
Fixed typo
Soroosh129 Jul 6, 2021
e268d5d
Merge remote-tracking branch 'origin/master' into standalone-RTI
Soroosh129 Jul 6, 2021
76ec2c3
Update org.lflang/src/lib/core/federated/net_common.h
lhstrh Jul 13, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,14 @@ jobs:
# vcpkgGitCommitId: $(vcpkgGitRef)
# vcpkgGitURL: https://github.com/microsoft/vcpkg/
# if: runner.os == 'Windows'
- name: Install RTI;
run: |
cd org.lflang/src/lib/core/federated/RTI
mkdir build
cd build
cmake ../
make
sudo make install
- name: Run C tests;
run: |
./gradlew test --tests org.lflang.tests.runtime.CTest.*
Expand Down
63 changes: 63 additions & 0 deletions org.lflang/src/lib/core/federated/RTI/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# This is a cmake build script providing a solution for compiling
# the RTI in this directory..
#
# Usage:
#
# To compile with cmake, run the following commands:
#
# $> mkdir build && cd build
# $> cmake ../
# $> make
# $> sudo make install
#
# This create a binary RTI in the current working directory. Please put this in
# a directory that is on the path.
#
# To enable DEBUG messages, use the following build commands instead:
#
# $> mkdir build && cd build
# $> cmake -DCMAKE_BUILD_TYPE=DEBUG ../
# $> make
# $> sudo make install
#
# If you would like to go back to non-DEBUG mode, you would have to remove all
# contents of the `build` folder.

cmake_minimum_required(VERSION 3.12)
project(RTI VERSION 1.0.0 LANGUAGES C)

set(CoreLib ../../../core)

# Check which system we are running on to select the correct platform support
# file and assign the file's path to LF_PLATFORM_FILE
if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
set(LF_PLATFORM_FILE ${CoreLib}/platform/lf_linux_support.c)
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
set(LF_PLATFORM_FILE ${CoreLib}/platform/lf_macos_support.c)
else()
message(FATAL_ERROR "Your platform is not supported! RTI supports Linux and MacOS.")
endif()

include_directories(${CoreLib})
include_directories(${CoreLib}/platform)
include_directories(${CoreLib}/federated)

# Declare a new executable target and list all its sources
add_executable(RTI rti.c ${LF_PLATFORM_FILE})

IF(CMAKE_BUILD_TYPE MATCHES DEBUG)
# Set the LOG_LEVEL to 4 to get DEBUG messages
target_compile_definitions(RTI PUBLIC LOG_LEVEL=4)
ENDIF(CMAKE_BUILD_TYPE MATCHES DEBUG)

# Set the number of workers to enable threading
target_compile_definitions(RTI PUBLIC NUMBER_OF_WORKERS)

# Find pthreads and link to it
find_package(Threads REQUIRED)
target_link_libraries(RTI Threads::Threads)

install(
TARGETS RTI
DESTINATION bin
)
20 changes: 20 additions & 0 deletions org.lflang/src/lib/core/federated/RTI/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
This folder contains the source code for the Run-Time Infrastructure (RTI) that
is necessary for federated Lingua Franca programs. To compile and install, do:

```bash
mkdir build && cd build
cmake ../
make
sudo make install
```

**Note:** To enable DEBUG messages, use the following build commands instead:

```bash
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=DEBUG ../
make
sudo make install
```

If you would like to go back to the non-DEBUG mode, you would have to remove all contents of the `build` folder.
Loading