Installing as a Library
For Rust Projects
Add Matchy to your Cargo.toml
:
[dependencies]
matchy = "1.0"
Then run cargo build
:
$ cargo build
Updating crates.io index
Downloading matchy v1.0
Compiling matchy v1.0
Compiling your-project v0.1.0
That's it! You can now use Matchy in your Rust code.
For C/C++ Projects
Option 1: Using cargo-c (Recommended)
Install the system-wide C library:
$ cargo install cargo-c
$ git clone https://github.com/sethhall/matchy
$ cd matchy
$ cargo cinstall --release --prefix=/usr/local
This installs:
- Headers to
/usr/local/include/matchy/
- Library to
/usr/local/lib/
- pkg-config file to
/usr/local/lib/pkgconfig/
Compile your project:
$ gcc myapp.c $(pkg-config --cflags --libs matchy) -o myapp
Option 2: Manual Installation
- Build the library:
$ git clone https://github.com/sethhall/matchy
$ cd matchy
$ cargo build --release
- Copy files:
$ sudo cp target/release/libmatchy.* /usr/local/lib/
$ sudo cp include/matchy.h /usr/local/include/
- Update library cache (Linux):
$ sudo ldconfig
- Compile your project:
$ gcc myapp.c -I/usr/local/include -L/usr/local/lib -lmatchy -o myapp
For Other Languages
Matchy provides a C API that can be called from any language with C FFI support:
- Python: Use
ctypes
orcffi
- Go: Use
cgo
- Node.js: Use
node-ffi
ornapi
- Ruby: Use
fiddle
orffi
See the C API Reference for the full API specification.
Next Steps
Choose your language: