README.md 2.3 KB
Newer Older
S
Steven G. Johnson 已提交
1
[![Latest Docs](https://readthedocs.org/projects/nlopt/badge/?version=latest)](http://nlopt.readthedocs.io/en/latest/)
J
Julien Schueller 已提交
2
[![Build Status](https://travis-ci.org/stevengj/nlopt.svg?branch=master)](https://travis-ci.org/stevengj/nlopt)
A
Amro 已提交
3
[![Build Status](https://ci.appveyor.com/api/projects/status/github/stevengj/nlopt?branch=master&svg=true)](https://ci.appveyor.com/project/StevenGJohnson/nlopt)
J
Julien Schueller 已提交
4

5 6
NLopt is a library for nonlinear local and global optimization, for
functions with and without gradient information.  It is designed as
A
Amro 已提交
7
a simple, unified interface and packaging of several free/open-source
8 9
nonlinear optimization libraries.

S
Steven G. Johnson 已提交
10 11 12
The latest release can be downloaded from the [NLopt releases](https://github.com/stevengj/nlopt/releases) page on Github, and the 
[NLopt manual](
https://nlopt.readthedocs.io/en/latest/) is hosted on readthedocs.
13

S
Steven G. Johnson 已提交
14
NLopt is compiled and installed with the [CMake](https://cmake.org/) build system
A
Amro 已提交
15
(see `CMakeLists.txt` file for available options):
16 17 18

    git clone git://github.com/stevengj/nlopt
    cd nlopt
S
Steven G. Johnson 已提交
19 20 21
    mkdir build
    cd build
    cmake ..
22
    make
A
Amro 已提交
23
    sudo make install
24

S
Steven G. Johnson 已提交
25
(To build the latest development sources from git, you will need [SWIG](http://www.swig.org/)
A
Amro 已提交
26
to generate the Python and Guile bindings.)
27 28

Once it is installed, `#include <nlopt.h>` in your C/C++ programs and
A
Amro 已提交
29
link it with `-lnlopt -lm`.  You may need to use a C++ compiler to link
30
in order to include the C++ libraries (which are used internally by NLopt,
S
Steven G. Johnson 已提交
31
even though it exports a C API).  See the [C reference manual](https://nlopt.readthedocs.io/en/latest/NLopt_Reference/).
32

S
Steven G. Johnson 已提交
33 34
There are also interfaces for [C++](https://nlopt.readthedocs.io/en/latest/NLopt_C-plus-plus_Reference/), [Fortran](https://nlopt.readthedocs.io/en/latest/NLopt_Fortran_Reference/), [Python](https://nlopt.readthedocs.io/en/latest/NLopt_Python_Reference/), [Matlab or GNU Octave](https://nlopt.readthedocs.io/en/latest/NLopt_Matlab_Reference/), [OCaml](https://bitbucket.org/mkur/nlopt-ocaml),
[GNU Guile](https://nlopt.readthedocs.io/en/latest/NLopt_Guile_Reference/), [GNU R](https://www.ucl.ac.uk/~uctpjyy/nloptr.html), [Lua](https://github.com/rochus-keller/LuaNLopt), [Rust](https://github.com/jesskfullwood/rust-nlopt), and [Julia](https://github.com/JuliaOpt/NLopt.jl).  Interfaces for other languages may
35
be added in the future.