Skip to main content

Installing HDDS on macOS

This guide covers installing HDDS from source on macOS (Intel and Apple Silicon).

Prerequisites

  • macOS 12+ (Monterey or later)
  • Xcode Command Line Tools: xcode-select --install
  • Rust 1.75+ (install via rustup)
  • Git
# Install Xcode Command Line Tools
xcode-select --install

# 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
Apple Silicon

HDDS is fully native on Apple Silicon (M1/M2/M3). No Rosetta needed.

Using HDDS in Your Project

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

FeatureDescription
xtypesXTypes type system (default)
securityDDS Security 1.1 support
tcp-tlsTLS encryption for TCP transport
cloud-discoveryAWS/Azure/Consul discovery
k8sKubernetes discovery
rpcDDS-RPC Request/Reply
telemetryMetrics collection

Code Generator (hdds_gen)

# Clone hdds_gen
git clone https://git.hdds.io/hdds/hdds_gen.git
cd hdds_gen

# Build and install
cargo build --release

# Add to PATH (optional)
export PATH="$PATH:$(pwd)/target/release"

# Verify
./target/release/hdds_gen --version

C/C++ Development

After building HDDS:

# Build the C bindings
cd /path/to/hdds
cargo build --release -p hdds-c

# The library will be at target/release/libhdds.dylib

CMake Integration

# Point to your HDDS build
set(HDDS_ROOT "/path/to/hdds")

add_executable(myapp main.cpp)
target_include_directories(myapp PRIVATE ${HDDS_ROOT}/crates/hdds-c/include)
target_link_directories(myapp PRIVATE ${HDDS_ROOT}/target/release)
target_link_libraries(myapp PRIVATE hdds)

Verify Installation

# Check version
hdds --version

# Run self-test
hdds self-test

# List interfaces
hdds interfaces

Expected output:

HDDS 1.0.0
Platform: macOS arm64
RTPS Version: 2.5
Security: Enabled

Self-test: PASSED (12/12 tests)

Network Interfaces:
- en0: 192.168.1.100 (multicast: enabled)
- lo0: 127.0.0.1 (multicast: disabled)

macOS-Specific Configuration

Firewall

macOS Firewall may block DDS traffic. Allow it:

  1. Open System PreferencesSecurity & PrivacyFirewall
  2. Click Firewall Options
  3. Add your application or allow incoming connections

Or via command line:

# Disable firewall for testing (not recommended for production)
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --setglobalstate off

Multicast

macOS supports multicast by default. Verify:

# Check multicast route
netstat -rn | grep 239

# If missing, add route
sudo route add -net 239.255.0.0/16 -interface en0

Sleep Prevention

For long-running DDS applications:

# Prevent sleep while app runs
caffeinate -i ./my_dds_app

Troubleshooting

"Library not loaded" Error

# Set library path
export DYLD_LIBRARY_PATH=/usr/local/lib:$DYLD_LIBRARY_PATH

Multicast Not Working

# Check interface multicast capability
ifconfig en0 | grep MULTICAST

# Check firewall
sudo /usr/libexec/ApplicationFirewall/socketfilterfw --listapps

Apple Silicon Compatibility

HDDS is native ARM64. If you see Rosetta warnings:

# Verify architecture
file $(which hdds)
# Should show: Mach-O 64-bit executable arm64

Next Steps