NLopt is a free/open-source library for nonlinear optimization, providing a common interface for a number of different free optimization routines available online as well as original implementations of various other algorithms. Its features include:
- Callable from C, C++, Fortran, Matlab or GNU Octave, Python, GNU Guile, Julia, GNU R, Lua, OCaml and Rust.
- A common interface for many different algorithms—try a different algorithm just by changing one parameter.
- Support for large-scale optimization (some algorithms scalable to millions of parameters and thousands of constraints).
- Both global and local optimization algorithms.
- Algorithms using function values only (derivative-free) and also algorithms exploiting user-supplied gradients.
- Algorithms for unconstrained optimization, bound-constrained optimization, and general nonlinear inequality/equality constraints.
- Free/open-source software under the GNU LGPL (and looser licenses for some portions of NLopt).
See the NLopt Introduction for a further overview of the types of problems it addresses.
Download and installation
Version 2.7.1 of NLopt is the latest version available from GitHub:
See the NLopt release notes for the release history. NLopt is designed to be installed on any Unix-like system (GNU/Linux is fine) with a C compiler, using the standard
cmake . && make && sudo make install
procedure. See the NLopt Installation instructions for more information.
For Microsoft Windows, see NLopt on Windows for more information and precompiled libraries.
For developers, the latest development sources can be found at https://github.com/stevengj/nlopt.
Documentation and Mailing Lists
See the NLopt manual for information on how to use NLopt and what optimization algorithms it includes.
Please cite NLopt and the authors of the algorithm(s) you use in any publication that stems from your use of NLopt.
The NLopt mailing lists (and their archives) are another source of information about NLopt.
Subscribe to the (read-only) nlopt-announce mailing list to receive an email when NLopt is updated in the future. Subscribe to the (unmoderated) nlopt-discuss mailing list for discussion of questions and ideas about using NLopt.
We are grateful to the many authors who have published useful optimization algorithms implemented in NLopt, especially those who have provided free/open-source implementations of their algorithms.
Please cite these authors if you use their code or the implementation of their algorithm in NLopt. See the documentation for the appropriate citation for each of the algorithms in NLopt — please see the Citing NLopt information.
Contact and Feedback
For bug reports and feature requests, please file a github issue.