15 unstable releases

0.8.1 Mar 26, 2025
0.7.0 Dec 10, 2023
0.6.0 Jun 16, 2022
0.5.4 Apr 21, 2021
0.3.2 Jul 25, 2018

#199 in Algorithms

Download history 504/week @ 2025-06-14 686/week @ 2025-06-21 756/week @ 2025-06-28 797/week @ 2025-07-05 682/week @ 2025-07-12 771/week @ 2025-07-19 746/week @ 2025-07-26 739/week @ 2025-08-02 674/week @ 2025-08-09 650/week @ 2025-08-16 683/week @ 2025-08-23 824/week @ 2025-08-30 776/week @ 2025-09-06 878/week @ 2025-09-13 569/week @ 2025-09-20 489/week @ 2025-09-27

2,852 downloads per month
Used in 7 crates (6 directly)

MIT license

2MB
36K SLoC

C 22K SLoC // 0.2% comments FORTRAN Legacy 7K SLoC // 0.4% comments C++ 3K SLoC // 0.1% comments SWIG 2.5K SLoC // 0.2% comments Rust 1.5K SLoC // 0.0% comments Objective-C 627 SLoC Python 80 SLoC // 0.1% comments FORTRAN Modern 53 SLoC Scheme 37 SLoC Shell 22 SLoC

crates.io Build Status Documentation

nlopt

Thin wrapper around the C nlopt library.

Building

You will need cmake to build successfully. It should be easy to find on your favourite package manager.

Examples

For a basic usage examples, see the /examples directory. Run with

cargo run --example bobyqa
cargo run --example mma

See also the tests in src/lib.rs. Run them with

cargo test

Attribution

This library was originally forked from https://github.com/mithodin/rust-nlopt.

License

The Rust code is licensed under MIT.

For convenience, this crate bundles nlopt and links it statically. This may have licensing implications so I refer the user to the bundled license for more information.

No runtime deps