Skip to content

Conversation

@odow
Copy link
Member

@odow odow commented Nov 18, 2020

There are a lot of open issues relating to linear solvers with Ipopt. The installation instructions for this are non-existent, so here is an attempt. I don't have a Windows machine, so if people can chime in with instructions that work on Windows, that would be helpful.

The easiest way forward is almost certainly to use the Ipopt_jll binaries with the linear_solver loading. However, Ipopt hard-codes the library names, which causes most of the difficulties.

Here are solver/platform combinations I have tested and got working so far:

I have also updated the instructions for compiling a custom library. (#78, #197, #229 )

@codecov
Copy link

codecov bot commented Nov 18, 2020

Codecov Report

Merging #236 (5e4d6d1) into master (ec24b90) will increase coverage by 2.39%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #236      +/-   ##
==========================================
+ Coverage   79.30%   81.70%   +2.39%     
==========================================
  Files           3        3              
  Lines         836      858      +22     
==========================================
+ Hits          663      701      +38     
+ Misses        173      157      -16     
Impacted Files Coverage Δ
src/Ipopt.jl 85.59% <0.00%> (-0.74%) ⬇️
src/MOI_wrapper.jl 79.84% <0.00%> (+3.34%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ec24b90...5e4d6d1. Read the comment docs.

# Note: these filenames may differ. Check `/usr/lib/x86_64-linux-gnu` for the
# specific extension.
Libdl.dlopen("/usr/lib/x86_64-linux-gnu/liblapack.so.3", RTLD_GLOBAL)
Libdl.dlopen("/usr/lib/x86_64-linux-gnu/libomp.so.5", RTLD_GLOBAL)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If anyone has used Pardiso on linux without having to do this, I'm open to suggestions

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have to do this with the MKLPardiso package we have as well?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's how I got things working. But I could be completely off-base on getting things working:

(base) parallels@parallels-Parallels-Virtual-Platform:~/Documents/julia$ export LD_LIBRARY_PATH=/home/parallels/Documents/julia; ~/julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.5.2 (2020-09-23)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using Ipopt; const MOI = Ipopt.MOI; model = Ipopt.Optimizer(linear_solver="pardiso"); MOI.add_variable(model); MOI.optimize!(model)
Exception of type: OPTION_INVALID in file "IpAlgBuilder.cpp" at line 374:
 Exception message: Selected linear solver Pardiso not available.
Tried to obtain Pardiso from shared library "libpardiso.so", but the following error occured:
/home/parallels/Documents/julia/libpardiso.so: undefined symbol: _gfortran_concat_string

EXIT: Invalid option encountered.

julia> using Libdl; Libdl.dlopen("/usr/lib/x86_64-linux-gnu/liblapack.so.3", RTLD_GLOBAL)
Ptr{Nothing} @0x00000000037ad2f0

julia> using Ipopt; const MOI = Ipopt.MOI; model = Ipopt.Optimizer(linear_solver="pardiso"); MOI.add_variable(model); MOI.optimize!(model)
Exception of type: OPTION_INVALID in file "IpAlgBuilder.cpp" at line 374:
 Exception message: Selected linear solver Pardiso not available.
Tried to obtain Pardiso from shared library "libpardiso.so", but the following error occured:
/home/parallels/Documents/julia/libpardiso.so: undefined symbol: GOMP_parallel

EXIT: Invalid option encountered.

julia> Libdl.dlopen("/usr/lib/x86_64-linux-gnu/libomp.so.5", RTLD_GLOBAL)
Ptr{Nothing} @0x00000000024ff860

julia> using Ipopt; const MOI = Ipopt.MOI; model = Ipopt.Optimizer(linear_solver="pardiso"); MOI.add_variable(model); MOI.optimize!(model)


*************************************************************************** 
CONTAINS Runtime Modules of Parallel Sparse Linear Solver PARDISO Vers. 6.0
Copyright Universita della Svizzera Italiana 2000-2018 All Rights Reserved.

No PARDISO license file found.  Please see `http://www.pardiso-project.org
where to place the license file pardiso.lic 
*************************************************************************** 


*************************************************************************** 
CONTAINS Runtime Modules of Parallel Sparse Linear Solver PARDISO Vers. 6.0
Copyright Universita della Svizzera Italiana 2000-2018 All Rights Reserved.

No PARDISO license file found.  Please see `http://www.pardiso-project.org
where to place the license file pardiso.lic 
*************************************************************************** 


*************************************************************************** 
CONTAINS Runtime Modules of Parallel Sparse Linear Solver PARDISO Vers. 6.0
Copyright Universita della Svizzera Italiana 2000-2018 All Rights Reserved.

No PARDISO license file found.  Please see `http://www.pardiso-project.org
where to place the license file pardiso.lic 
*************************************************************************** 

******************************************************************************
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.13.2, running with linear solver pardiso.

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

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

iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls
   0  0.0000000e+00 0.00e+00 0.00e+00  -1.0 0.00e+00    -  0.00e+00 0.00e+00   0

Number of Iterations....: 0

                                   (scaled)                 (unscaled)
Objective...............:   0.0000000000000000e+00    0.0000000000000000e+00
Dual infeasibility......:   0.0000000000000000e+00    0.0000000000000000e+00
Constraint violation....:   0.0000000000000000e+00    0.0000000000000000e+00
Complementarity.........:   0.0000000000000000e+00    0.0000000000000000e+00
Overall NLP error.......:   0.0000000000000000e+00    0.0000000000000000e+00


Number of objective function evaluations             = 1
Number of objective gradient evaluations             = 1
Number of equality constraint evaluations            = 0
Number of inequality constraint evaluations          = 0
Number of equality constraint Jacobian evaluations   = 0
Number of inequality constraint Jacobian evaluations = 0
Number of Lagrangian Hessian evaluations             = 0
Total CPU secs in IPOPT (w/o function evaluations)   =      0.277
Total CPU secs in NLP function evaluations           =      0.045

EXIT: Optimal Solution Found.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get the same issue, even if I add libpardiso.so to /opt and don't modify LD_LIBRARY_PATH.

@odow
Copy link
Member Author

odow commented Nov 23, 2020

Merging as-is since this is better than no instructions. We can revise the instructions for each solver in separate PRs, and I'll make an issue to track the overall status.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants