NLopt on Windows

From AbInitio

(Difference between revisions)
Jump to: navigation, search
Revision as of 16:01, 9 June 2011 (edit)
Stevenj (Talk | contribs)
(NLopt on Windows)
← Previous diff
Current revision (18:45, 20 May 2014) (edit)
Stevenj (Talk | contribs)
(NLopt on Windows)
 
Line 3: Line 3:
==NLopt on Windows== ==NLopt on Windows==
-NLopt works fine on Microsoft Windows computers. To simplify installation, we provide a precompiled 32-bit Windows [[w:Dynamic-link library|DLL]], built with [[w:MinGW|MinGW]] (using [http://ab-initio.mit.edu/nlopt/BUILD-MINGW.sh this script]):+NLopt works fine on Microsoft Windows computers. To simplify installation, we provide a precompiled 32-bit and 64-bit Windows [[w:Dynamic-link library|DLL]]s, built with [[w:MinGW|MinGW]]:
-* [http://ab-initio.mit.edu/nlopt/nlopt-2.2.3-dll.zip nlopt-2.2.3-dll.zip]+* [http://ab-initio.mit.edu/nlopt/nlopt-2.4.2-dll32.zip nlopt-2.4.2-dll32.zip] (32-bit)
 +* [http://ab-initio.mit.edu/nlopt/nlopt-2.4.2-dll64.zip nlopt-2.4.2-dll64.zip] (64-bit)
-Be sure to read the <code>README-WINDOWS</code> file included in this [[w:ZIP (file format)|zip]] archive for how to build an [http://msdn.microsoft.com/en-us/library/0b9xe492.aspx import library] for the DLL before using, by running the <code>lib /def:libnlopt-0.def</code> command (which comes with Microsoft compilers). If you are using GNU compilers (MinGW), run <code>dlltool --def-input libnlopt-0.def --dllname libnlopt-0.dll --output-lib libnlopt-0.lib</code> (dlltool comes with MinGW).+Be sure to read the <code>README-WINDOWS</code> file included in this [[w:ZIP (file format)|zip]] archive for how to build an [http://msdn.microsoft.com/en-us/library/0b9xe492.aspx import library] for the DLL before using, by running the <code>lib /def:libnlopt-0.def</code> command (which comes with Microsoft compilers). If you are using GNU compilers (MinGW), run <code>dlltool --input-def libnlopt-0.def --dllname libnlopt-0.dll --output-lib libnlopt-0.lib</code> (dlltool comes with MinGW).
(For source code, download the [[NLopt#Download and installation|main <code>.tar.gz</code> package]].) (For source code, download the [[NLopt#Download and installation|main <code>.tar.gz</code> package]].)
Line 14: Line 15:
* [http://ab-initio.mit.edu/nlopt/CMakeLists.txt CMakeLists.txt] and [http://ab-initio.mit.edu/nlopt/config.cmake.h.in config.cmake.h.in] * [http://ab-initio.mit.edu/nlopt/CMakeLists.txt CMakeLists.txt] and [http://ab-initio.mit.edu/nlopt/config.cmake.h.in config.cmake.h.in]
 +
 +Unofficial Python binaries for Windows are available from Christoph Gohike:
 +
 +* [http://www.lfd.uci.edu/~gohlke/pythonlibs/#nlopt Python binaries for 64-bit Windows]
===Octave plugin=== ===Octave plugin===

Current revision

NLopt
Download
Release notes
FAQ
NLopt manual
Introduction
Installation
Tutorial
Reference
Algorithms
License and Copyright

NLopt on Windows

NLopt works fine on Microsoft Windows computers. To simplify installation, we provide a precompiled 32-bit and 64-bit Windows DLLs, built with MinGW:

Be sure to read the README-WINDOWS file included in this zip archive for how to build an import library for the DLL before using, by running the lib /def:libnlopt-0.def command (which comes with Microsoft compilers). If you are using GNU compilers (MinGW), run dlltool --input-def libnlopt-0.def --dllname libnlopt-0.dll --output-lib libnlopt-0.lib (dlltool comes with MinGW).

(For source code, download the main .tar.gz package.)

Alternatively, you can use the following files, provided by Benoit Scherrer (benoitscherrer ατ gmail.com), to compile NLopt from source on Windows (with the Microsoft compiler) using CMake:

Unofficial Python binaries for Windows are available from Christoph Gohike:

Octave plugin

To build the NLopt plugin for GNU Octave (a free Matlab clone, which uses the same NLopt interface as in Matlab), you will need the following additional steps. (See Octave for Windows on the Octave web page to download Octave.)

  1. First, download both the .zip file above and the main .tar.gz package of NLopt. Use dlltool (which comes with Octave in the octave\mingw23\bin directory) to create the .lib import library as explained above.
  2. Unpack the NLopt .tar.gz file, and copy the nlopt_optimize-oct.cc from the nlopt\octave directory, along with downloading nlopt_optimize_usage.h, and put them together with your .lib and .dll files (from the .zip).
  3. Compile the Octave plugin (.oct file) with mkoctfile -lnlopt-0 --output nlopt_optimize.oct nlopt_optimize-oct.cc (mkoctfile is a program included with Octave).
  4. Finally, move libnlopt-0.dll to the octave\bin directory so that Octave can find it.
Personal tools