nlopt
nlopt copied to clipboard
NLopt on Windows - Octave plugin instructions
The process for installing NLOpt as an Octave plugin on Windows requires a bit more improvising than should be necessary. Perhaps the "NLOpt on Windows" instructions and process could be updated. Some hurdles I found:
- Instructions point to the latest version of nlopt_optimize-oct.cc in the repo, which is newer than the v2.6.1 DLL and therefore the two are not compatible (nlopt_set_x_weights() has been added since v2.6.1).
- The header file "nlopt_optimize_usage.h" is included by nlopt_optimize-oct.cc, but didn't exist on my system. I found it in a couple of places online, but not in the official repo.
- It can be tricky to get all files in the right place for mkoctfile. I got it to work by copying the library files, headers and cc file all to one directory, cd'd to that directory in octave, then called mkoctfile with "-L." arg so that it looks for the library in the current dir.
- There's no longer an "octave.exe" file to move the NLOpt .oct file and DLL next to. I used "C:\Octave\Octave-5.1.0.0\mingw64\lib\octave\5.1.0\site\oct\x86_64-w64-mingw32", but you can alternatively put them elsewhere and add that directory to the octave path. I'm not sure about best practise for this.
- The tutorial script doesn't run because it doesn't know that "NLOPT_LD_MMA" means 24. This can be solved by copying all the .m files from the octave folder in the repo, into the same folder as the dll and oct files.