Skip to content
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

HSL linear solver on windows and admin privileges #192

Closed
MartaVanin opened this issue Apr 10, 2020 · 2 comments
Closed

HSL linear solver on windows and admin privileges #192

MartaVanin opened this issue Apr 10, 2020 · 2 comments

Comments

@MartaVanin
Copy link

MartaVanin commented Apr 10, 2020

Hello,
I would like to use the HSL MA27 as linear solver in Ipopt. I managed to have it working on linux but now I am trying to get it on a Windows 10 Pro machine.
I installed MinGw and Ipopt3.12.10, and got the license from HSL, then performed these steps:

  1. On a MinGw shell I do $cd /c/ipopt/ThirdParty, and for each Blas,Lapack,Metis,Mumps I go in their sub-folder and run from there “./get.Metis,Mumps, etc.
  2. I get ma27-1.0.0.tar.gz, untar and rename ma27d.f in ma27ad.f and place it in ThirdParty/HSL.
  3. from the MinGw terminal I do
    $cd /c/ipopt/
    $mkdir build
    $cd build
    $../configure
    $make
    $make install
    

I think all the steps should be correct, so I open a julia repl and set the env variables:

ENV["JULIA_IPOPT_EXECUTABLE_PATH"] = "C:/ipopt/build/include"
ENV["JULIA_IPOPT_LIBRARY_PATH"] = "C:/ipopt/build/lib"

but if I build it I get an error:

┌ Error: Error building `Ipopt`:
│ ┌ Warning: On Windows, creating file symlinks requires Administrator privileges
│ └ @ Base.Filesystem file.jl:797
│ ERROR: LoadError: Could not install custom libraries from C:/ipopt/build/lib and 
 C:/ipopt/build/include.
│ To fall back to BinaryProvider call delete!(ENV,"JULIA_IPOPT_LIBRARY_PATH");delete!(ENV,"JULIA_IPOPT_EXECUTABLE_PATH") and run build again.
│ Stacktrace:
│  [1] error(::String) at .\error.jl:33
│  [2] top-level scope at C:\Users\mvanin\.julia\packages\Ipopt\ruIXY\deps\build.jl:63
│  [3] include at .\boot.jl:328 [inlined]
│  [4] include_relative(::Module, ::String) at .\loading.jl:1094
│  [5] include(::Module, ::String) at .\Base.jl:31
│  [6] include(::String) at .\client.jl:431
│  [7] top-level scope at none:5in expression starting at C:\Users\mvanin\.julia\packages\Ipopt\ruIXY\deps\build.jl:57
│ caused by [exception 1]
│ IOError: symlink: operation not permitted (EPERM)
│ Stacktrace:
│  [1] uv_error at .\libuv.jl:90 [inlined]
│  [2] symlink(::String, ::String) at .\file.jl:800
│  [3] probe_symlink_creation(::String) at C:\Users\mvanin\.julia\packages\BinaryProvider\kcGxO\src\PlatformEngines.jl:121
│  [4] #probe_platform_engines!#30(::Bool, ::typeof(BinaryProvider.probe_platform_engines!)) at C:\Users\mvanin\.julia\packages\BinaryProvider\kcGxO\src\PlatformEngines.jl:175
│  [5] probe_platform_engines! at C:\Users\mvanin\.julia\packages\BinaryProvider\kcGxO\src\PlatformEngines.jl:169 [inlined]
│  [6] __init__() at C:\Users\mvanin\.julia\packages\BinaryProvider\kcGxO\src\BinaryProvider.jl:28
│  [7] _include_from_serialized(::String, ::Array{Any,1}) at .\loading.jl:685
│  [8] _require_search_from_serialized(::Base.PkgId, ::String) at .\loading.jl:765
│  [9] _require(::Base.PkgId) at .\loading.jl:990
│  [10] require(::Base.PkgId) at .\loading.jl:911
│  [11] require(::Module, ::Symbol) at .\loading.jl:906
│  [12] include at .\boot.jl:328 [inlined]
│  [13] include_relative(::Module, ::String) at .\loading.jl:1094
│  [14] include(::Module, ::String) at .\Base.jl:31
│  [15] include(::String) at .\client.jl:431
│  [16] top-level scope at none:5
└ @ Pkg.Operations C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.2\Pkg\src\backwards_compatible_isolation.jl:647

I have no admin rights problem installing any other julia package, in general, so this is a specific issue.

@donboyd5
Copy link

Hi,

This is way outside my expertise, but for what it's worth, I tore my hair out trying to install Ipopt with HSL routines on Windows for use from within R and finally got it to work, with help from Tony Kellman and Stefan Vigerske. You may have found my notes on this already; they may be relevant for part of your installation.

As I recall, a key mysterious step for me with HSL was the following, quoted from my linked notes, with 2 typo corrections in [square brackets]:

(a) getting Ipopt source code per instructions, and
(b) extracting the HSL source to a directory that I renamed to hslcoin [should read coinhsl] and
placed under the HSL directory in ThirdParty (resulting in
<ipot[ipopt]>/3.12/ThirdParty/HSL/coinhsl) per the HSL README

Anyway, after following the steps in my notes, I did finally compile the HSL routines successfully on a Windows machine and was able to use them with R. Perhaps the notes will be of use to you.

I copy below a screenshot of the directory structure that ultimately was successful

image

Thanks.

Don

@odow odow added the LINALG Codes Relates to linear algebra codes (HSL etc.) label May 26, 2020
@odow odow added Linear Solver: HSL and removed LINALG Codes Relates to linear algebra codes (HSL etc.) labels Nov 18, 2020
@odow
Copy link
Member

odow commented Nov 23, 2020

The original issue is that the executable path should not point to include, it should point to the directory containing the AMPL binary. #236 added some better instructions on this front, including how to download the executable if you cannot compile it.

However, it is not necessary to compile Ipopt to use MA27. You can use the linear_solver loading feature: https://github.com/jump-dev/Ipopt.jl#hsl-ma27. Unfortunately, I don't have a Windows machine to test, so I'm not sure if there are extra steps.

I'm going to close this issue in favor of #247. Please post there if the instructions are still insufficient.

@odow odow closed this as completed Nov 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants