diff --git a/.gitignore b/.gitignore index 5689456cd4..59e8458695 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,5 @@ build/ .zed .cache compile_commands.json + +install/ diff --git a/README.md b/README.md index 2345238261..390070d405 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,77 @@ +# Cyclone DDS Fork + +These are my experiments with what exists in this repo, I added a `flake.nix` file which provides a `devShell` for building +and running the `HelloworldPublisher/Subsriber` examples and got those working. + +Build this thing manually... + +For the DCMAKE_INSTALL_PREFIX, just create an install directory somewhere in the project, or under /tmp + +``` +mkdir -p build install && cd build +cmake -DCMAKE_INSTALL_PREFIX=../install -DBUILD_EXAMPLES=ON .. +cmake --build . --parallel +``` + +After a successful build, you can specify the "install" location: + +``` +cmake --build . --target install +``` + +That'll kick out all the build artifacts: + +``` +17:24:40 (install) $ ll +total 16K +drwxr-xr-x 2 trey users 4.0K Dec 16 17:24 bin +drwxr-xr-x 7 trey users 4.0K Dec 16 17:24 include +drwxr-xr-x 3 trey users 4.0K Dec 16 17:24 share +drwxr-xr-x 4 trey users 4.0K Dec 16 17:24 lib64 +``` + +Note that the build/bin/ dir will have a bunch of extra executables, including the HelloWorld example: + +``` +17:28:07 (bin) $ pwd +/home/trey/sources/cyclonedds/build/bin + +17:28:14 (bin) $ ll +total 1.6M +-rwxr-xr-x 1 trey users 38K Dec 16 17:22 dyntype +-rwxr-xr-x 1 trey users 29K Dec 16 17:22 listtopics +-rwxr-xr-x 1 trey users 290K Dec 16 17:22 symbol_export_test +-rwxr-xr-x 1 trey users 194K Dec 16 17:22 dynsub +-rwxr-xr-x 1 trey users 538K Dec 16 17:22 idlc +-rwxr-xr-x 1 trey users 27K Dec 16 17:22 HelloworldPublisher +-rwxr-xr-x 1 trey users 43K Dec 16 17:22 variouspub +-rwxr-xr-x 1 trey users 37K Dec 16 17:22 RoundtripPong +-rwxr-xr-x 1 trey users 38K Dec 16 17:22 ThroughputPublisher +-rwxr-xr-x 1 trey users 28K Dec 16 17:22 HelloworldSubscriber +-rwxr-xr-x 1 trey users 46K Dec 16 17:22 ThroughputSubscriber +-rwxr-xr-x 1 trey users 57K Dec 16 17:22 RoundtripPing +-rwxr-xr-x 1 trey users 246K Dec 16 17:22 ddsperf +``` + +On first go at the HelloworldPublisher and HelloworldSubscriber nothing worked, +both executables just hung waiting with no extra logs. + +Providing this XML string as a configuration through the CYCLONEDDS_URI environment variable solved the problem, +so the default behavior of auto-detecting the local network must just not be working. We got some log output +claiming that NetworkInterfaceAddress is a deprecated element, but it seemed to accept this config, note this is done automatically in the `devShell` shipped in the flake. + +``` +export CYCLONEDDS_URI="127.0.0.1" +``` + +To provide a + +``` +export CYCLONEDDS_URI="file://$HOME/CycloneDDS/my-config.xml" +``` + +--- + ![GitHub release](https://img.shields.io/github/v/release/eclipse-cyclonedds/cyclonedds?include_prereleases) [![Build Status](https://dev.azure.com/eclipse-cyclonedds/cyclonedds/_apis/build/status/Pull%20requests?branchName=master)](https://dev.azure.com/eclipse-cyclonedds/cyclonedds/_build/latest?definitionId=4&branchName=master) [![Coverity Status](https://scan.coverity.com/projects/19078/badge.svg)](https://scan.coverity.com/projects/eclipse-cyclonedds-cyclonedds) diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000000..dbb6bec953 --- /dev/null +++ b/flake.lock @@ -0,0 +1,27 @@ +{ + "nodes": { + "nixpkgs": { + "locked": { + "lastModified": 1765687488, + "narHash": "sha256-7YAJ6xgBAQ/Nr+7MI13Tui1ULflgAdKh63m1tfYV7+M=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "d02bcc33948ca19b0aaa0213fe987ceec1f4ebe1", + "type": "github" + }, + "original": { + "owner": "NixOS", + "ref": "nixos-25.05", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "nixpkgs": "nixpkgs" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000000..d73342e310 --- /dev/null +++ b/flake.nix @@ -0,0 +1,38 @@ +{ + description = "Cyclone DDS"; + + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixos-25.05"; + }; + + outputs = { self, nixpkgs }: + let + systems = [ "x86_64-linux" ]; + forAllSystems = nixpkgs.lib.genAttrs systems; + in + { + devShells = forAllSystems (system: + let + pkgs = import nixpkgs { inherit system; }; + in + { + default = pkgs.mkShell { + buildInputs = with pkgs; [ + gcc + cmake + git + openssl + ]; + + shellHook = '' + echo "exporting a CYCLONEDDS_URI config with loopback NetworkInterfaceAddress" + export CYCLONEDDS_URI="127.0.0.1" + ''; + }; + }); + + # TODO: add a nix formatter... + }; +} + + diff --git a/hello-world-config.xml b/hello-world-config.xml new file mode 100644 index 0000000000..1b53f45200 --- /dev/null +++ b/hello-world-config.xml @@ -0,0 +1,25 @@ + + + + + + + + + + default + 65500B + + + config + + ${HOME}/dds/log/cdds.log.${CYCLONEDDS_PID} + + + +