NLopt: one C interface in front of many free nonlinear optimizers, built with CMake and documented on readthedocs
library for nonlinear optimization, wrapping many algorithms for global and local, constrained or unconstrained, optimization
At a glance
- What is it?
- NLopt wraps several free and open-source optimization libraries behind a single interface for local and global problems, with or without gradients. The latest release is v2.11.0 from 2026-06-05, and GitHub lists its license as NOASSERTION.
- Who is it for?
- Use NLopt if you want to try several local and global optimization algorithms, with or without gradients, behind one interface and from your own language. Look elsewhere if you need the README to settle algorithm choice or defaults, because it names none.
- Can I use it commercially?
- Check first. The repository uses a licence we do not classify automatically, so read its LICENSE file before any commercial use.
- Is it still maintained?
- Yes. The repository last received commits 12 days ago.
- What is it written in?
- Mainly C, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 25, 2026, and from our analysis. They are not legal advice.
Star history
- stevengj/nlopt2,290 ★ · +10
| Repository | 2026-10-08 | 2026-11-25 |
|---|---|---|
| stevengj/nlopt | 2.3k | 2.3k |
10 Stars in the last 48 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
NLopt is one calling interface in front of several free optimization libraries
NLopt's own description of itself is a simple, unified interface and packaging of several free and open-source nonlinear optimization libraries. That sentence carries the design. You do not choose NLopt for a single algorithm of its own. You choose it so that code written against one interface can switch between algorithms that other projects wrote.
The repository description widens the scope: a library wrapping many algorithms for global and local, constrained or unconstrained, optimization. Local and global are both in scope, and so are problems with and without gradient information. A function whose derivatives you cannot compute and one whose gradient you can supply cheaply are both meant to fit.
The practical gain is comparison. When one algorithm stalls on your objective, you change which algorithm you ask for and keep the rest of your program. The cost is that NLopt's interface sits between you and each wrapped library, so behavior specific to one of those libraries has to be read from NLopt's manual, not from the original project's documentation.
The README holds no build command, so installation means following the readthedocs page
Anyone expecting a quick install snippet will not find one in the README. It sends you to three places. The latest release can be downloaded from the NLopt releases page on GitHub. The manual is hosted on readthedocs at nlopt.readthedocs.io. And to build the library, you follow the installation instructions in the download and installation section of that manual.
Because of that, this article quotes no install command. A command copied from a forum could be for an older version than the v2.11.0 release of 2026-06-05.
The repository does show what the build is made of. CMakeLists.txt and CMakePresets.json sit at the root with a cmake/ directory beside them. nlopt_config.h.in is a template for a generated configuration header, and nlopt.pc.in is a template for a pkg-config file. The src/ directory holds the C sources, since the primary language is C, and test/ holds the tests. A GitHub Actions workflow named build.yml is linked from the README badge.
Thirteen language interfaces, and only some of them are documented inside the NLopt manual
The README lists interfaces for C, C++, Fortran, Python, Matlab or GNU Octave, OCaml, GNU Guile, GNU R, Lua, Perl, Rust, Ruby, Julia and Java. That is fourteen names counting C, which the C reference manual covers directly.
Where each one is documented differs. The NLopt manual on readthedocs has reference pages for C, C++, Fortran, Python, Matlab or Octave, Guile and Java. The other seven link elsewhere: OCaml to a Bitbucket repository, GNU R to a page at University College London, Lua to a repository by rochus-keller named LuaNLopt, Perl to Math::NLopt on metacpan, Rust to a repository by jesskfullwood, Ruby to ankane's nlopt-ruby and Julia to JuliaOpt's NLopt.jl.
So the seven external bindings are separate projects with their own pages. Their version lag, their feature coverage and their maintenance are not described in the NLopt README. If you work in Julia or Rust, check that project's own repository before assuming it exposes everything the C library does. The README adds that interfaces for other languages may be added in the future, without naming any.
The license field reads NOASSERTION, so the COPYING and COPYRIGHT files are the place to check
GitHub lists the repository's license as NOASSERTION. That means the automatic detector did not match a single standard license, not that the project has no license. The root contains COPYING and COPYRIGHT, and the README says nothing about their terms.
A project that packages several libraries from different authors is the kind where one summary license may not capture everything. The README describes NLopt as a packaging of several free and open-source libraries, so a team shipping NLopt inside a product should read COPYING and COPYRIGHT in full, rather than rely on the repository sidebar.
AUTHORS and CITATION.bib are also at the root. CITATION.bib exists for people who want to cite NLopt in published work, and the repository does not reproduce it in the README. The file is the right source for the citation, not a copy from a website.
Releases arrive a few times a year, and the master branch moved after v2.11.0
The repository is not archived. The most recent releases are v2.11.0 on 2026-06-05, v2.10.1 on 2026-02-09 and v2.10.0 on 2025-02-04. The gap from v2.10.0 to v2.10.1 is about a year, and from v2.10.1 to v2.11.0 about four months.
The last push was 2026-10-17, more than four months after v2.11.0. Anything pushed since that date is in the master branch and in no release. If you need a fix that is not in v2.11.0, you can build from source with the CMake files, and the manual covers how.
The root also carries ChangeLog and NEWS.md for release history, plus a TODO file. Read NEWS.md before moving between versions, since the README lists no compatibility policy and no deprecation rules. The README does not say whether an interface or return code changed between 2.10 and 2.11.
What the README leaves out: no algorithm list, no tolerance defaults, no comparison with SciPy or Ipopt
The README is 109 words long and describes the project at a high level. It names no individual algorithm, it gives no default for stopping tolerances, and it makes no statement about thread safety, memory use or speed. It contains no example code in any language.
It also makes no comparison with other optimization tools. People often ask how NLopt relates to SciPy or Ipopt, and nothing in the repository text answers that. What it does establish is the wrapper design: one interface over several libraries, usable from a long list of languages, with a Python reference in the manual.
To choose among algorithms, read the manual pages for your language. The repository's doc/ directory and mkdocs.yml, together with .readthedocs.yaml, are the sources for that site, so the documentation is built from the same tree as the code. Anyone who needs an algorithm-by-algorithm decision cannot get it from the GitHub front page.
Editorial conclusion
Use NLopt if you want to try several local and global optimization algorithms, with or without gradients, behind one interface and from your own language. Look elsewhere if you need the README to settle algorithm choice or defaults, because it names none. Before shipping it, read COPYING and COPYRIGHT, since the license field says NOASSERTION, and confirm that your language binding is current, because seven of the bindings are separate projects.
Frequently asked questions
How do I install NLopt?
The README sends you to the installation instructions in the NLopt manual on readthedocs, or to the releases page on GitHub for a download. It gives no install command itself.
How does NLopt compare with SciPy?
The repository makes no comparison with SciPy. It describes NLopt as a unified interface and packaging of several free and open-source nonlinear optimization libraries, with a Python reference in its manual.
What is an alternative to NLopt?
The README names no alternatives. It positions NLopt as a single interface over several existing optimization libraries, for local and global problems with or without gradients.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/stevengj-nlopt)Star history chart for your README
[](https://hysenlabs.com/projects/stevengj-nlopt)Was this useful?