Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Installation

This guide covers installing RustKernels and its dependencies.

Prerequisites

Rust Toolchain

RustKernels requires Rust 1.85 or later:

# Install Rust via rustup
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# Update to latest stable
rustup update stable

# Verify version
rustc --version  # Should be 1.85.0 or higher

RustCompute Framework

RustKernels depends on the RustCompute (RingKernel) framework for GPU execution:

# Clone RustCompute alongside RustKernels
cd /path/to/your/projects
git clone https://github.com/mivertowski/RustCompute.git

# Directory structure should be:
# projects/
# ├── RustCompute/
# │   └── RustCompute/
# └── RustKernels/
#     └── RustKernels/

CUDA Toolkit (Optional)

For GPU acceleration, install the CUDA toolkit:

  • Linux: Install via your package manager or from NVIDIA’s website
  • Windows: Download installer from NVIDIA
  • macOS: Not supported for CUDA (CPU fallback only)
# Verify CUDA installation
nvcc --version
nvidia-smi

If CUDA is not available, RustKernels falls back to CPU execution automatically.

Adding RustKernels to Your Project

Basic Installation

Add to your Cargo.toml:

[dependencies]
rustkernel = "0.1.0"

This includes the default feature set: graph, ml, compliance, temporal, risk.

Selective Installation

Only include the domains you need to reduce compile time and binary size:

[dependencies]
rustkernel = { version = "0.1.0", default-features = false, features = ["graph", "accounting"] }

Full Installation

Include all 14 domains:

[dependencies]
rustkernel = { version = "0.1.0", features = ["full"] }

Available Features

FeatureDomainDescription
graphGraph AnalyticsCentrality, community detection, similarity
mlStatistical MLClustering, anomaly detection, regression
complianceComplianceAML, KYC, sanctions screening
temporalTemporal AnalysisForecasting, anomaly detection
riskRisk AnalyticsCredit scoring, VaR, stress testing
bankingBankingFraud pattern detection
behavioralBehavioralProfiling, forensics
orderbookOrder MatchingOrder book engine
procintProcess IntelligenceDFG, conformance checking
clearingClearingNetting, settlement
treasuryTreasuryCash flow, FX hedging
accountingAccountingNetwork generation, reconciliation
paymentsPaymentsPayment processing
auditAuditFeature extraction
fullAllEnables all domains

Building from Source

Clone and build the entire workspace:

# Clone the repository
git clone https://github.com/mivertowski/RustKernels.git
cd RustKernels

# Build all crates
cargo build --workspace

# Build in release mode
cargo build --workspace --release

# Run tests
cargo test --workspace

Verifying Installation

Create a simple test file:

// src/main.rs
use rustkernel::prelude::*;

fn main() {
    println!("RustKernels installed successfully!");

    // List available domains
    let domains = [
        "Graph Analytics",
        "Statistical ML",
        "Compliance",
        "Temporal Analysis",
        "Risk Analytics",
    ];

    for domain in domains {
        println!("  - {}", domain);
    }
}

Run with:

cargo run

Troubleshooting

RustCompute Not Found

If you see path errors related to RustCompute:

  1. Ensure RustCompute is cloned at the expected location
  2. Check that the directory structure matches what’s expected in Cargo.toml
  3. Verify the RustCompute workspace builds independently

CUDA Not Detected

If GPU execution isn’t working:

  1. Verify CUDA installation with nvcc --version
  2. Check GPU availability with nvidia-smi
  3. Ensure CUDA libraries are in your PATH
  4. RustKernels will fall back to CPU if CUDA isn’t available

Compilation Errors

For Rust version issues:

# Ensure you're on the correct toolchain
rustup override set stable
rustup update

Next Steps