Giter VIP home page Giter VIP logo

ipopt.jl's Introduction

Ipopt.jl

Build Status codecov

Ipopt.jl is a wrapper for the Ipopt solver.

Affiliation

This wrapper is maintained by the JuMP community and is not a COIN-OR project.

Getting help

If you need help, please ask a question on the JuMP community forum.

If you have a reproducible example of a bug, please open a GitHub issue.

License

Ipopt.jl is licensed under the MIT License.

The underlying solver, coin-or/Ipopt, is licensed under the Eclipse public license.

Installation

Install Ipopt.jl using the Julia package manager:

import Pkg
Pkg.add("Ipopt")

In addition to installing the Ipopt.jl package, this will also download and install the Ipopt binaries. You do not need to install Ipopt separately.

To use a custom binary, read the Custom solver binaries section of the JuMP documentation.

For details on using a different linear solver, see the Linear Solvers section below. You do not need a custom binary to change the linear solver.

Use with JuMP

You can use Ipopt with JuMP as follows:

using JuMP, Ipopt
model = Model(Ipopt.Optimizer)
set_attribute(model, "max_cpu_time", 60.0)
set_attribute(model, "print_level", 0)

MathOptInterface API

The Ipopt optimizer supports the following constraints and attributes.

List of supported objective functions:

List of supported variable types:

List of supported constraint types:

List of supported model attributes:

List of supported optimizer attributes:

Options

Supported options are listed in the Ipopt documentation.

Solver-specific callbacks

Ipopt provides a callback that can be used to log the status of the optimization during a solve. It can also be used to terminate the optimization by returning false. Here is an example:

using JuMP, Ipopt, Test
model = Model(Ipopt.Optimizer)
set_silent(model)
@variable(model, x >= 1)
@objective(model, Min, x + 0.5)
x_vals = Float64[]
function my_callback(
   alg_mod::Cint,
   iter_count::Cint,
   obj_value::Float64,
   inf_pr::Float64,
   inf_du::Float64,
   mu::Float64,
   d_norm::Float64,
   regularization_size::Float64,
   alpha_du::Float64,
   alpha_pr::Float64,
   ls_trials::Cint,
)
   push!(x_vals, callback_value(model, x))
   @test isapprox(obj_value, 1.0 * x_vals[end] + 0.5, atol = 1e-1)
   # return `true` to keep going, or `false` to terminate the optimization.
   return iter_count < 1
end
MOI.set(model, Ipopt.CallbackFunction(), my_callback)
optimize!(model)
@test MOI.get(model, MOI.TerminationStatus()) == MOI.INTERRUPTED
@test length(x_vals) == 2

See the Ipopt documentation for an explanation of the arguments to the callback. They are identical to the output contained in the logging table printed to the screen.

To access the current solution and primal, dual, and complementarity violations of each iteration, use Ipopt.GetIpoptCurrentViolations and Ipopt.GetIpoptCurrentIterate. The two functions are identical to the ones in the Ipopt C interface.

C API

Ipopt.jl wraps the Ipopt C interface with minimal modifications.

A complete example is available in the test/C_wrapper.jl file.

For simplicity, the five callbacks required by Ipopt are slightly different to the C interface. They are as follows:

"""
   eval_f(x::Vector{Float64})::Float64

Returns the objective value `f(x)`.
"""
function eval_f end

"""
   eval_grad_f(x::Vector{Float64}, grad_f::Vector{Float64})::Nothing

Fills `grad_f` in-place with the gradient of the objective function evaluated at
`x`.
"""
function eval_grad_f end

"""
   eval_g(x::Vector{Float64}, g::Vector{Float64})::Nothing

Fills `g` in-place with the value of the constraints evaluated at `x`.
"""
function eval_g end

"""
   eval_jac_g(
      x::Vector{Float64},
      rows::Vector{Cint},
      cols::Vector{Cint},
      values::Union{Nothing,Vector{Float64}},
   )::Nothing

Compute the Jacobian matrix.

* If `values === nothing`
   - Fill `rows` and `cols` with the 1-indexed sparsity structure
* Otherwise:
   - Fill `values` with the elements of the Jacobian matrix according to the
     sparsity structure.

!!! warning
    If `values === nothing`, `x` is an undefined object. Accessing any elements
    in it will cause Julia to segfault.
"""
function eval_jac_g end

"""
   eval_h(
      x::Vector{Float64},
      rows::Vector{Cint},
      cols::Vector{Cint},
      obj_factor::Float64,
      lambda::Float64,
      values::Union{Nothing,Vector{Float64}},
   )::Nothing

Compute the Hessian-of-the-Lagrangian matrix.

* If `values === nothing`
   - Fill `rows` and `cols` with the 1-indexed sparsity structure
* Otherwise:
   - Fill `values` with the Hessian matrix according to the sparsity structure.

!!! warning
    If `values === nothing`, `x` is an undefined object. Accessing any elements
    in it will cause Julia to segfault.
"""
function eval_h end

INVALID_MODEL error

If you get a termination status MOI.INVALID_MODEL, it is probably because you have some undefined value in your model, for example, a division by zero. Fix this by removing the division, or by imposing variable bounds so that you cut off the undefined region.

Instead of

model = Model(Ipopt.Optimizer)
@variable(model, x)
@NLobjective(model, 1 / x)

do

model = Model(Ipopt.Optimizer)
@variable(model, x >= 0.0001)
@NLobjective(model, 1 / x)

Linear Solvers

To improve performance, Ipopt supports a number of linear solvers.

HSL

Obtain a license and download HSL_jll.jl from https://licences.stfc.ac.uk/product/libhsl.

There are two versions available: LBT and OpenBLAS. LBT is the recommended option for Julia ≥ v1.9.

Install this download into your current environment using:

import Pkg
Pkg.develop(path = "/full/path/to/HSL_jll.jl")

Then, use a linear solver in HSL by setting the hsllib and linear_solver attributes:

using JuMP, Ipopt
import HSL_jll
model = Model(Ipopt.Optimizer)
set_attribute(model, "hsllib", HSL_jll.libhsl_path)
set_attribute(model, "linear_solver", "ma86")

The available HSL solvers are "ma27", "ma57", "ma86", "ma87", and "ma97". We recommend using either sequential BLAS and LAPACK backends or a multithreaded version limited to one thread when employing the linear solvers "ma86", "ma87", or "ma97". These solvers already leverage parallelism via OpenMP, and enabling multiple threads in BLAS and LAPACK may result in thread oversubscription.

macOS users

Due to the security policy of macOS, Mac users may need to delete the quarantine attribute of the ZIP archive before extracting. For example:

xattr -d com.apple.quarantine lbt_HSL_jll.jl-2023.11.7.zip
xattr -d com.apple.quarantine openblas_HSL_jll.jl-2023.11.7.zip

Pardiso

Download Pardiso from https://www.pardiso-project.org. Save the shared library somewhere, and record the filename.

Then, use Pardiso by setting the pardisolib and linear_solver attributes:

using JuMP, Ipopt
model = Model(Ipopt.Optimizer)
set_attribute(model, "pardisolib", "/full/path/to/libpardiso")
set_attribute(model, "linear_solver", "pardiso")

SPRAL

If you use Ipopt.jl with Julia ≥ v1.9, the linear solver SPRAL is available. You can use it by setting the linear_solver attribute:

using JuMP, Ipopt
model = Model(Ipopt.Optimizer)
set_attribute(model, "linear_solver", "spral")

Note that the following environment variables must be set before starting Julia:

export OMP_CANCELLATION=TRUE
export OMP_PROC_BIND=TRUE

BLAS and LAPACK

With Julia v1.9 or later, Ipopt and the linear solvers MUMPS (default), SPRAL, and HSL are compiled with libblastrampoline (LBT), a library that can change between BLAS and LAPACK backends at runtime.

Note that the BLAS and LAPACK backends loaded at runtime must be compiled with 32-bit integers. The default BLAS and LAPACK backend is OpenBLAS, and we rely on the Julia artifact OpenBLAS32_jll.jl if no backend is loaded before using Ipopt.

Using LBT, we can also switch dynamically to other BLAS backends such as Intel MKL, BLIS, and Apple Accelerate. Because Ipopt and the linear solvers heavily rely on BLAS and LAPACK routines, using an optimized backend for a particular platform can improve the performance.

Sequential BLAS and LAPACK

If you have ReferenceBLAS32_jll.jl and LAPACK32_jll.jl installed, switch to sequential and reference version of BLAS and LAPACK with:

using ReferenceBLAS32_jll, LAPACK32_jll
LinearAlgebra.BLAS.lbt_forward(libblas32)
LinearAlgebra.BLAS.lbt_forward(liblapack32)
using Ipopt

MKL

If you have MKL.jl installed, switch to MKL by adding using MKL to your code:

using MKL
using Ipopt

BLIS

If you have BLIS32_jll.jl and LAPACK32_jll.jl installed, switch to BLIS with:

using blis32_jll, LAPACK32_jll
LinearAlgebra.BLAS.lbt_forward(blis32)
LinearAlgebra.BLAS.lbt_forward(liblapack32)
using Ipopt

AppleAccelerate

If you are using macOS ≥ v13.4 and you have AppleAccelerate.jl installed, add using AppleAccelerate to your code:

using AppleAccelerate
using Ipopt

Display backends

Check what backends are loaded using:

import LinearAlgebra
LinearAlgebra.BLAS.lbt_get_config()

ipopt.jl's People

Contributors

abelsiqueira avatar abhijithch avatar akshay326 avatar amontoison avatar blegat avatar ccoffrin avatar chkwon avatar dpo avatar ferrolho avatar freemin7 avatar iainnz avatar joehuchette avatar juan-pablo-vielma avatar juliatagbot avatar loicvh avatar lukasbarner avatar mewilhel avatar mlubin avatar odow avatar pizhn avatar ranjanan avatar rschwarz avatar staticfloat avatar this-josh avatar timholy avatar tkelman avatar tkoolen avatar yuyichao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ipopt.jl's Issues

Can a newer version of Ipopt be distributed for windows?

I currently have a JuMP problem that solves on juliabox, but not on my local (windows) machine. The only difference between the two setups that I was able to find is the version of Ipopt: juliabox is on 3.11.7, whereas my local machine is on 3.11.0 (no custom install, just what Ipop.jl brings in the box).

Could the bundled Ipopt version for windows be updated?

Also, if someone from the Ipopt.jl or JuMP team wants to try this out, I'd be happy to give you access to the bitbucket repo with the replication code. Thanks!

@tkelman, @mlubin

Error on IPOPT building

Hi,

I'm trying to use the DSPsolver in Julia, for that reason I needed to get Ipopt but I'm having problems building the Package. I think i've got all the requirements because I built my own Ipopt version. I'm getting the following error in the building:


libtool: link: libipoptamplinterface.la' is not a valid libtool archive make[3]: *** [ipopt] Error 1 make[3]: Leaving directory/home/juan/.julia/v0.5/Ipopt/deps/src/Ipopt-3.12.1/Ipopt/src/Apps/AmplSolver'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory /home/juan/.julia/v0.5/Ipopt/deps/src/Ipopt-3.12.1/Ipopt/src/Apps' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory/home/juan/.julia/v0.5/Ipopt/deps/src/Ipopt-3.12.1/Ipopt'
make: *** [all-recursive] Error 1
================================================================[ ERROR: Ipopt ]=======================

Sincerely,

Juan

Ipopt + Julia: Can we solve a problem without constraints?

Hi,
I already wrote a script in Matlab to solve a PDE-constrained optimization problem by defining the adjoint formulation and I used Ipopt which works well. It means I don't define any constraints in Matlab version. But I have the following error when I don't define the constraints in julia :
ERROR: LoadError: IPOPT: Failed to construct problem.

I even tried to solve a simple problem with no-constraints, I have again the same error. Could you please tell me if it is possible using Ipopt in Julia without Constraints?

Thanks in advance

Lasso problem with Ipopt: how to pass the data to Ipopt for PDE-constrained optimization

Hi, firstly, thank you so much for the Julia interface to the Ipopt nonlinear solver.

I am working on a PDE-constrained optimization problem, where I need to pass the data to the IPOPT solver, something similar to the in Matlab example e.g. the Lasso problem which uses Ipopt (see: http://www.cs.ubc.ca/~pcarbo/ipopt-for-matlab/lasso.m).

Do you have any equivalent example in Julia? if not, could you possibly provide and example where one passes this kind of data to the solver?

Error failed to find fortran compiler

When I am compiling IPOPT using msys and Mingw in Windows, it is saying,
failed to find a fortran compiler.
Checking for gfortran, ifort, g95, g77, f132, compile_f2c: all the answers are no.
I have installed fortran compiler using mingw.
Kindly let me know what can be wrong.

[PkgEval] Ipopt may have a testing issue on Julia 0.3 (2015-07-04)

PackageEvaluator.jl is a script that runs nightly. It attempts to load all Julia packages and run their tests (if available) on both the stable version of Julia (0.3) and the nightly build of the unstable version (0.4). The results of this script are used to generate a package listing enhanced with testing results.

On Julia 0.3

  • On 2015-07-02 the testing status was Tests pass.
  • On 2015-07-04 the testing status changed to Tests fail.

This issue was filed because your testing status became worse. No additional issues will be filed if your package remains in this state, and no issue will be filed if it improves. If you'd like to opt-out of these status-change messages, reply to this message saying you'd like to and @IainNZ will add an exception. If you'd like to discuss PackageEvaluator.jl please file an issue at the repository. For example, your package may be untestable on the test machine due to a dependency - an exception can be added.

Test log:

>>> 'Pkg.add("Ipopt")' log
INFO: Installing Ipopt v0.1.15
INFO: Installing MathProgBase v0.3.12
INFO: Building Ipopt
INFO: Attempting to Create directory /home/vagrant/.julia/v0.3/Ipopt/deps/downloads
INFO: Directory /home/vagrant/.julia/v0.3/Ipopt/deps/downloads already created
INFO: Downloading file http://www.coin-or.org/download/source/Ipopt/Ipopt-3.12.1.tgz
INFO: Done downloading file http://www.coin-or.org/download/source/Ipopt/Ipopt-3.12.1.tgz
INFO: Attempting to Create directory /home/vagrant/.julia/v0.3/Ipopt/deps/src
INFO: Directory /home/vagrant/.julia/v0.3/Ipopt/deps/src already created
INFO: Attempting to Create directory /home/vagrant/.julia/v0.3/Ipopt/deps
INFO: Directory /home/vagrant/.julia/v0.3/Ipopt/deps already created
INFO: Attempting to Create directory /home/vagrant/.julia/v0.3/Ipopt/deps/src/Ipopt-3.12.1
INFO: Directory /home/vagrant/.julia/v0.3/Ipopt/deps/src/Ipopt-3.12.1 already created
INFO: Changing Directory to /home/vagrant/.julia/v0.3/Ipopt/deps/src/Ipopt-3.12.1
INFO: Changing Directory to /home/vagrant/.julia/v0.3/Ipopt/deps/src/Ipopt-3.12.1/ThirdParty/Blas
INFO: Attempting to Create directory build
INFO: Directory build already created
INFO: Changing Directory to /home/vagrant/.julia/v0.3/Ipopt/deps/src/Ipopt-3.12.1/ThirdParty/Blas
INFO: Changing Directory to /home/vagrant/.julia/v0.3/Ipopt/deps/src/Ipopt-3.12.1
INFO: Changing Directory to /home/vagrant/.julia/v0.3/Ipopt/deps/src/Ipopt-3.12.1/ThirdParty/Blas/build
INFO: Changing Directory to /home/vagrant/.julia/v0.3/Ipopt/deps/src/Ipopt-3.12.1/ThirdParty/Blas/build
make: *** No rule to make target `install'.  Stop.
================================[ ERROR: Ipopt ]================================

failed process: Process(`make install`, ProcessExited(2)) [2]
while loading /home/vagrant/.julia/v0.3/Ipopt/deps/build.jl, in expression starting on line 72

================================================================================

================================[ BUILD ERRORS ]================================

WARNING: Ipopt had build errors.

 - packages with build errors remain installed in /home/vagrant/.julia/v0.3
 - build the package(s) and all dependencies with `Pkg.build("Ipopt")`
 - build a single package by running its `deps/build.jl` script

================================================================================
INFO: Package database updated
INFO: METADATA is out-of-date — you may not have the latest version of Ipopt
INFO: Use `Pkg.update()` to get the latest versions of your packages

>>> 'Pkg.test("Ipopt")' log
Julia Version 0.3.10
Commit c8ceeef* (2015-06-24 13:54 UTC)
Platform Info:
  System: Linux (x86_64-unknown-linux-gnu)
  CPU: Intel(R) Xeon(R) CPU E5-2650 0 @ 2.00GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Nehalem)
  LAPACK: libopenblas
  LIBM: libopenlibm
  LLVM: libLLVM-3.3
INFO: Testing Ipopt
ERROR: Ipopt not properly installed. Please run Pkg.build("Ipopt")
 in error at error.jl:21
 in include at ./boot.jl:245
 in include_from_node1 at ./loading.jl:128
 in reload_path at loading.jl:152
 in _require at loading.jl:67
 in require at loading.jl:51
 in include at ./boot.jl:245
 in include_from_node1 at loading.jl:128
 in process_options at ./client.jl:285
 in _start at ./client.jl:354
while loading /home/vagrant/.julia/v0.3/Ipopt/src/Ipopt.jl, in expression starting on line 6
while loading /home/vagrant/.julia/v0.3/Ipopt/test/runtests.jl, in expression starting on line 1

================================[ ERROR: Ipopt ]================================

failed process: Process(`/home/vagrant/julia/bin/julia /home/vagrant/.julia/v0.3/Ipopt/test/runtests.jl`, ProcessExited(1)) [1]

================================================================================
INFO: No packages to install, update or remove
ERROR: Ipopt had test errors
 in error at error.jl:21
 in test at pkg/entry.jl:718
 in anonymous at pkg/dir.jl:28
 in cd at ./file.jl:20
 in cd at pkg/dir.jl:28
 in test at pkg.jl:67
 in process_options at ./client.jl:213
 in _start at ./client.jl:354


>>> End of log

Ipopt on Julia 0.3 broken?

Just happened on PkgEval, was not like this in mid-December

http://pkg.julialang.org/logs/Ipopt_0.3.log

>>> 'Pkg.add("Ipopt")' log
INFO: Installing Ipopt v0.1.18
INFO: Installing MathProgBase v0.3.19
INFO: Building Ipopt
INFO: Attempting to Create directory /home/vagrant/.julia/v0.3/Ipopt/deps/downloads
INFO: Directory /home/vagrant/.julia/v0.3/Ipopt/deps/downloads already created
INFO: Downloading file http://www.coin-or.org/download/source/Ipopt/Ipopt-3.12.1.tgz
INFO: Done downloading file http://www.coin-or.org/download/source/Ipopt/Ipopt-3.12.1.tgz
INFO: Attempting to Create directory /home/vagrant/.julia/v0.3/Ipopt/deps/src
INFO: Directory /home/vagrant/.julia/v0.3/Ipopt/deps/src already created
INFO: Attempting to Create directory /home/vagrant/.julia/v0.3/Ipopt/deps
INFO: Directory /home/vagrant/.julia/v0.3/Ipopt/deps already created
INFO: Path /home/vagrant/.julia/v0.3/Ipopt/deps/src/Ipopt-3.12.1 already created
INFO: Changing Directory to /home/vagrant/.julia/v0.3/Ipopt/deps/src/Ipopt-3.12.1
INFO: Changing Directory to /home/vagrant/.julia/v0.3/Ipopt/deps/src/Ipopt-3.12.1/ThirdParty/Blas
================================[ ERROR: Ipopt ]================================

chdir /home/vagrant/.julia/v0.3/Ipopt/deps/src/Ipopt-3.12.1/ThirdParty/Blas: no such file or directory (ENOENT)
while loading /home/vagrant/.julia/v0.3/Ipopt/deps/build.jl, in expression starting on line 81

================================================================================

Any ideas?

[PkgEval] Ipopt may have a testing issue on Julia 0.4 (2014-10-28)

PackageEvaluator.jl is a script that runs nightly. It attempts to load all Julia packages and run their tests (if available) on both the stable version of Julia (0.3) and the nightly build of the unstable version (0.4). The results of this script are used to generate a package listing enhanced with testing results.

On Julia 0.4

  • On 2014-10-27 the testing status was Tests pass.
  • On 2014-10-28 the testing status changed to Tests fail, but package loads.

Tests pass. means that PackageEvaluator found the tests for your package, executed them, and they all passed.

Tests fail, but package loads. means that PackageEvaluator found the tests for your package, executed them, and they didn't pass. However, trying to load your package with using worked.

This issue was filed because your testing status became worse. No additional issues will be filed if your package remains in this state, and no issue will be filed if it improves. If you'd like to opt-out of these status-change messages, reply to this message saying you'd like to and @IainNZ will add an exception. If you'd like to discuss PackageEvaluator.jl please file an issue at the repository. For example, your package may be untestable on the test machine due to a dependency - an exception can be added.

Test log:

>>> 'Pkg.add("Ipopt")' log

WARNING: deprecated syntax "{}" at /home/idunning/pkgtest/.julia/v0.4/BinDeps/src/BinDeps.jl:103.
Use "[]" instead.

WARNING: deprecated syntax "{}" at /home/idunning/pkgtest/.julia/v0.4/BinDeps/src/BinDeps.jl:104.
Use "[]" instead.

WARNING: deprecated syntax "(String=>String)[]" at /home/idunning/pkgtest/.julia/v0.4/BinDeps/src/BinDeps.jl:146.
Use "Dict{String,String}()" instead.

WARNING: deprecated syntax "(String=>String)[]" at /home/idunning/pkgtest/.julia/v0.4/BinDeps/src/BinDeps.jl:147.
Use "Dict{String,String}()" instead.

WARNING: deprecated syntax "(String=>String)[]" at /home/idunning/pkgtest/.julia/v0.4/BinDeps/src/BinDeps.jl:148.
Use "Dict{String,String}()" instead.

WARNING: deprecated syntax "(String=>String)[]" at /home/idunning/pkgtest/.julia/v0.4/BinDeps/src/BinDeps.jl:149.
Use "Dict{String,String}()" instead.

WARNING: deprecated syntax "{}" at /home/idunning/pkgtest/.julia/v0.4/BinDeps/src/dependencies.jl:87.
... truncated ...
addlibs=`cat /home/idunning/pkgtest/.julia/v0.4/Ipopt/deps/usr/share/coin/doc/Ipopt/ipopt_addlibs_cpp.txt` ; \ \
echo "$addlibs -lstdc++ -lm" > /home/idunning/pkgtest/.julia/v0.4/Ipopt/deps/usr/share/coin/doc/Ipopt/ipopt_addlibs_c.txt ; \ \
for i in  -L/usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.1 -L/usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.1/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-unknown-linux-gnu/4.9.1/../../.. -lgfortran -lm -lquadmath coin_dummy ; do \ \
    addlibs=`echo -n " $addlibs " | sed -e "s! $i ! !g"` ; \ \
done ; \ \
echo "$addlibs -lstdc++ -lm" > /home/idunning/pkgtest/.julia/v0.4/Ipopt/deps/usr/share/coin/doc/Ipopt/ipopt_addlibs_f.txt
make[4]: Leaving directory '/home/idunning/pkgtest/.julia/v0.4/Ipopt/deps/src/Ipopt-3.11.7/Ipopt'
make[3]: Leaving directory '/home/idunning/pkgtest/.julia/v0.4/Ipopt/deps/src/Ipopt-3.11.7/Ipopt'
make[2]: Leaving directory '/home/idunning/pkgtest/.julia/v0.4/Ipopt/deps/src/Ipopt-3.11.7/Ipopt'
make[1]: Leaving directory '/home/idunning/pkgtest/.julia/v0.4/Ipopt/deps/src/Ipopt-3.11.7/Ipopt'
make[1]: Entering directory '/home/idunning/pkgtest/.julia/v0.4/Ipopt/deps/src/Ipopt-3.11.7'
make[2]: Entering directory '/home/idunning/pkgtest/.julia/v0.4/Ipopt/deps/src/Ipopt-3.11.7'
Run make install-doxydoc to generate and install Doxygen documentation.
make[2]: Nothing to be done for 'install-data-am'.
make[2]: Leaving directory '/home/idunning/pkgtest/.julia/v0.4/Ipopt/deps/src/Ipopt-3.11.7'
make[1]: Leaving directory '/home/idunning/pkgtest/.julia/v0.4/Ipopt/deps/src/Ipopt-3.11.7'
INFO: Installing BinDeps v0.3.6
INFO: Installing Ipopt v0.1.5
INFO: Installing MathProgBase v0.3.2
INFO: Installing SHA v0.0.3
INFO: Installing URIParser v0.0.3
INFO: Building Ipopt
INFO: Attempting to Create directory /home/idunning/pkgtest/.julia/v0.4/Ipopt/deps/downloads
INFO: Downloading file http://www.coin-or.org/download/source/Ipopt/Ipopt-3.11.7.tgz
INFO: Done downloading file http://www.coin-or.org/download/source/Ipopt/Ipopt-3.11.7.tgz
INFO: Attempting to Create directory /home/idunning/pkgtest/.julia/v0.4/Ipopt/deps/src
INFO: Attempting to Create directory /home/idunning/pkgtest/.julia/v0.4/Ipopt/deps
INFO: Directory /home/idunning/pkgtest/.julia/v0.4/Ipopt/deps already created
INFO: Attempting to Create directory /home/idunning/pkgtest/.julia/v0.4/Ipopt/deps/src/Ipopt-3.11.7
INFO: Changing Directory to /home/idunning/pkgtest/.julia/v0.4/Ipopt/deps/src/Ipopt-3.11.7
INFO: Changing Directory to /home/idunning/pkgtest/.julia/v0.4/Ipopt/deps/src/Ipopt-3.11.7/ThirdParty/Blas
INFO: Attempting to Create directory build
INFO: Changing Directory to /home/idunning/pkgtest/.julia/v0.4/Ipopt/deps/src/Ipopt-3.11.7/ThirdParty/Blas
INFO: Changing Directory to /home/idunning/pkgtest/.julia/v0.4/Ipopt/deps/src/Ipopt-3.11.7
INFO: Changing Directory to /home/idunning/pkgtest/.julia/v0.4/Ipopt/deps/src/Ipopt-3.11.7/ThirdParty/Blas/build
INFO: Changing Directory to /home/idunning/pkgtest/.julia/v0.4/Ipopt/deps/src/Ipopt-3.11.7/ThirdParty/Blas/build
INFO: Changing Directory to /home/idunning/pkgtest/.julia/v0.4/Ipopt/deps/src/Ipopt-3.11.7
INFO: Changing Directory to /home/idunning/pkgtest/.julia/v0.4/Ipopt/deps/src/Ipopt-3.11.7/ThirdParty/Lapack
INFO: Attempting to Create directory build
INFO: Changing Directory to /home/idunning/pkgtest/.julia/v0.4/Ipopt/deps/src/Ipopt-3.11.7/ThirdParty/Lapack
INFO: Changing Directory to /home/idunning/pkgtest/.julia/v0.4/Ipopt/deps/src/Ipopt-3.11.7
INFO: Changing Directory to /home/idunning/pkgtest/.julia/v0.4/Ipopt/deps/src/Ipopt-3.11.7/ThirdParty/Lapack/build
INFO: Changing Directory to /home/idunning/pkgtest/.julia/v0.4/Ipopt/deps/src/Ipopt-3.11.7/ThirdParty/Lapack/build
INFO: Changing Directory to /home/idunning/pkgtest/.julia/v0.4/Ipopt/deps/src/Ipopt-3.11.7
INFO: Changing Directory to /home/idunning/pkgtest/.julia/v0.4/Ipopt/deps/src/Ipopt-3.11.7/ThirdParty/Mumps
INFO: Changing Directory to /home/idunning/pkgtest/.julia/v0.4/Ipopt/deps/src/Ipopt-3.11.7
INFO: Changing Directory to /home/idunning/pkgtest/.julia/v0.4/Ipopt/deps/src/Ipopt-3.11.7
INFO: Package database updated
INFO: METADATA is out-of-date a you may not have the latest version of Ipopt
INFO: Use `Pkg.update()` to get the latest versions of your packages

>>> 'using Ipopt' log

WARNING: deprecated syntax "{a=>b, ...}" at /home/idunning/pkgtest/.julia/v0.4/Ipopt/src/Ipopt.jl:69.
Use "Dict{Any,Any}(a=>b, ...)" instead.
Julia Version 0.4.0-dev+1330
Commit 7fdc860 (2014-10-28 03:56 UTC)
Platform Info:
  System: Linux (x86_64-unknown-linux-gnu)
  CPU: Intel(R) Xeon(R) CPU E5-2650 0 @ 2.00GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge)
  LAPACK: libopenblas
  LIBM: libopenlibm
  LLVM: libLLVM-3.3

>>> test log

WARNING: deprecated syntax "{a=>b, ...}" at /home/idunning/pkgtest/.julia/v0.4/Ipopt/src/Ipopt.jl:69.
Use "Dict{Any,Any}(a=>b, ...)" instead.

******************************************************************************
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
******************************************************************************

This is Ipopt version 3.11.7, running with linear solver mumps.
NOTE: Other linear solvers might be more efficient (see Ipopt documentation).

Number of nonzeros in equality constraint Jacobian...:        4
Number of nonzeros in inequality constraint Jacobian.:        4
Number of nonzeros in Lagrangian Hessian.............:       10

Total number of variables............................:        4
                     variables with only lower bounds:        0
                variables with lower and upper bounds:        4
... truncated ...
 in process_options at ./client.jl:293
 in _start at ./client.jl:362
 in _start_3B_3769 at /home/idunning/julia04/usr/bin/../lib/julia/sys.so
while loading /home/idunning/pkgtest/.julia/v0.4/Ipopt/test/runtests.jl, in expression starting on line 29

String option

Int option

Float option

Setting: "badoption" is not a valid setting for Option: hessian_approximation. Check the option documentation.

### hessian_approximation (String) ###
Category: Hessian Approximation
Description: Indicates what Hessian information is to be used.
Valid Settings:
    exact (Use second derivatives provided by the NLP.)
    limited-memory (Perform a limited-memory quasi-Newton approximation)
Default: "exact"
Setting: "-1" is not a valid setting for Option: file_print_level. Check the option documentation.

### file_print_level (Integer) ###
Category: Output
Description: Verbosity level for output file.
0 <= (5) <= 12
Setting: "-1" is not a valid setting for Option: derivative_test_tol. Check the option documentation.

### derivative_test_tol (Real Number) ###
Category: Derivative Checker
Description: Threshold for indicating wrong derivative.
0 < (0.0001) <= +inf
INFO: Testing Ipopt
================================[ ERROR: Ipopt ]================================

failed process: Process(`/home/idunning/julia04/usr/bin/julia /home/idunning/pkgtest/.julia/v0.4/Ipopt/test/runtests.jl`, ProcessExited(1)) [1]

================================================================================
INFO: No packages to install, update or remove
ERROR: Ipopt had test errors
 in error at error.jl:21
 in test at pkg/entry.jl:719
 in anonymous at pkg/dir.jl:28
 in cd at ./file.jl:20
 in cd at pkg/dir.jl:28
 in test at pkg.jl:68
 in process_options at ./client.jl:221
 in _start at ./client.jl:362
 in _start_3B_3769 at /home/idunning/julia04/usr/bin/../lib/julia/sys.so


>>> end of log

Ipopt problem scaling not working

I built a JuMP model with the following norm maximization objective:

setObjective(m,:Max,sum([(Qtheta[i,i]*z[i]^2) for i in 1:size(Qtheta,1)]))

When I use MosekSolver(), I get an error:

MOSEK error 1296: The quadratic coefficient matrix in the objective is not negative semidefinite as expected for a maximization problem.

But when I use IpoptSolver(), it performs minimization and says it has found an optimal solution. Here is some of the output:

This is Ipopt version 3.11.7, running with linear solver mumps.
NOTE: Other linear solvers might be more efficient (see Ipopt documentation).

Number of nonzeros in equality constraint Jacobian...:     1032
Number of nonzeros in inequality constraint Jacobian.:       54
Number of nonzeros in Lagrangian Hessian.............:      279

Total number of variables............................:      279
                     variables with only lower bounds:        0
                variables with lower and upper bounds:        0
                     variables with only upper bounds:        0
Total number of equality constraints.................:      225
Total number of inequality constraints...............:       54
        inequality constraints with only lower bounds:        0
   inequality constraints with lower and upper bounds:       54
        inequality constraints with only upper bounds:        0

iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls
   0 -2.6589219e-04 2.14e+00 1.97e-02   0.0 0.00e+00    -  0.00e+00 0.00e+00   0
   1 -7.7987052e-06 1.24e-14 2.45e-07 -11.0 3.41e+01    -  9.90e-01 1.00e+00h  1
   2 -7.7988784e-06 1.42e-14 2.46e-09 -11.0 2.57e-06    -  9.90e-01 1.00e+00h  1
   3 -7.8157914e-06 1.42e-14 1.43e-10 -11.0 2.50e-04    -  9.95e-01 1.00e+00h  1
   4 -8.3505974e-06 2.13e-14 8.63e-08  -8.8 4.52e-02    -  8.87e-01 9.96e-01h  1
   5 -9.5318281e-06 1.42e-14 4.61e-07  -8.4 1.05e+00    -  7.93e-01 6.17e-01f  1
   6 -9.9182203e-06 1.24e-14 1.42e-08  -9.2 2.69e-01    -  8.27e-01 9.59e-01f  1
   7 -9.9602587e-06 1.18e-14 2.00e-09 -10.3 3.04e-02    -  9.62e-01 1.00e+00h  1

Number of Iterations....: 7

I noticed here that Ipopt problem scaling may not work. Perhaps Ipopt is not switching from minimization to maximization when JuMP tells it to?

(optionally) Sanity-check user functions

Came up on IRC that an off-by-one error in a user written callback function caused Ipopt to segfault. If Julia had run eval_g(prob.x, prob.g) then it would give a BoundsError() in that case, likely easier to debug than a segfault inside Ipopt's C++ code. Either a convenient sanityCheck(prob) wrapper or documenting the set of function calls that are recommended to run in Julia before calling solveProblem the first time might help for anyone writing their own callbacks.

cc @TravisBarryDick

Hessian handling doesn't fully adhere to MathProgBase interface?

First, thank you for making this interface available!

I did run into a small issue while working with Ipopt via the MathProgBase interface. The MathProgBase documentation for hesslag_structure says:

Returns the sparsity structure of the Hessian-of-the-Lagrangian matrix [...] as a tuple (I,J) where I contains the row indices and J contains the column indices of each structurally nonzero element. These indices are not required to be sorted and can contain duplicates, in which case the solver should combine the corresponding elements by adding them together. [...]

Could it be that Ipopt.jl currently doesn't handle the part I emphasized correctly? In the Ipopt documentation for eval_h, I don't see any mention of Ipopt handling this requirement, and I don't see it in eval_h_cb either.

Build Error

Running Julia .3 in Windows 8.1
I cannot get Ipopt.jl to build. It returns the following:

INFO: Building WinRPM
INFO: Downloading https://cache.e.ip.saba.us/http://download.opensuse.org/repositories/windows:/mingw:/win32/openSUSE_13.1/repodata/repomd.xml
INFO: Downloading https://cache.e.ip.saba.us/http://download.opensuse.org/repositories/windows:/mingw:/win64/openSUSE_13.1/repodata/repomd.xml
INFO: Building Ipopt
INFO: Nothing to do
================================[ ERROR: Ipopt ]================================

Provider PackageManager failed to satisfy dependency libipopt
while loading C:\Users\ms.julia\v0.3\Ipopt\deps\build.jl, in expression starting on line 72

================================[ BUILD ERRORS ]================================

WARNING: Ipopt had build errors.

  • packages with build errors remain installed in C:\Users\Michael.julia\v0.3
  • build the package(s) and all dependencies with Pkg.build("Ipopt")
  • build a single package by running its deps/build.jl script

Expose Ipopt's new_x argument

The C++ interface to Ipopt has an new_x argument to the evaluation functions (eval_f, eval_grad_f, etc.), allowing the user to avoid re-computing costly derivatives (e.g. when they have an expensive objective function that calculates the value and derivative simultaneously). Would it be possible to expose this feature in the Julia interface?

build fails on travis

https://travis-ci.org/JuliaOpt/JuMP.jl/jobs/178999979#L3880

Downloading the source code from projects.coin-or.org...
--2016-11-26 06:18:56--  http://www.coin-or.org/BuildTools/Blas/blas-20130815.tgz
Resolving www.coin-or.org (www.coin-or.org)... 130.127.206.21
Connecting to www.coin-or.org (www.coin-or.org)|130.127.206.21|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://www.coin-or.org/BuildTools/Blas/blas-20130815.tgz [following]
--2016-11-26 06:18:56--  https://www.coin-or.org/BuildTools/Blas/blas-20130815.tgz
Connecting to www.coin-or.org (www.coin-or.org)|130.127.206.21|:443... connected.
ERROR: cannot verify www.coin-or.org's certificate, issued by `/C=US/ST=Arizona/L=Scottsdale/O=GoDaddy.com, Inc./OU=http://certs.godaddy.com/repository//CN=Go Daddy Secure Certificate Authority - G2':
  Unable to locally verify the issuer's authority.
To connect to www.coin-or.org insecurely, use `--no-check-certificate'.
Failed, try downloading the source code from www.netlib.org...
--2016-11-26 06:18:56--  http://www.netlib.org/blas/blas.tgz
Resolving www.netlib.org (www.netlib.org)... 160.36.131.221
Connecting to www.netlib.org (www.netlib.org)|160.36.131.221|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 101112 (99K) [application/x-gzip]
Saving to: `blas.tgz'
100%[======================================>] 101,112     --.-K/s   in 0.06s   
2016-11-26 06:18:57 (1.51 MB/s) - `blas.tgz' saved [101112/101112]
Uncompressing the tarball...
Unpacking the source code...
Deleting the tar file...
Moving the source files from BLAS subdirectory
mv: cannot stat `BLAS/*.f': No such file or directory
================================[ ERROR: Ipopt ]================================
LoadError: failed process: Process(`./get.Blas`, ProcessExited(1)) [1]
while loading /home/travis/.julia/v0.5/Ipopt/deps/build.jl, in expression starting on line 81

Build of Ipopt fails on Debian Linux

Possibly a duplicate of #62, but I don't have the lib64 folders.

It fails during the build of dependency Lapack:

INFO: Changing Directory to /home/rs/.julia/v0.4/Ipopt/deps/src/Ipopt-3.12.1/ThirdParty/Lapack/build
[...]
checking for pkg-config... no
checking whether -lblas has BLAS... no
checking for COIN-OR package Blas... skipped check via pkg-config, redirect to fallback
checking for COIN-OR package Blas (fallback)... no, dependency coinblas not available
configure: error: Required package BLAS not found.

But BLAS was built just before, and it seems successfully:

julia> Pkg.dir("Ipopt")
"/home/rs/.julia/v0.4/Ipopt"

shell> ls /home/rs/.julia/v0.4/Ipopt/
deps  doc  example  LICENSE.md  README.md  REQUIRE  src  test

shell> ls /home/rs/.julia/v0.4/Ipopt/deps
build.jl  downloads  src  usr

shell> ls /home/rs/.julia/v0.4/Ipopt/deps/usr
lib

shell> ls /home/rs/.julia/v0.4/Ipopt/deps/usr/lib/
libcoinblas.a  libcoinblas.la  pkgconfig

shell> ls /home/rs/.julia/v0.4/Ipopt/deps/usr/lib/pkgconfig/
coinblas.pc

shell> cat /home/rs/.julia/v0.4/Ipopt/deps/usr/lib/pkgconfig/coinblas.pc
prefix=/home/rs/.julia/v0.4/Ipopt/deps/usr
exec_prefix=${prefix}
libdir=${exec_prefix}/lib

Name: Blas
Description: Basic linear algebra package
URL: https://projects.coin-or.org/BuildTools
Version: 1.4.2
Libs: -L${libdir} -lcoinblas  -L/usr/lib/gcc/x86_64-linux-gnu/4.9 -L/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/4.9/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.9/../../.. -lgfortran -lm -lquadmath
Cflags:

Unconstrained Problem Crashes Julia

I'm trying to reproduce a simple example of an unconstrained problem but it crashes Julia.
The example comes from a previously solved issue: #28

using Ipopt

const A = randn(10)
prob = createProblem(1, [-10.], [10.], 0, Float64[], Float64[], 0, 1,
           (x) -> sum(exp(x[1] .* A)),
           (x, g) -> println("shouldn't be called"),
           (x, grad_f) -> grad_f[1] = sum(exp(x[1] .* A) .* A),
           (x, mode, rows, cols, values) -> println("don't call me"),
           (x, mode, rows, cols, obj_factor, lambda, values) -> begin
               rows[1] = 1;
               cols[1] = 1;
               values[1]=sum(exp(x[1] .* A) .* A .* A)
           end)

status = solveProblem(prob)

building documentation

I am trying to build the documentation on a Mac OS X.

I get the following:

make: *** No rule to make target stdlib/*.rst', needed byhelpdb.jl'. Stop.

Not clear what to do - any help here?

How to check memory usage

I'm experimenting with my model, and I want to know if my changes are helping or hurting the memory consumption. I have been using the @time to see the memory usage, but I do not know if that is the best method.

I also switched to the limited-memory hessian approximation and did not see any reduction in memory size with the @time macro, which surprised me. My problem is large, so memory is an issue

Ipopt.jl install problems on OSX

I am unable to install Ipopt.jl on my mac. The configuration fails with the error shown below. I can run configure successfully without the --with-blas and --with-lapack flags, but then make fails to compile ThirdParty/Mumps with the error "ld: symbol(s) not found for architecture i386".

Any help would be appreciated.

checking whether user supplied BLASLIB="/Users/ryangiordanonon-admin/.julia/v0.3/Ipopt/deps/usr/lib/libcoinblas.a -lgfortran" works... no
configure: error: user supplied BLAS library "/Users/ryangiordanonon-admin/.julia/v0.3/Ipopt/deps/usr/lib/libcoinblas.a -lgfortran" does not work
configure: error: /bin/sh './configure' failed for ThirdParty/Mumps
=========================================================================================[ ERROR: Ipopt ]=========================================================================================

failed process: Process(`./configure --prefix=/Users/ryangiordanonon-admin/.julia/v0.3/Ipopt/deps/usr coin_skip_warn_cxxflags=yes '--with-blas=/Users/ryangiordanonon-admin/.julia/v0.3/Ipopt/deps/usr/lib/libcoinblas.a -lgfortran' --with-lapack=/Users/ryangiordanonon-admin/.julia/v0.3/Ipopt/deps/usr/lib/libcoinlapack.a`, ProcessExited(1)) [1]
while loading /Users/ryangiordanonon-admin/.julia/v0.3/Ipopt/deps/build.jl, in expression starting on line 89

==================================================================================================================================================================================================

encourage use of MPB interface

We should discourage people from implementing Ipopt callbacks directly and instead point them to the MPB nonlinear interface.

Issue with Lapack build on PkgEval

INFO: Changing Directory to /vagrant/releaseAL/v0.3/Ipopt/deps/src/Ipopt-3.12.1/ThirdParty/Blas

Running script for downloading the source code for BLAS
... truncated ...
config.status: linking ../LAPACK/SRC/dtrevc.f to dtrevc.f
config.status: linking ../LAPACK/SRC/dtrexc.f to dtrexc.f
config.status: linking ../LAPACK/SRC/dtrti2.f to dtrti2.f
config.status: linking ../LAPACK/SRC/dtrtri.f to dtrtri.f
config.status: linking ../LAPACK/SRC/dtrtrs.f to dtrtrs.f
config.status: linking ../LAPACK/SRC/ieeeck.f to ieeeck.f
config.status: linking ../LAPACK/SRC/iladlc.f to iladlc.f
config.status: linking ../LAPACK/SRC/iladlr.f to iladlr.f
config.status: linking ../LAPACK/SRC/ilaenv.f to ilaenv.f
config.status: linking ../LAPACK/SRC/iparmq.f to iparmq.f
config.status: linking ../LAPACK/SRC/sgetf2.f to sgetf2.f
config.status: linking ../LAPACK/SRC/sgetrf.f to sgetrf.f
config.status: linking ../LAPACK/SRC/slaswp.f to slaswp.f
config.status: linking ../LAPACK/SRC/zgetf2.f to zgetf2.f
config.status: linking ../LAPACK/SRC/zgetrf.f to zgetrf.f
config.status: linking ../LAPACK/SRC/zlacgv.f to zlacgv.f
config.status: linking ../LAPACK/SRC/zlacpy.f to zlacpy.f
config.status: linking ../LAPACK/SRC/zlaev2.f to zlaev2.f
config.status: linking ../LAPACK/SRC/zlaswp.f to zlaswp.f
config.status: linking ../LAPACK/SRC/zpotf2.f to zpotf2.f
config.status: linking ../LAPACK/SRC/zrot.f to zrot.f
config.status: linking ../LAPACK/SRC/zsymv.f to zsymv.f
config.status: linking ../LAPACK/SRC/zsyr.f to zsyr.f
config.status: linking ../LAPACK/SRC/zsytri.f to zsytri.f
config.status: linking ../LAPACK/INSTALL/dlamch.f to dlamch.f
config.status: linking ../LAPACK/INSTALL/slamch.f to slamch.f
config.status: executing depfiles commands
configure: In case of trouble, first consult the troubleshooting page at https://projects.coin-or.org/BuildTools/wiki/user-troubleshooting
configure: Configuration of ThirdPartyLapack successful
INFO: Changing Directory to /vagrant/releaseAL/v0.3/Ipopt/deps/src/Ipopt-3.12.1/ThirdParty/Lapack/build
make: *** No rule to make target `dbdsqr.f', needed by `dbdsqr.lo'.  Stop.

Ideas? Missing dependency?

Getting ReadOnlyMemoryError

I am getting the following error with the new version.

julia> Pkg.test("Ipopt")
INFO: Testing Ipopt
ERROR: LoadError: LoadError: ReadOnlyMemoryError()
 in solveProblem(::Ipopt.IpoptProblem) at C:\Users\julia\AppData\Local\JuliaPro-
0.5.0.2\pkgs-0.5.0.2\v0.5\Ipopt\src\Ipopt.jl:304
 in include_from_node1(::String) at .\loading.jl:488 (repeats 2 times)
 in process_options(::Base.JLOptions) at .\client.jl:262
 in _start() at .\client.jl:318
while loading C:\Users\julia\AppData\Local\JuliaPro-0.5.0.2\pkgs-0.5.0.2\v0.5\Ip
opt\test\hs071_test.jl, in expression starting on line 118
while loading C:\Users\julia\AppData\Local\JuliaPro-0.5.0.2\pkgs-0.5.0.2\v0.5\Ip
opt\test\runtests.jl, in expression starting on line 5
================================[ ERROR: Ipopt ]================================


failed process: Process(`'C:\Users\julia\AppData\Local\JuliaPro-0.5.0.2\Julia-0.
5.0\bin\julia' -Cx86-64 '-JC:\Users\julia\AppData\Local\JuliaPro-0.5.0.2\Julia-0
.5.0\lib\julia\sys.dll' --compile=yes --depwarn=yes --check-bounds=yes --code-co
verage=none --color=yes --compilecache=yes 'C:\Users\julia\AppData\Local\JuliaPr
o-0.5.0.2\pkgs-0.5.0.2\v0.5\Ipopt\test\runtests.jl'`, ProcessExited(1)) [1]

================================================================================

ERROR: Ipopt had test errors
 in #test#61(::Bool, ::Function, ::Array{AbstractString,1}) at .\pkg\entry.jl:74
0
 in (::Base.Pkg.Entry.#kw##test)(::Array{Any,1}, ::Base.Pkg.Entry.#test, ::Array
{AbstractString,1}) at .\<missing>:0
 in (::Base.Pkg.Dir.##2#3{Array{Any,1},Base.Pkg.Entry.#test,Tuple{Array{Abstract
String,1}}})() at .\pkg\dir.jl:31
 in cd(::Base.Pkg.Dir.##2#3{Array{Any,1},Base.Pkg.Entry.#test,Tuple{Array{Abstra
ctString,1}}}, ::String) at .\file.jl:48
 in #cd#1(::Array{Any,1}, ::Function, ::Function, ::Array{AbstractString,1}, ::V
ararg{Array{AbstractString,1},N}) at .\pkg\dir.jl:31
 in (::Base.Pkg.Dir.#kw##cd)(::Array{Any,1}, ::Base.Pkg.Dir.#cd, ::Function, ::A
rray{AbstractString,1}, ::Vararg{Array{AbstractString,1},N}) at .\<missing>:0
 in #test#3(::Bool, ::Function, ::String, ::Vararg{String,N}) at .\pkg\pkg.jl:25
8
 in test(::String, ::Vararg{String,N}) at .\pkg\pkg.jl:258

Version:

julia> Pkg.status("Ipopt")
 - Ipopt                         0.2.6

Provider BinDeps.PackageManager failed to satisfy dependency libipopt Error on Pkg.build("Ipopt"), Mac OS X

Hi all,
I am new to julia and I am currently trying to use JuMP, and Ipopt in (Mac OS X yosemite 10.10.5) to solve my program. However I am unable to build Ipopt and need some assistance.

If I run Pkg.build("Ipopt") or Pkg.add("Ipopt") I get:

INFO: Building Ipopt
================================[ ERROR: Ipopt ]================================

LoadError: Provider BinDeps.PackageManager failed to satisfy dependency libipopt
while loading /Users/sungsooahn/.julia/v0.4/Ipopt/deps/build.jl, in expression starting on line 81
# 

====================================[ BUILD ERRORS ]====================================

WARNING: Ipopt had build errors.
- packages with build errors remain installed in /Users/sungsooahn/.julia/v0.4
- build the package(s) and all dependencies with `Pkg.build("Ipopt")`
- build a single package by running its `deps/build.jl` script
# 

INFO: Package database updated

So I tried building the single Ipopt package by running

$ julia /Users/sungsooahn/.julia/v0.4/Ipopt/deps/build.jl  

on command line and I then I will get:

ERROR: LoadError: Provider BinDeps.PackageManager failed to satisfy dependency libipopt
 in error at /Applications/Julia-0.4.6.app/Contents/Resources/julia/lib/julia/sys.dylib
 in satisfy! at /Users/sungsooahn/.julia/v0.4/BinDeps/src/dependencies.jl:804
 in satisfy! at /Users/sungsooahn/.julia/v0.4/BinDeps/src/dependencies.jl:781
 in anonymous at /Users/sungsooahn/.julia/v0.4/BinDeps/src/dependencies.jl:836
 in include at /Applications/Julia-0.4.6.app/Contents/Resources/julia/lib/julia/sys.dylib
 in include_from_node1 at /Applications/Julia-0.4.6.app/Contents/Resources/julia/lib/julia/sys.dylib
 in process_options at /Applications/Julia-0.4.6.app/Contents/Resources/julia/lib/julia/sys.dylib
 in _start at /Applications/Julia-0.4.6.app/Contents/Resources/julia/lib/julia/sys.dylib
while loading /Users/sungsooahn/.julia/v0.4/Ipopt/deps/build.jl, in expression starting on line 81

Can anyone help me with solving this problem for me? Thanks!

issues with exceptions thrown by Ipopt

This came out of debugging https://groups.google.com/forum/#!topic/julia-opt/J77CzzhNP4g, where JuMP was returning inf or NaN when evaluating a function for numerical reasons. Ipopt already has error handling for this case: https://projects.coin-or.org/Ipopt/browser/trunk/Ipopt/src/Algorithm/IpOrigIpoptNLP.cpp#L496 and throws an exception. (I confirmed that the macro is properly expanded and an exception is indeed thrown.) The C wrapper does seem to have code to catch and display exceptions, but it's never reached. Instead, I've seen two different behaviors:

  • On julianightlies PPA, a core dump occurs. Here's the backtrace:
Program received signal SIGABRT, Aborted.
0x00007ffff6892f79 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
56  ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0  0x00007ffff6892f79 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff6896388 in __GI_abort () at abort.c:89
#2  0x00007ffff5a25521 in _Unwind_Resume () from /lib/x86_64-linux-gnu/libgcc_s.so.1
#3  0x00007ffff1ec75b8 in Ipopt::OrigIpoptNLP::f (this=0x45c7dc0, x=...)
    at IpOrigIpoptNLP.cpp:499
#4  0x00007ffff1e7dbc8 in Ipopt::IpoptCalculatedQuantities::trial_f (this=0x53701e0)
    at IpIpoptCalculatedQuantities.cpp:612
#5  0x00007ffff1e7f153 in Ipopt::IpoptCalculatedQuantities::trial_barrier_obj (
    this=0x53701e0) at IpIpoptCalculatedQuantities.cpp:811
#6  0x00007ffff1e65274 in Ipopt::FilterLSAcceptor::CheckAcceptabilityOfTrialPoint (
    this=0x5371990, alpha_primal_test=1) at IpFilterLSAcceptor.cpp:307
#7  0x00007ffff1e51fb0 in Ipopt::BacktrackingLineSearch::DoBacktrackingLineSearch (
    this=0x5371ac0, skip_first_trial_point=false, alpha_primal=@0x7fffffffc568: 1, 
    corr_taken=@0x7fffffffc333: false, soc_taken=@0x7fffffffc334: false, 
    n_steps=@0x7fffffffc33c: 0, evaluation_error=@0x7fffffffc550: false, 
    actual_delta=...) at IpBacktrackingLineSearch.cpp:726
#8  0x00007ffff1e5074f in Ipopt::BacktrackingLineSearch::FindAcceptableTrialPoint (
    this=0x5371ac0) at IpBacktrackingLineSearch.cpp:462
#9  0x00007ffff1e72886 in Ipopt::IpoptAlgorithm::ComputeAcceptableTrialPoint (
    this=0x5371cf0) at IpIpoptAlg.cpp:542
#10 0x00007ffff1e71863 in Ipopt::IpoptAlgorithm::Optimize (this=0x5371cf0, 
    isResto=false) at IpIpoptAlg.cpp:346
#11 0x00007ffff1ddf759 in Ipopt::IpoptApplication::call_optimize (this=0x6042030)
    at IpIpoptApplication.cpp:882
#12 0x00007ffff1dde893 in Ipopt::IpoptApplication::OptimizeNLP (this=0x6042030, 
    nlp=..., alg_builder=...) at IpIpoptApplication.cpp:769
#13 0x00007ffff1dde591 in Ipopt::IpoptApplication::OptimizeNLP (this=0x6042030, 
    nlp=...) at IpIpoptApplication.cpp:732
#14 0x00007ffff1dde178 in Ipopt::IpoptApplication::OptimizeTNLP (this=0x6042030, 
    tnlp=...) at IpIpoptApplication.cpp:711
#15 0x00007ffff1de8cb8 in IpoptSolve (ipopt_problem=0x6041da0, x=0x4ece2d8, 
    g=0xc80b610, obj_val=0x53d3d00, mult_g=0x0, mult_x_L=0x0, mult_x_U=0x0, 
    user_data=0xb087df0) at IpStdCInterface.cpp:272
#16 0x00007ffff7e379a0 in ?? ()
#17 0x0000000000000000 in ?? ()
  • On julia built from source on the same machine, the exception seems to be just ignored and Ipopt continues to iterate.

Neither of these is the right behavior.
@tkelman, have you seen this before?
@Keno @vtjnash, is there any reason why C++ exceptions thrown inside a C wrapper called from Julia wouldn't work correctly?

Ipopt crash on a multiplication constraint

Ipopt crashes on this problem on OSX 64bit:

using JuMP
n = 5
m = Model()
@defVar(m, a[1:n] >= 0)
@defVar(m, b[1:n] >= 0)
@defVar(m, c >=0 )
@setObjective(m, :Min, c)
@addNLConstraint(m, test[i=1:n], a[i]*c >= b[i])

solve(m)

with exception:

dyld: lazy symbol binding failed: Symbol not found: _dmumps_c
  Referenced from: /usr/local/Cellar/ipopt/3.11.9_1/lib/libipopt.1.9.9.dylib
  Expected in: flat namespace

Can't construct unconstrained problems

I get the message ERROR: IPOPT: Failed to construct problem when I call createProblem without any constraints (see below). The error goes away if I add a constraint. Am I calling createProblem incorrectly for the unconstrained problem, or is this a bug?

julia> using Ipopt

julia> const A = randn(10);

julia> prob = createProblem(1, [-10.], [10.], 0, Float64[], Float64[], 1, 1,
           (x) -> sum(exp(x[1] .* A)),
           (x, g) -> println("shouldn't be called"),
           (x, grad_f) -> grad_f[1] = sum(exp(x[1] .* A) .* A),
           (x, mode, rows, cols, values) -> println("don't call me"),
           (x, mode, rows, cols, obj_factor, lambda, values) -> begin
               rows[1] = 1;
               cols[1] = 1;
               values[1]=sum(exp(x[1] .* A) .* A .* A)
           end)
ERROR: IPOPT: Failed to construct problem.
 in createProblem at /home/jeff/.julia/v0.3/Ipopt/src/Ipopt.jl:193

julia> prob = createProblem(1, [-10.], [10.], 1, Float64[-42.], Float64[42.], 1, 1,
           (x) -> sum(exp(x[1] .* A)),
           (x, g) -> println("shouldn't be called"),
           (x, grad_f) -> grad_f[1] = sum(exp(x[1] .* A) .* A),
           (x, mode, rows, cols, values) -> println("don't call me"),
           (x, mode, rows, cols, obj_factor, lambda, values) -> begin
               rows[1] = 1;
               cols[1] = 1;
               values[1]=sum(exp(x[1] .* A) .* A .* A)
           end)
IpoptProblem(Ptr{Void} @0x000000001b942510,1,1,[0.0],[0.0],[0.0],[0.0],[0.0],0.0,0,(anonymous function),(anonymous function),(anonymous function),(anonymous function),(anonymous function),nothing,:Min)

Ipopt Installation Julia 0.5 Mac

The Ipopt.jl build is failing on macOS Sierra, 10.12, with Julia 0.5. It cannot find a Fortran compiler:

configure: WARNING: Failed to find a Fortran compiler!

despite me installing Fortran at

which gfortran
/usr/local/bin/gfortran

I got gfortran 6.2 binaries from

http://hpc.sourceforge.net

Thanks for looking into this, Jeremy

Library issue

idunning@IAINLAPTOP:~/.../Ipopt/test$ julia hs071.jl 
Ptr{Void} @0x00000000047f1e70
Exception of type: OPTION_INVALID in file "IpAlgBuilder.cpp" at line 321:
 Exception message: Selected linear solver MA27 not available.
Tried to obtain MA27 from shared library "libhsl.so", but the following error occured:
libhsl.so: cannot open shared object file: No such file or directory

EXIT: Invalid option encountered.

Random Signal (6) error

Hello,

when I run the following code

using JuMP
using Ipopt

function optsol(h)
    K = length(h)
    m = Model(solver=IpoptSolver())
    @variable(m, b[1:K] >= 0.0)
    @variable(m, p[1:K] >= 0.0)
    @NLobjective(m, Min, sum{1/(1 + b[i]*log2(1 + p[i]*h[i]/b[i])), i=1:K})
    @constraint(m, sum{b[i], i=1:K} <= 1.0)
    @constraint(m, sum{p[i], i=1:K} <= 1.0)
    solve(m)
    return getobjectivevalue(m)
end

h = [0.6987929872130141,0.7408186408780297,0.03811105177144225,0.2786908564798465]
g = optsol(h)

the signal 6 error occurs

signal (6): Aborted
gsignal at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
abort at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
_Unwind_Resume at /lib/x86_64-linux-gnu/libgcc_s.so.1 (unknown line)
_ZN5Ipopt12OrigIpoptNLP1fERKNS_6VectorE at /home/nova/.julia/v0.4/Ipopt/deps/usr/lib/libipopt.so (unknown line)
_ZN5Ipopt25IpoptCalculatedQuantities7trial_fEv at /home/nova/.julia/v0.4/Ipopt/deps/usr/lib/libipopt.so (unknown line)
_ZN5Ipopt25IpoptCalculatedQuantities17trial_barrier_objEv at /home/nova/.julia/v0.4/Ipopt/deps/usr/lib/libipopt.so (unknown line)
_ZN5Ipopt16FilterLSAcceptor30CheckAcceptabilityOfTrialPointEd at /home/nova/.julia/v0.4/Ipopt/deps/usr/lib/libipopt.so (unknown line)
_ZN5Ipopt22BacktrackingLineSearch24DoBacktrackingLineSearchEbRdRbS2_RiS2_RNS_8SmartPtrINS_14IteratesVectorEEE at /home/nova/.julia/v0.4/Ipopt/deps/usr/lib/libipopt.so (unknown line)
_ZN5Ipopt22BacktrackingLineSearch24FindAcceptableTrialPointEv at /home/nova/.julia/v0.4/Ipopt/deps/usr/lib/libipopt.so (unknown line)
_ZN5Ipopt14IpoptAlgorithm8OptimizeEb at /home/nova/.julia/v0.4/Ipopt/deps/usr/lib/libipopt.so (unknown line)
_ZN5Ipopt16IpoptApplication13call_optimizeEv at /home/nova/.julia/v0.4/Ipopt/deps/usr/lib/libipopt.so (unknown line)
_ZN5Ipopt16IpoptApplication11OptimizeNLPERKNS_8SmartPtrINS_3NLPEEERNS1_INS_16AlgorithmBuilderEEE at /home/nova/.julia/v0.4/Ipopt/deps/usr/lib/libipopt.so (unknown line)
_ZN5Ipopt16IpoptApplication11OptimizeNLPERKNS_8SmartPtrINS_3NLPEEE at /home/nova/.julia/v0.4/Ipopt/deps/usr/lib/libipopt.so (unknown line)
_ZN5Ipopt16IpoptApplication12OptimizeTNLPERKNS_8SmartPtrINS_4TNLPEEE at /home/nova/.julia/v0.4/Ipopt/deps/usr/lib/libipopt.so (unknown line)
IpoptSolve at /home/nova/.julia/v0.4/Ipopt/deps/usr/lib/libipopt.so (unknown line)
solveProblem at /home/nova/.julia/v0.4/Ipopt/src/Ipopt.jl:290
optimize! at /home/nova/.julia/v0.4/Ipopt/src/IpoptSolverInterface.jl:122
solvenlp at /home/nova/.julia/v0.4/JuMP/src/nlp.jl:1232
Aborted (core dumped)

It seems that the error occurs only for some value of h.

Here are some extra infos:

Julia Version 0.4.5
Commit 2ac304d (2016-03-18 00:58 UTC)
Platform Info:
  System: Linux (x86_64-linux-gnu)
  CPU: Intel(R) Core(TM) i5-2520M CPU @ 2.50GHz
  WORD_SIZE: 64
  BLAS: libopenblas (NO_LAPACKE DYNAMIC_ARCH NO_AFFINITY Sandybridge)
  LAPACK: libopenblas
  LIBM: libopenlibm
  LLVM: libLLVM-3.8

 Ipopt    0.2.1
 JuMP  0.13.1

Installation Issue on Mac

I am a novice Julia user on all dimensions. Ipopt did not install properly on my Mac, for either 0.2.1 or 0.3 pre-release Julia binaries. Here is the output for 0.2.1:

julia> Pkg.add("Ipopt")
INFO: Cloning cache of Ipopt from git://github.com/JuliaOpt/Ipopt.jl.git
INFO: Cloning cache of MathProgBase from git://github.com/JuliaOpt/MathProgBase.jl.git
INFO: Installing Ipopt v0.0.0
INFO: Installing MathProgBase v0.1.6
INFO: Building Homebrew
HEAD is now at c588ffb Remove git rebasing code that slipped through
HEAD is now at 53d9d57 Bump coinmp bottle
INFO: Building Ipopt
==> Installing ipopt dependency: gfortran
==> Downloading http://archive.org/download/julialang/bottles/gfortran-4.8.2.mav

################################################################### 100.0%

==> Pouring gfortran-4.8.2.mavericks.bottle.tar.gz
🍺 /Users/jtfox/.julia/v0.2/Homebrew/deps/usr/Cellar/gfortran/4.8.2: 5 files, 3.4M
==> Installing ipopt
==> Downloading http://archive.org/download/julialang/bottles/ipopt-3.11.7.snow_

################################################################### 100.0%

==> Pouring ipopt-3.11.7.snow_leopard_or_later.bottle.1.tar.gz
🍺 /Users/jtfox/.julia/v0.2/Homebrew/deps/usr/Cellar/ipopt/3.11.7: 64 files, 5.6M
================================[ ERROR: Ipopt ]================================

Provider PackageManager failed to satisfy dependency libipopt
at /Users/jtfox/.julia/v0.2/Ipopt/deps/build.jl:61

================================[ BUILD ERRORS ]================================

WARNING: Ipopt had build errors.

  • packages with build errors remain installed in /Users/jtfox/.julia/v0.2
  • build a package and all its dependencies with Pkg.build(pkg)
  • build a single package by running its deps/build.jl script

INFO: REQUIRE updated.

Build error on OSX Yosemite

from the command line, brew install ipopt works just fine. but using the juliadeps tap:

$ brew install --force-bottle staticfloat/juliadeps/ipopt
==> Installing ipopt from staticfloat/homebrew-juliadeps
==> Downloading http://www.coin-or.org/download/source/Ipopt/Ipopt-3.11.8.tgz
Already downloaded: /Library/Caches/Homebrew/ipopt-3.11.8.tgz
==> cd ThirdParty/Blas; ./get.Blas
==> cd ThirdParty/Blas; ./configure --prefix=/usr/local/Cellar/ipopt/3.11.8 --di
checking for Fortran libraries of unavailable...
checking for dummy main to link with Fortran libraries... none
checking for Fortran name-mangling scheme... configure: error: cannot compile a simple Fortran program
See config.log' for more details. make: *** No rule to make targetinstall'. Stop.

READ THIS: https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Troubleshooting.md#troubleshooting
If reporting this issue please do so at (not Homebrew/homebrew):
https://github.com/staticfloat/homebrew-juliadeps/issues

32/64-bit switch isn't seamless on windows

When switching between 32- and 64-bit julia executables on Windows, Pkg.build("Ipopt") isn't sufficient to get the proper library set up. I had to manually clear deps/usr/lib and then run Pkg.build("Ipopt").

Ipopt installation fails behind a firewall

The build.jl script fails behind a firewall (when the required resources cannot be accessed). It will be nice if the required resources (the tgz files) can be be placed in a directory from which the installation can be performed. Similar to downloads/Ipopt-3.12.1.tgz.

Ipopt broken on JuliaBox?

Hi,
I'm using Ipopt package on Julia 0.4.2 on Juliabox. It seems that it always return the following error message. However the same setting on my local computer runs just fine. It's the same version of the Ipopt package (0.2.0). Thanks in advance for the help!

Exception of type: OPTION_INVALID in file "IpAlgBuilder.cpp" at line 321:
Exception message: Selected linear solver MA27 not available.
Tried to obtain MA27 from shared library "libhsl.so", but the following error occured:
libhsl.so: cannot open shared object file: No such file or directory

Chiwei

Build of Ipopt fails with Julia 0.4.6 and 0.6 on Linux openSUSE

Using:

julia> versioninfo()
Julia Version 0.6.0-dev.403
Commit f58aaef* (2016-08-25 07:12 UTC)
Platform Info:
  System: Linux (x86_64-suse-linux)
  CPU: Intel(R) Core(TM) i5-4460  CPU @ 3.20GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.7.1 (ORCJIT, haswell)

JuMP and AmplNLWriter install OK but then system calls for CoinOptServices and during build process Ipopt has a problem. Part of error output on retry build of Ipopt:

configure: Using libtool script in directory ../..
checking if library version is set... 6:2:5
checking for pkg-config... pkg-config
checking pkg-config is at least version 0.16.0... yes
checking whether user supplied BLASLIB="/home/colin/.julia/v0.6/Ipopt/deps/usr/lib/libcoinblas.a -lgfortran" works... no
configure: error: user supplied BLAS library "/home/colin/.julia/v0.6/Ipopt/deps/usr/lib/libcoinblas.a -lgfortran" does not work
configure: error: /bin/sh './configure' failed for ThirdParty/Mumps
=========================================[ ERROR: Ipopt ]==========================================

LoadError: failed process: Process(`./configure --prefix=/home/colin/.julia/v0.6/Ipopt/deps/usr coin_skip_warn_cxxflags=yes '--with-blas=/home/colin/.julia/v0.6/Ipopt/deps/usr/lib/libcoinblas.a -lgfortran' --with-lapack=/home/colin/.julia/v0.6/Ipopt/deps/usr/lib/libcoinlapack.a ''`, ProcessExited(1)) [1]
while loading /home/colin/.julia/v0.6/Ipopt/deps/build.jl, in expression starting on line 81

===================================================================================================

=========================================[ BUILD ERRORS ]==========================================

WARNING: Ipopt had build errors.

 - packages with build errors remain installed in /home/colin/.julia/v0.6
 - build the package(s) and all dependencies with `Pkg.build("Ipopt")`
 - build a single package by running its `deps/build.jl` script

===================================================================================================


Pkg.update() build error

Hey all,
If I run Pkg.update() I get:

INFO: Upgrading Ipopt: v0.1.6 => v0.1.7
INFO: Building Homebrew
HEAD is now at 9c255d7 wireshark devel 1.99.0
HEAD is now at f7418dd Bottle hwloc
INFO: Building Ipopt
Unlinking /Users/vishalgupta/.julia/v0.3/Homebrew/deps/usr/Cellar/ipopt/3.11.8... 57 symlinks removed
Warning: ipopt-3.11.8 already installed, it's just not linked
Linking /Users/vishalgupta/.julia/v0.3/Homebrew/deps/usr/Cellar/ipopt/3.11.8... 57 symlinks created
========================================================[ ERROR: Ipopt ]========================================================

Provider PackageManager failed to satisfy dependency libipopt
while loading /Users/vishalgupta/.julia/v0.3/Ipopt/deps/build.jl, in expression starting on line 81

========================================================[ BUILD ERRORS ]========================================================

WARNING: Ipopt had build errors.

  • packages with build errors remain installed in /Users/vishalgupta/.julia/v0.3
  • build a package and all its dependencies with Pkg.build(pkg)
  • build a single package by running its deps/build.jl script

Thoughts?

Pkg.add("Ipopt") -> Provider BuildProcess failed

I get the error message below, after maybe 5 or 10 minutes compiling, when I call Pkg.add("Ipopt"). I'm using Julia 0.34 on Linux Mint, and I had all the recommended Ubuntu packages installed before running Pkg.add("Ipopt").

=================[ ERROR: Ipopt]=====================
Provider BuildProcess failed to satisfy dependency libipopt
while loading /home/jeff/.julia/v0.3/Ipopt/deps/build.jl, in expression starting on line 81

=================[ BUILD ERRORS ]==================
WARNING: Ipopt had build errors.

  • packages with build errors remain installed in /home/jeff/.julia/v0.3
  • build the package(s) and all dependencies with Pkg.build("Ipopt")
  • build a single package by running its deps/build.jl script

InexactError() for large number of parameters and/or constraints

I am running large estimation problems using Ipopt and start receiving this error message when problems get too large:

julia> include("short_example.jl")
WARNING: Method definition fn(Any) in module Main at C:\Users\jkjun\Google Drive\short_example.jl:6 overwritten at C:\Users\jkjun\Google Drive\short_example.jl:6.
ERROR: LoadError: InexactError()
 in createProblem(::Int64, ::Array{Float64,1}, ::Array{Float64,1}, ::Int64, ::Array{Float64,1}, ::Array{Float64,1}, ::Int64, ::Int64, ::#fn, ::#fn, ::#fn, ::#fn, ::Void) at C:\Users\jkjun\.julia\v0.5\Ipopt\src\Ipopt.jl:185
 in createProblem(::Int64, ::Array{Float64,1}, ::Array{Float64,1}, ::Int64, ::Array{Float64,1}, ::Array{Float64,1}, ::Int64, ::Int64, ::#fn, ::#fn, ::#fn, ::#fn) at C:\Users\jkjun\.julia\v0.5\Ipopt\src\Ipopt.jl:171
 in include_from_node1(::String) at .\loading.jl:488
while loading C:\Users\jkjun\Google Drive\short_example.jl, in expression starting on line 18

EDIT: The code below produces the error. This problem is certainly meaningless, but it gets the point across without making anyone read the 400-line monster I attached earlier.

using Ipopt
function fn(x)
  return(x)
end
n = 10000
x_L = repmat([-20.0], n, 1)[:]
x_U = repmat([20.0], n, 1)[:]
x0 = repmat([0.0], n, 1)[:]
m = n - 2
g_L = zeros(m)
g_U = zeros(m)
prob = createProblem(n, x_L, x_U, m, g_L, g_U, m * n,
                      m * n^2,
                     fn, fn, fn, fn
                     )
addOption(prob, "hessian_approximation", "limited-memory")
prob.x = x0
status = solveProblem(prob)
println(Ipopt.ApplicationReturnStatus[status])
println(prob.x)
println(prob.obj_val)

Version info:

julia> versioninfo()
Julia Version 0.5.0
Commit 3c9d753 (2016-09-19 18:14 UTC)
Platform Info:
  System: NT (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i3-5015U CPU @ 2.10GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.7.1 (ORCJIT, broadwell)

Problem building

I thought I'd take this out for a spin, but ran into this:

julia> Pkg.build("Ipopt")
INFO: Building Ipopt
INFO: Attempting to Create directory /home/tim/.julia/v0.3/Ipopt/deps/downloads
INFO: Directory /home/tim/.julia/v0.3/Ipopt/deps/downloads already created
INFO: Downloading file http://www.coin-or.org/download/source/Ipopt/Ipopt-3.11.4.tgz
INFO: Done downloading file http://www.coin-or.org/download/source/Ipopt/Ipopt-3.11.4.tgz
INFO: Attempting to Create directory /home/tim/.julia/v0.3/Ipopt/deps/src
INFO: Directory /home/tim/.julia/v0.3/Ipopt/deps/src already created
INFO: Attempting to Create directory /home/tim/.julia/v0.3/Ipopt/deps
INFO: Directory /home/tim/.julia/v0.3/Ipopt/deps already created
INFO: Attempting to Create directory /home/tim/.julia/v0.3/Ipopt/deps/src/Ipopt-3.11.4
INFO: Directory /home/tim/.julia/v0.3/Ipopt/deps/src/Ipopt-3.11.4 already created
INFO: Changing Directory to /home/tim/.julia/v0.3/Ipopt/deps/src/Ipopt-3.11.4
can't find file to patch at input line 4
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff -ur Ipopt-3.11.4/Ipopt/src/Interfaces/Makefile.in Ipopt-3.11.4-new/Ipopt/src/Interfaces/Makefile.in
|--- Ipopt-3.11.4/Ipopt/src/Interfaces/Makefile.in      2013-06-14 10:32:46.000000000 -0400
|+++ Ipopt-3.11.4-new/Ipopt/src/Interfaces/Makefile.in  2013-10-01 12:18:49.997268379 -0400
--------------------------
File to patch:

I don't know what to enter here. I'm also a little puzzled about how little stuff is in src:

im@diva:~/.julia/v0.3/Ipopt/deps/src$ ls -R
.:
Ipopt-3.11.4

./Ipopt-3.11.4:
ThirdParty

./Ipopt-3.11.4/ThirdParty:
HSLold

./Ipopt-3.11.4/ThirdParty/HSLold:
CoinHslConfig.h            config_coinhsl_default.h  config.sub  configure.ac  INSTALL.HSL  ltmain.sh    Makefile.in
coinhsl-uninstalled.pc.in  config_coinhsl.h.in       configure   depcomp       install-sh   Makefile.am  missing

error "don't have function for random number generator"

g++ -DHAVE_CONFIG_H -I. -I. -O3 -pipe -DNDEBUG -pedantic-errors -Wparentheses -Wreturn-type -Wcast-qual -Wall -Wpointer-arith -Wwrite-strings -Wconversion -Wno-unknown-pragmas -Wno-long-long -DIPOPT_BUILD -MT IpUtils.lo -MD -MP -MF .deps/IpUtils.Tpo -c IpUtils.cpp  -fPIC -DPIC -o .libs/IpUtils.o
IpUtils.cpp:178:5: error: #error "don't have function for random number generator"
 #   error "don't have function for random number generator"
     ^
IpUtils.cpp:195:5: error: #error "don't have function for random number generator"
 #   error "don't have function for random number generator"
     ^
IpUtils.cpp: In function 'Ipopt::Number Ipopt::IpRandom01()':
IpUtils.cpp:182:3: warning: no return statement in function returning non-void [-Wreturn-type]
   }
   ^
make[2]: *** [IpUtils.lo] Error 1
make[2]: Leaving directory `/home/rick/.julia/v0.4/Ipopt/deps/src/Ipopt-3.11.7/Ipopt/src/Common'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/home/rick/.julia/v0.4/Ipopt/deps/src/Ipopt-3.11.7/Ipopt'
make: *** [install-recursive] Error 1
================================[ ERROR: Ipopt ]================================

failed process: Process(`make install`, ProcessExited(2)) [2]
while loading /home/rick/.julia/v0.4/Ipopt/deps/build.jl, in expression starting on line 81

================================================================================

================================[ BUILD ERRORS ]================================

WARNING: Ipopt had build errors.

 - packages with build errors remain installed in /home/rick/.julia/v0.4
 - build a package and all its dependencies with `Pkg.build(pkg)`
 - build a single package by running its `deps/build.jl` script

================================================================================
INFO: Package database updated

[PkgEval] Ipopt may have a testing issue on Julia 0.3 (2014-07-14)

PackageEvaluator.jl is a script that runs nightly. It attempts to load all Julia packages and run their tests (if available) on both the stable version of Julia (0.2) and the nightly build of the unstable version (0.3). The results of this script are used to generate a package listing enhanced with testing results.

On Julia 0.3

  • On 2014-07-12 the testing status was Tests pass.
  • On 2014-07-14 the testing status changed to Package doesn't load.

Tests pass. means that PackageEvaluator found the tests for your package, executed them, and they all passed.

Package doesn't load. means that PackageEvaluator did not find tests for your package. Additionally, trying to load your package with using failed.

This issue was filed because your testing status became worse. No additional issues will be filed if your package remains in this state, and no issue will be filed if it improves. If you'd like to opt-out of these status-change messages, reply to this message saying you'd like to and @IainNZ will add an exception. If you'd like to discuss PackageEvaluator.jl please file an issue at the repository. For example, your package may be untestable on the test machine due to a dependency - an exception can be added.

Test log:

INFO: Installing BinDeps v0.2.14
INFO: Installing Ipopt v0.1.1
INFO: Installing MathProgBase v0.2.1
INFO: Installing URIParser v0.0.2
INFO: Building Ipopt
INFO: Attempting to Create directory /home/idunning/pkgtest/.julia/v0.3/Ipopt/deps/downloads
INFO: Downloading file http://www.coin-or.org/download/source/Ipopt/Ipopt-3.11.7.tgz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0 4638k    0 37395    0     0   198k      0  0:00:23 --:--:--  0:00:23  197k
100 4638k  100 4638k    0     0  4664k      0 --:--:-- --:--:-- --:--:-- 4661k
INFO: Done downloading file http://www.coin-or.org/download/source/Ipopt/Ipopt-3.11.7.tgz
INFO: Attempting to Create directory /home/idunning/pkgtest/.julia/v0.3/Ipopt/deps/src
INFO: Attempting to Create directory /home/idunning/pkgtest/.julia/v0.3/Ipopt/deps
INFO: Directory /home/idunning/pkgtest/.julia/v0.3/Ipopt/deps already created
INFO: Attempting to Create directory /home/idunning/pkgtest/.julia/v0.3/Ipopt/deps/src/Ipopt-3.11.7
INFO: Changing Directory to /home/idunning/pkgtest/.julia/v0.3/Ipopt/deps/src/Ipopt-3.11.7
INFO: Changing Directory to /home/idunning/pkgtest/.julia/v0.3/Ipopt/deps/src/Ipopt-3.11.7/ThirdParty/Blas
INFO: Attempting to Create directory build
INFO: Changing Directory to /home/idunning/pkgtest/.julia/v0.3/Ipopt/deps/src/Ipopt-3.11.7/ThirdParty/Blas

..truncated..
================================[ ERROR: Ipopt ]================================

failed process: Process(`./get.Mumps`, ProcessExited(4)) [4]
while loading /home/idunning/pkgtest/.julia/v0.3/Ipopt/deps/build.jl, in expression starting on line 81

================================================================================

================================[ BUILD ERRORS ]================================

WARNING: Ipopt had build errors.

 - packages with build errors remain installed in /home/idunning/pkgtest/.julia/v0.3
 - build a package and all its dependencies with `Pkg.build(pkg)`
 - build a single package by running its `deps/build.jl` script

================================================================================
INFO: Package database updated
ERROR: Ipopt not properly installed. Please run Pkg.build("Ipopt")
 in error at error.jl:21
 in include at ./boot.jl:245
 in include_from_node1 at ./loading.jl:128
 in reload_path at loading.jl:152
 in _require at loading.jl:67
 in require at loading.jl:51
 in include at ./boot.jl:245
 in include_from_node1 at loading.jl:128
 in process_options at ./client.jl:285
 in _start at ./client.jl:354
while loading /home/idunning/pkgtest/.julia/v0.3/Ipopt/src/Ipopt.jl, in expression starting on line 6
while loading /home/idunning/pkgtest/.julia/v0.3/Ipopt/testusing.jl, in expression starting on line 1
INFO: Package database updated

Note this is possibly due to removal of deprecated functions in Julia 0.3-rc1: JuliaLang/julia#7609

Ipopt.jl: LibIpopt issues on Mac

I am just getting into using/learning Julia and I tired adding the IPOPT.jl package. It installed just fine but when I tried testing it.. it gave me a libipopt error :

Pkg.test("Ipopt")
INFO: Testing Ipopt
ERROR: LoadError: LoadError: UndefVarError: libipopt not defined
in createProblem at /Users/arora/.julia/v0.4/Ipopt/src/Ipopt.jl:182
in include at /Users/arora/CODES/Julia_source/julia/usr/lib/julia/sys.dylib
in include_from_node1 at /Users/arora/CODES/Julia_source/julia/usr/lib/julia/sys.dylib
in include at /Users/arora/CODES/Julia_source/julia/usr/lib/julia/sys.dylib
in include_from_node1 at loading.jl:129
in process_options at /Users/arora/CODES/Julia_source/julia/usr/lib/julia/sys.dylib
in _start at /Users/arora/CODES/Julia_source/julia/usr/lib/julia/sys.dylib
while loading /Users/arora/.julia/v0.4/Ipopt/test/hs071_test.jl, in expression starting on line 114
while loading /Users/arora/.julia/v0.4/Ipopt/test/runtests.jl, in expression starting on line 5

etc...

I also tried running the provided test examples, same result..

Any thoughts on how to go about fixing this issue? I have used IPOPT before but that was complied from source as I was programming in C, FORTRAN.

thanks a lot.

Segmentation fault when installing Ipopt.jl on OSX

Hi there,

I am trying to install Ipopt on OSX 10.11.3 but I get a segmentation fault. I have Julia installed via Homebrew but the same happens if I use the .dmg package.

My Julia version is the following

Julia Version 0.4.3
Commit a2f713d* (2016-01-12 21:37 UTC)
Platform Info:
  System: Darwin (x86_64-apple-darwin15.2.0)
  CPU: Intel(R) Core(TM) i7-4558U CPU @ 2.80GHz
  WORD_SIZE: 64
  BLAS: libopenblas (DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas
  LIBM: libopenlibm
  LLVM: libLLVM-3.3

This is the output I get from a clean Julia installation without any other packages installed.

julia> Pkg.add("Ipopt")
INFO: Installing BinDeps v0.3.21
INFO: Installing Compat v0.7.12
INFO: Installing Homebrew v0.2.0
INFO: Installing Ipopt v0.2.1
INFO: Installing JSON v0.5.0
INFO: Installing MathProgBase v0.4.2
INFO: Installing SHA v0.1.2
INFO: Installing URIParser v0.1.2
INFO: Building Homebrew
INFO: Recompiling stale cache file /Users/sidereus/.julia/lib/v0.4/Compat.ji for module Compat.
INFO: Recompiling stale cache file /Users/sidereus/.julia/lib/v0.4/JSON.ji for module JSON.
INFO: Recompiling stale cache file /Users/sidereus/.julia/lib/v0.4/BinDeps.ji for module BinDeps.
INFO: Recompiling stale cache file /Users/sidereus/.julia/lib/v0.4/URIParser.ji for module URIParser.
INFO: Recompiling stale cache file /Users/sidereus/.julia/lib/v0.4/SHA.ji for module SHA.
HEAD is now at c99e5c4 daemon: add 0.6.4 bottle.
HEAD is now at 4a13095 Merge pull request #85 from staticfloat/staging
INFO: Building Ipopt

signal (11): Segmentation fault: 11
unknown function (ip: 0x31c1d1e25)

signal (11): Segmentation fault: 11
unknown function (ip: 0x31c1d1e25)

signal (11): Segmentation fault: 11
unknown function (ip: 0x31c1d1e25)

signal (11): Segmentation fault: 11
unknown function (ip: 0x31c1d1e25)

signal (11): Segmentation fault: 11
unknown function (ip: 0x31c1d1e25)

signal (11): Segmentation fault: 11
unknown function (ip: 0x31c1d1e25)

signal (11): Segmentation fault: 11
unknown function (ip: 0x31c1d1e25)

and it goes on forever. Do you have any idea of what could cause the problem? I have seen that I get segmentation fault also when I run Pkg.build("Ipopt") or BinDeps.debug("Ipopt").

Build error on OSX

julia> Pkg.build("Ipopt")
INFO: Building Homebrew
HEAD is now at c588ffb Remove git rebasing code that slipped through
HEAD is now at b8b84ed Update hdf5 and szip
Uninstalling /Users/huchette/.julia/v0.3/Homebrew/deps/usr/Cellar/zeromq/3.2.4...
==> Downloading http://archive.org/download/julialang/bottles/zeromq-3.2.4.snow_
Already downloaded: /Users/huchette/Library/Caches/Homebrew.jl/zeromq-3.2.4.snow_leopard_or_later.bottle.1.tar.gz
==> Pouring zeromq-3.2.4.snow_leopard_or_later.bottle.1.tar.gz
 /Users/huchette/.julia/v0.3/Homebrew/deps/usr/Cellar/zeromq/3.2.4: 54 files, 2.3M
INFO: Building Ipopt
==> Downloading http://www.coin-or.org/download/source/Ipopt/Ipopt-3.11.5.tgz
Already downloaded: /Users/huchette/Library/Caches/Homebrew.jl//ipopt-3.11.5.tgz
==> cd ThirdParty/Mumps; ./get.Mumps
==> ./configure --prefix=/Users/huchette/.julia/v0.3/Homebrew/deps/usr/Cellar/ip
checking for Fortran libraries of unavailable... 
checking for dummy main to link with Fortran libraries... none
checking for Fortran name-mangling scheme... configure: error: cannot compile a simple Fortran program
See `config.log' for more details.
configure: error: /bin/sh './configure' failed for ThirdParty/HSLold

READ THIS: https://github.com/Homebrew/homebrew/wiki/troubleshooting
If reporting this issue please do so at (not Homebrew/homebrew):
  https://github.com/staticfloat/homebrew-juliadeps/issues

These open issues may also help:
Adding ipopt library v.3.9.2 (https://github.com/Homebrew/homebrew/pull/5281)
Adding ipopt library v.3.9.2 (https://github.com/Homebrew/homebrew/pull/5856)
ipopt does compile but fails at make test (https://github.com/Homebrew/homebrew/issues/13617)
================================[ ERROR: Ipopt ]================================

failed process: Process(`/Users/huchette/.julia/v0.3/Homebrew/deps/usr/bin/brew install staticfloat/juliadeps/ipopt`, ProcessExited(1)) [1]
while loading /Users/huchette/.julia/v0.3/Ipopt/deps/build.jl, in expression starting on line 62

================================================================================

================================[ BUILD ERRORS ]================================

WARNING: Ipopt had build errors.

 - packages with build errors remain installed in /Users/huchette/.julia/v0.3
 - build a package and all its dependencies with `Pkg.build(pkg)`
 - build a single package by running its `deps/build.jl` script

================================================================================

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.