In order to debug the issue that I mentioned in the thread https://discourse.julialang.org/t/error-in-jump-nlexpression/13147 I decided to write a simple program to solve a constrained nonlinear optimization problem in order to get myself more familar with JuMP. This is the code:
using JuMP
using Ipopt
function Townsend(args...)
x = args[1]
y = args[2]
return - cos((x-0.1)*y)^2 - x*(sin(3x+y))
end
function Constr(args...)
x = args[1]
y = args[2]
t = atan2(y, x)
return (2cos(t) - cos(2t) / 2 - cos(3t) / 4 - cos(4t) / 8)^2 + 2sin(t)^2
end
m = Model(solver=IpoptSolver(print_level=1))
JuMP.register(m, :Townsend, 2, Townsend, autodiff=true)
JuMP.register(m, :Constr, 2, Constr, autodiff=true)
@variable(m, -2.25 <= x <= 2.5)
@variable(m, -2.5 <= y <= 1.75)
@NLconstraint(m, c1, x^2 + y^2 <= Constr(x,y))
@NLobjective(m, Min, Townsend(x,y))
solve(m)
println("x = ", getvalue(x))
println("y = ", getvalue(y))
Given all the discussions about the transition of JuMP from 0.18 to 0.19 and Julia from .6 to 0.7/1.0 I decided to stay with Julia 0.6.4 and JuMP 0.18. Under Windows 10 I am getting this error:
******************************************************************************
This program contains Ipopt, a library for large-scale nonlinear optimization.
Ipopt is released as open source code under the Eclipse Public License (EPL).
For more information visit http://projects.coin-or.org/Ipopt
******************************************************************************
Please submit a bug report with steps to reproduce this fault, and any error messages that follow (in their entirety). Thanks.
Exception: EXCEPTION_ACCESS_VIOLATION at 0x684eb7bc -- dmumps_454_ at C:\Users\arbenede\.julia\v0.6\Ipopt\deps\usr\bin\libcoinmumps-1.dll (unknown line)
while loading C:\Users\arbenede\projects\julia\test_IPopt.jl, in expression starting on line 34
dmumps_454_ at C:\Users\arbenede\.julia\v0.6\Ipopt\deps\usr\bin\libcoinmumps-1.dll (unknown line)
dmumps_559_ at C:\Users\arbenede\.julia\v0.6\Ipopt\deps\usr\bin\libcoinmumps-1.dll (unknown line)
dmumps_203_ at C:\Users\arbenede\.julia\v0.6\Ipopt\deps\usr\bin\libcoinmumps-1.dll (unknown line)
dmumps_26_ at C:\Users\arbenede\.julia\v0.6\Ipopt\deps\usr\bin\libcoinmumps-1.dll (unknown line)
dmumps_ at C:\Users\arbenede\.julia\v0.6\Ipopt\deps\usr\bin\libcoinmumps-1.dll (unknown line)
dmumps_f77_ at C:\Users\arbenede\.julia\v0.6\Ipopt\deps\usr\bin\libcoinmumps-1.dll (unknown line)
dmumps_c at C:\Users\arbenede\.julia\v0.6\Ipopt\deps\usr\bin\libcoinmumps-1.dll (unknown line)
[...]
So I decided to run the same code under Ubuntu, with the same version of Julia, and there I am getting a different error:
******************************************************************************
This program contains Ipopt, a library for large-scale nonlinear optimization.
Ipopt is released as open source code under the Eclipse Public License (EPL).
For more information visit http://projects.coin-or.org/Ipopt
******************************************************************************
Internal error 2 in QAMD : Schur size expected: 0 Real: 1
** MPI_ABORT called
*** Error in `/usr/local/julia-9d11f62bcb/bin/julia': free(): invalid next size (fast): 0x0000000004986d90 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7fbe7254f7e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x8037a)[0x7fbe7255837a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7fbe7255c53c]
/usr/local/julia-9d11f62bcb/bin/../lib/julia/libLLVM-3.9.so(_ZN4llvm15LLVMContextImplD1Ev+0x17a2)[0x7fbe70af3da2]
/usr/local/julia-9d11f62bcb/bin/../lib/julia/libLLVM-3.9.so(_ZN4llvm11LLVMContextD2Ev+0x14)[0x7fbe70aec384]
/lib/x86_64-linux-gnu/libc.so.6(__cxa_finalize+0x9a)[0x7fbe7251236a]
/usr/local/julia-9d11f62bcb/bin/../lib/libjulia.so.0.6(+0x2cdb3)[0x7fbe72ef7db3]
Should I try a different solver? Is there any combination of versions of Julia/JuMP with a nonlinear solver that is known to work under Windows or Linux?
Thanks much
-Arrigo