-
Notifications
You must be signed in to change notification settings - Fork 58
Update README with linear solver instructions #236
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
| # 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) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.There was a problem hiding this comment.
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.
|
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. |
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_jllbinaries with thelinear_solverloading. 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 )