简体   繁体   中英

How to use snopt libraries?

My situation: I want to use the SNOPT-Solver in Python through pyomo's SolverFactory. I applied for getting the C/C++ libraries for the optimization solver SNOPT and got

libsnopt7.dylib libsnopt7_cpp.dylib.

After managing to put together a dummy executable which SolverFactory can call, it gives me following error message:

 IOError: [Errno 2] No such file or directory:
'/var/folders/_d/vnct15hn3.9j8dhgqr6gjf3rw0000gn/T/tmpoSB0fh.pyomo.sol' 

Nevertheless, there is a file with that name, only with a .nl suffix.

Does anyone know why this problem appears and how to solve it?

Thanks a lot.

Pyomo does not have a specialized or library-mode binding to SNOPT. To use SNOPT from Pyomo, you will need a compiled executable called " snopt " that has been built against the ASL (AMPL Solver Library interface). The ASL provides the interface that can read the .nl input file that Pyomo generates and will produce the .sol solution file that Pyomo expects.

You can get the source for the AMPL Solver Library interface, along with the wrapper for SNOPT through Netlib: http://www.netlib.org/ampl/solvers/ .

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