using Ipopt with JuMP

384 views
Skip to first unread message

Tyler Ransom

unread,
Jul 9, 2015, 2:33:16 PM7/9/15
to juli...@googlegroups.com
Hi,

I am trying to use Ipopt with JuMP on a 64-bit Windows machine, running Julia version 0.3.10 and Ipopt version 0.1.16. When I try to invoke Ipopt in JuMP, I get the following error: "IpoptSolver not defined."

The JuMP documentation indicates that Ipopt is installed on Windows by default, and I already installed the Ipopt Julia package, so I am wondering what I am messing up here. Any help would be appreciated!

I invoke Ipopt in JuMP as follows:
m = Model(solver=IpoptSolver(tol=1e-6))

My problem works fine with NLopt [m = Model(solver=NLoptSolver(algorithm=:LN_NELDERMEAD))]. Also, any suggestions on which linear algebra libraries I should install would also be appreciated.

Thanks!
Tyler

Iain Dunning

unread,
Jul 9, 2015, 2:37:27 PM7/9/15
to julia-opt
Hi Tyler,

This might be a silly question, but you do have
using Ipopt
at the top of your file, right?

Thanks,
Iain

--
You received this message because you are subscribed to the Google Groups "julia-opt" group.
To unsubscribe from this group and stop receiving emails from it, send an email to julia-opt+...@googlegroups.com.
Visit this group at http://groups.google.com/group/julia-opt.
For more options, visit https://groups.google.com/d/optout.



--

Joey Huchette

unread,
Jul 9, 2015, 2:37:32 PM7/9/15
to juli...@googlegroups.com

Are you loading Ipopt with using Ipopt? If so, could you try Pkg.build("Ipopt") to see if Ipopt is built correctly on your machine.

-Joey


On Thu, Jul 9, 2015 at 2:33 PM, Tyler Ransom <tyler...@gmail.com> wrote:

--

Tyler Ransom

unread,
Jul 9, 2015, 2:49:43 PM7/9/15
to juli...@googlegroups.com, huch...@mit.edu
Thanks, Joey & Iain. I had forgotten to add `using Ipopt` [so embarrassing...]. However, even when I added it, I still got the same error (this time with the following warning just before the error: `Warning: using Ipopt.IpoptSolver in module Main conflicts with an existing identifier.`)

When I invoked `Pkg.build("Ipopt")` as Joey suggested, I didn't see any errors in the build, but when I ran my script again I got the same error (but no warning this time). I then restarted Julia and was able to run things correctly. So maybe it was something with the build? In any case, thanks so much! You guys are the best!

Tyler

Iain Dunning

unread,
Jul 9, 2015, 2:56:27 PM7/9/15
to julia-opt, Joey Huchette
I think it just got confused because you'd tried to use it, then did using Ipopt. That was a bug in Julia that I thought had been fixed - what version are you using? Sounds like the build was fine.

Let us know if anything else goes wrong!

Thanks,
Iain

Tyler Ransom

unread,
Jul 9, 2015, 2:58:28 PM7/9/15
to juli...@googlegroups.com, huch...@mit.edu
Hi Iain, I'm using Julia 0.3.10; Ipopt 0.1.16.

Tyler

Joey Huchette

unread,
Jul 9, 2015, 7:12:11 PM7/9/15
to juli...@googlegroups.com, huch...@mit.edu

It looks like you have some code that is importing Ipopt.IpoptSolver into the namespace (at least) twice. Could you post a short code snippet that reproduces the error?

Iain Dunning

unread,
Jul 9, 2015, 7:28:17 PM7/9/15
to julia-opt, Joey Huchette
I think he was saying that happened, but after restart that is no longer happening. I can't find it now, but I think there is a problem in 0.3 where refering to something that didn't exist, then loading the module where it does exist, threw that warning.

Iain Dunning

unread,
Jul 9, 2015, 7:28:46 PM7/9/15
to julia-opt, Joey Huchette
Reply all
Reply to author
Forward
0 new messages