Installation

This page provides detailed instructions for installing Strapdown-rs on your system.

Prerequisites

Before installing Strapdown-rs, ensure you have the following:

  • Rust: Version 1.70 or higher (install from rustup.rs)
  • System Libraries: Required for building certain dependencies

System Dependencies

Strapdown-rs requires several system libraries for HDF5 and NetCDF support:

Ubuntu/Debian

sudo apt update
sudo apt install -y pkg-config \
  libhdf5-dev \
  libhdf5-openmpi-dev \
  libnetcdf-dev \
  zlib1g-dev

Fedora/RHEL

sudo dnf install -y pkg-config \
  hdf5-devel \
  hdf5-openmpi-devel \
  netcdf-devel \
  zlib-devel

macOS

brew install pkg-config hdf5 netcdf

Windows

For Windows users, we recommend using vcpkg to install dependencies:

vcpkg install hdf5 netcdf zlib

Installation Methods

The easiest way to use Strapdown-rs is to add it as a dependency in your project:

cargo add strapdown-core

Or add manually to your Cargo.toml:

[dependencies]
strapdown-core = "0.1"

To install the simulation binary:

cargo install strapdown-sim

Method 2: Build from Source

Clone the repository and build locally:

# Clone the repository
git clone https://github.com/jbrodovsky/strapdown-rs.git
cd strapdown-rs

# Build the entire workspace
cargo build --workspace --all-features --release

# Install the simulation binary
cargo install --path sim

# Optionally, install the geonav binary
cargo install --path geonav

Method 3: Using Pixi (Experimental)

The project includes a pixi.toml for environment management:

# Install pixi
curl -fsSL https://pixi.sh/install.sh | bash

# Activate the environment
pixi install
pixi shell

# Build and run
cargo build --release

Verifying Installation

After installation, verify everything works:

# Check strapdown-sim version
strapdown-sim --version

# Run a simple test
cargo test -p strapdown-core

Troubleshooting

HDF5/NetCDF Linking Issues

If you encounter linking errors:

  1. Ensure pkg-config can find the libraries:

    pkg-config --modversion hdf5
    pkg-config --modversion netcdf
    
  2. Set environment variables if needed:

    export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH
    

Rust Version Issues

Ensure you're using a recent Rust version:

rustc --version
rustup update stable

Next Steps