简体   繁体   中英

how to use the ipopt optimizer with pyomo on linux

I've followed the ipopt coinor website instructions and managed to install the ipopt optimizer. That produced some static object files in the build dir, but it did NOT produce any bin folder.

Now, when trying to get pyomo to use ipopt, the only way to to that i've seen used is to specify the executable location, like so opt = SolverFactory('ipopt', executable='executable path here') but i can't figure out what that might be.

I also noticed that coin-or has some precompiled binaries on their website. Those contain an ipopt executable inside the bin folder, but linking that will get the system to complain about a missing static object named libsvml.so .

The ipopt install guide makes no mention of libsvm, so this is what gets me really confused.

Did i miss something in the make/install step perhaps? Any help would be greatly appreciated

This question is very similar to a previous question. Please look at the answer here .

In my experience, if you followed the instructions to install ipopt from source code and you didn't end up with a bin directory with an ipopt executable then you either missed a step or the configuration/install failed from a missing dependency or third party code. You should redo the installation from scratch.

If you prefer to use the binary then make sure you are downloading the correct one for your system Linux-32bit or Linux-64bit and make sure the bin folder containing the executable is in your search path. Another thing to check with the binary is that the executable file has executable permissions. You can use the Linux command chmod +x to modify the permissions. You should be able to type ipopt on the command line and get the output noted in the other answer.

ipopt is indeed a library, which can be confusing as it is sometimes distributed inside an executable binary also called ipopt.

The package in the debian repos only contains the library, no executable file.

This library can be linked to from application code. To use as "standalone" solver, it needs an interface. Typically, the ASL (AMPL Solver Library) interface. The ASL interface allows ipopt to read input data from .nl files and write output data in .sol files.

The ipopt doc in the "compiling from sources" section mentions this and instructs how to install the ASL code from AMPL. There is an alternative ASL lib on GitHub: AMPL/MP . It's unclear to me whether this is the same code or not. At least the license here is clearer IMHO.

Some distribute ipopt as a binary with ASL feature, either linked statically or dynamically.

COIN-OR, for instance, ditribute ipopt sources but stopped distributing binaries. The latest linux binary is for ipopt 3.7.1 ( https://www.coin-or.org/download/binary/Ipopt/ ).

AMPL distribute a binary on their website with ASL statically linked. There is no mention of license or version, and no version history, so I wouldn't use that.

There is an ipopt conda package in the conda-forge channel with an ipopt bin as well. It depends on another conda package that uses the AMPL/MP ASL implementation mentioned above. This is my best choice for now.

Edit: The download section of the ipopt doc now advertises a new source for binaries: JuliaOpt GH repo .

Edit: COIN-OR now provide a build and installation script ( coinbrew ) that makes it much easier to compile Ipopt and dependencies to produce an executable binary file with AMPL support.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM