Crates.io | cmajor |
lib.rs | cmajor |
version | 0.5.0 |
source | src |
created_at | 2023-09-21 23:03:51.583449 |
updated_at | 2024-07-05 20:40:29.355627 |
description | Rust bindings for the Cmajor JIT engine. |
homepage | |
repository | |
max_upload_size | |
id | 980177 |
size | 219,368 |
Rust bindings for the Cmajor JIT engine.
Work-in-progress bindings for the Cmajor JIT engine, to enable embedding Cmajor programs in Rust apps.
Add this to your Cargo.toml
:
[dependencies]
cmajor = "0.5"
You will also need to download the Cmajor library and tell the crate where to find it, either by:
Passing the path on construction:
use {cmajor::Cmajor, std::error::Error};
fn main() -> Result<(), Box<dyn Error>> {
let cmajor = Cmajor::new("path/to/libCmajPerformer.so")?;
}
Setting the CMAJOR_LIB_PATH
environment variable (.env
files are supported):
CMAJOR_LIB_PATH=path/to/libCmajPerformer.so
use cmajor::{Cmajor, std::error::Error};
fn main() -> Result<(), Box<dyn Error>> {
let cmajor = Cmajor::new_from_env()?;
}
static
(Experimental)It is possible to statically link to Cmajor to avoid having to load the library dynamically at runtime. This will build the library from source, so you'll need to have the necessary build tools installed. This feature is disabled by default, and only has experimental support on macOS.
Licensed under GPLv3 (or later). Refer to the Cmajor licensing terms for more information.