Installing HDDS on Linux
This guide covers installing HDDS from source on Linux.
Prerequisites
- Rust 1.75+ (install via rustup) -- required even for C++ projects (HDDS core is written in Rust)
- Git
- GCC/Clang (for C/C++ bindings, optional)
- CMake 3.16+ and g++ or clang++ (required for C++ SDK)
# Install Rust (if not already installed)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source ~/.cargo/env
# Verify Rust version
rustc --version # Should be 1.75.0 or higher
Clone and Build
# Clone the repository
git clone https://git.hdds.io/hdds/hdds.git
cd hdds
# Build in release mode
cargo build --release
# Run tests to verify
cargo test
Using HDDS in Your Project
Pre-release
HDDS will be published on crates.io with the 1.0 stable release. For now, use a path dependency.
Add HDDS as a path dependency in your project's Cargo.toml:
[dependencies]
hdds = { path = "/path/to/hdds/crates/hdds" }
With optional features:
[dependencies]
hdds = { path = "/path/to/hdds/crates/hdds", features = ["xtypes", "security"] }
Available Features
| Feature | Description |
|---|---|
xtypes | XTypes type system (default) |
security | DDS Security 1.1 support |
tcp-tls | TLS encryption for TCP transport |
cloud-discovery | AWS/Azure/Consul discovery |
k8s | Kubernetes discovery |
rpc | DDS-RPC Request/Reply |
telemetry | Metrics collection |
Code Generator (hddsgen)
# Clone hddsgen
git clone https://git.hdds.io/hdds/hdds_gen.git
cd hdds_gen
# Build and install
cargo install --path .
# Verify
hddsgen --version
Verify Installation
# Run the test suite
cargo test --release
Two terminals required
The Hello World sample uses UdpMulticast transport. To see pub/sub in action, open two terminals:
- Terminal 1:
cargo run --bin hello_world(starts subscriber, waits for data) - Terminal 2:
cargo run --bin hello_world -- pub(sends 10 messages)
For the full walkthrough, see Hello World tutorial.
Firewall Configuration
DDS uses UDP multicast. Configure your firewall:
# UFW (Ubuntu)
sudo ufw allow 7400:7500/udp
# firewalld (Fedora/RHEL)
sudo firewall-cmd --permanent --add-port=7400-7500/udp
sudo firewall-cmd --reload
# iptables
sudo iptables -A INPUT -p udp --dport 7400:7500 -j ACCEPT
Multicast Configuration
Ensure multicast routing is enabled:
# Check multicast support
ip maddr show
# Add multicast route if needed
sudo ip route add 239.255.0.0/16 dev eth0
Troubleshooting
"Multicast not working"
# Check if multicast is enabled on your interface
ip link show eth0 | grep MULTICAST
# Enable if needed
sudo ip link set eth0 multicast on
"Permission denied on /dev/shm"
# For shared memory transport
sudo chmod 1777 /dev/shm
Next Steps
- Hello World C++ - C++ pub/sub tutorial
- Hello World Rust - Rust pub/sub tutorial
- hddsgen Overview - Code generator usage