docs.rs failed to build glpk-rust-0.2.1
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
glpk-rust
A Rust wrapper for the GNU Linear Programming Kit (GLPK) for solving Integer Linear Programming (ILP) problems.
Features
- Self-contained: No need to install GLPK separately! The build system automatically downloads, compiles, and statically links GLPK 5.0.
- Cross-platform: Works on macOS, Linux, and Windows
- Zero runtime dependencies: Everything is statically linked
- Safe Rust API: High-level, memory-safe interface to GLPK
License
This library is licensed under the GNU General Public License v3.0 (GPL-3.0).
Important: Since this library statically links with GLPK (which is GPL-3.0 licensed), any software that uses this library must also be licensed under GPL-3.0 or a compatible license. This means:
- ✅ Your project can use this library if it's open source under GPL-3.0
- ✅ You can use it in other GPL-compatible open source projects
- ❌ You cannot use this library in proprietary/closed-source software
- ❌ You cannot use this library in projects with incompatible licenses (MIT, Apache, etc.)
If you need to use GLPK in a non-GPL project, you'll need to either:
- Purchase a commercial license from the GLPK authors, or
- Use a different solver with a more permissive license
Prerequisites
Only standard build tools are required:
- macOS: Xcode command line tools (
xcode-select --install) - Linux:
build-essentialpackage (Ubuntu/Debian) orgcc make(RHEL/CentOS) - Windows: Visual Studio Build Tools or MinGW
The build system will automatically:
- Download GLPK 5.0 source code
- Configure and compile it with the correct flags
- Statically link it into your Rust binary
Usage
Add this to your Cargo.toml:
[]
= "0.1.0"
Example
use *;
use HashMap;
// Create variables
let variables = vec!;
// Define constraints
let mut polytope = SparseLEIntegerPolyhedron ;
// Define objective
let mut objective = new;
objective.insert;
objective.insert;
// Solve
let solutions = solve_ilps;
println!;