I am dealing with optimization of functions for which I do not have derivatives available, and the optimization is not constrained. I am searching for a high quality GNU Public License-compatible optimization library compatible with the C++ language. So far I have managed to find OPT++.

Can someone recommend this or some other library?

  • 2
    $\begingroup$ Why are you restricting yourself to C++ and GPL? Does the library merely need to be compatible with C++ and GPL licensing? I can't think of a good reason for restricting yourself in this search. $\endgroup$ Jul 31, 2012 at 11:31
  • $\begingroup$ @Aron Ahmadia: I need to couple it with OpenFOAM, which is GPL based and written in C++. An alternative would be a library written in another language that has a C++ wrapper layer. $\endgroup$
    – tmaric
    Jul 31, 2012 at 12:30
  • $\begingroup$ Okay, please update your question since you are looking for a library that is GPL-compatible and easy to interface with C++ (this is almost always done through C bindings, which C++, unsurprisingly, provides). $\endgroup$ Jul 31, 2012 at 13:31

2 Answers 2


OPT++ is used internally by Dakota (Sandia), which is much more than an optimization library and is released under the LGPL. You should also take a look at TAO (ANL), released under a BSD-like license. An introduction to both OPT++ and TAO can be found here. Other alternatives are MOOCHO, NOMAD, and HOPSPACK, which are, as far as I know, also LGPL licensed.

Both Sandia and ANL offer automatic differentiation packages, like Sacado and ADIFOR/ADIC, that should play well with their general purpose numerical libraries Trilinos/PETSc.


The library NLopt meets your requirements. I have used it in the past and I am satisfied with its interface and results.

  • $\begingroup$ Is there similar library with the ability to run in parallel? $\endgroup$
    – Alexander
    Aug 5, 2012 at 18:01
  • $\begingroup$ I don't know of any such library. With NLopt it is possible to parallelize the evaluation of constraints (see ab-initio.mit.edu/wiki/index.php/… ) but I don't know if there are any plans for implementing parallelism at the objective function evaluation level. $\endgroup$ Aug 5, 2012 at 18:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.