How to generate solution file?


I am using Cbc solver. I used the code mentioned below to generate .sol file at particular location:

It is generating .sol file but it is not solution. Its mathematical model. What is the reason?


Can you post the whole program?


Sorry I can’t. I checked CbcSolver blog. It’s mentioned that .sol file generation provision has been eliminated. There must be some alternative approach.


Next time you ask a question on this forum, please make sure you add a minimum context. Your question is coming out of nowhere and the code is incomplete.


I do agree with you. Hope my explanation is quite clear. I just want to know the syntax for generating .sol file after solving a model with Cbc or Ipopt solver. For instance, we can write writeLP(m::Model,file::AbstractString) to generate .lp file for the model. What would be the right approach to generate solution file?


Please check my code and it’s working.
filename=“Enter path of the file such as E:/filename"

I would also request all of you to try the same

Check two files. It is applicable for any linear mathematical model.


Your code is not a minimal working example: sol is not a field of m. Do you want the value of the objective function getvalue(m.obj) to be saved?


If you want an AMPL format .sol file, you need to use the AmplNLWriter package.


I do appreciate your attempt. We know it. Our object is to
generate entire solution file from a .lp file. It is a common feature of
CPLEX. Is there any such option in Cbc/Ipopt solver? I appreciate your



Your question has nothing to do with Julia then.

The Ipopt AMPL executable can take a .nl file as input and outputs a .sol file. The Cbc executable does similar, I think it can also read .lp or .mps files but again that isn’t a Julia question.


Hello Tony,
Discussion should not be limited.Related topic
should be discussed for development. If possible try to incorporate such
issues as we are using Julia for different solvers. Solver packages should
effectively implement Julia. Am I correct? Well, be careful about intruders
with malcontent to your blog. I wish best to your development group.

Thanks and regards,