Installation¶
Prerequisites¶
- Rust 1.70+ - Install Rust
- Cargo - Comes with Rust installation
- A modern C compiler (for some dependencies)
Setup Steps¶
1. Clone the Repository¶
Bash
git clone https://github.com/coohom/optillm-rs.git
cd optillm-rs
2. Verify Installation¶
Bash
cargo --version # Verify Rust is installed
rustc --version # Check Rust version (1.70+)
Using as a Dependency¶
Add to your Cargo.toml:
TOML
[dependencies]
optillm-core = { path = "path/to/optillm-rs/crates/core" }
optillm-mars = { path = "path/to/optillm-rs/crates/mars" }
Or if published to crates.io:
TOML
[dependencies]
optillm-core = "0.1"
optillm-mars = "0.1"
Building¶
Build All Crates¶
Bash
cargo build --release
Build Specific Crate¶
Bash
cargo build -p optillm-mars --release
cargo build -p optillm-core --release
Development Build (Faster)¶
Bash
cargo build # Debug build, faster compilation
cargo build --dev # Explicit development profile
Verification¶
Check that everything builds correctly:
Bash
cargo check --all
Run tests to verify functionality:
Bash
cargo test --all
Troubleshooting¶
Rust Version Issues¶
If you see errors about Rust version, update Rust:
Bash
rustup update
rustc --version # Should be 1.70+
Dependency Resolution¶
If you encounter dependency conflicts:
Bash
cargo update
cargo clean
cargo build
Platform-Specific Issues¶
macOS with Apple Silicon¶
Some dependencies may need compilation from source. Install Xcode Command Line Tools:
Bash
xcode-select --install
Linux¶
Ensure you have the necessary build tools:
Bash
# Ubuntu/Debian
sudo apt-get install build-essential
# Fedora
sudo dnf install gcc gcc-c++ make
Windows¶
Visual Studio Build Tools or MinGW are required. The Rust installer usually handles this.
Next Steps¶
- Quick Start Guide - Get your first optimizer running
- Examples - See practical code examples
- Architecture Overview - Understand the design
Docker Setup (Optional)¶
For containerized development:
Bash
docker build -t optillm-rs .
docker run -it optillm-rs bash
IDE Setup¶
VS Code¶
- Install Rust Analyzer
- Install CodeLLDB for debugging
- Create
.vscode/settings.json:
JSON
{
"[rust]": {
"editor.defaultFormatter": "rust-lang.rust-analyzer",
"editor.formatOnSave": true
}
}
IntelliJ IDEA / CLion¶
- Install the official Rust plugin
- Configure Rust toolchain in IDE settings
- Enable code inspections
System Requirements¶
| Component | Requirement |
|---|---|
| Rust | 1.70+ |
| Cargo | Latest stable |
| RAM | 2GB minimum (4GB+ recommended) |
| Disk | 2GB for build artifacts |
| OS | Linux, macOS, Windows |
Getting Help¶
- GitHub Issues - Report bugs or ask questions
- Rust Community - General Rust help
- Check FAQ for common questions