Issues with Mosek in JuMP

231 views
Skip to first unread message

georgina.ha...@gmail.com

unread,
Jun 19, 2019, 2:04:29 PM6/19/19
to mosek
Hello,

I am trying to use Mosek in JuMP and it is not working for me.

I have:
- added the licence to the correct path C://Users/user_name/mosek
- gone into the system environment variables and checked they are all pointing to the right thing
- made sure to install Mosek 64 and Julia 64
- initialized ENV["MOSEKBINDIR"]="C:\\Program Files\\Mosek\\9.0\\tools\\platform\\win64x86\\bin" in Julia
 
and yet I still get the same issue (see the output below).

What should I do?

Thanks,
Georgina


Error: Error building `Mosek`: 
│ [ Info: get version
│ [ Info: mosekbin = mosek.exe
│ ┌ Info: res = 
│ │ MOSEK Version 9.0.94 (Build date: 2019-6-13 09:54:28)
│ │ Copyright (c) MOSEK ApS, Denmark. WWW: mosek.com
│ │ Platform: Windows/64-X86
│ │ 
│ │ 
│ │ *** No input file specfied. No optimization is performed.
│ │ 
│ └ Return code - 0  [MSK_RES_OK]
│ ERROR: LoadError: MOSEKBINDIR (C:\Program Files\Mosek\9.0\tools\platform\win64x86\bin) does not point to a MOSEK bin directory


Erling D. Andersen

unread,
Jun 19, 2019, 2:09:21 PM6/19/19
to mosek
Someone with knowledge about Julia will get back tomorrow. Everybody is home now here.

wfl...@gmail.com

unread,
Jun 20, 2019, 3:42:37 AM6/20/19
to mosek
Hi,

I can see that the issue is on out side. Basically, when installing it is looking for a MOSEK 8.1, which is why it says that MOSEKBINDIR does not contain the valid binaries. 

I have made a new release that should fix the issue. Usually releases get accepted fairly quickly, so it should be available within a day. Alternatively, you can check out v1.0.0 manually.


On Wednesday, 19 June 2019 20:09:21 UTC+2, Erling D. Andersen wrote:
Someone with knowledge about Julia will get back tomorrow. Everybody is home now here.

Georgina Hall

unread,
Jun 20, 2019, 12:51:28 PM6/20/19
to mo...@googlegroups.com
Thanks! Given that it's quite urgent - I uninstalled MOSEK 9.0 and installed MOSEK 8.1 instead to try and sort out this issue. I still get an error nevertheless (see below). Am I doing something wrong? I am using Mosek 8.1 now and have reaffected my MOSEKBINDIR variable to 8.1 instead of 9.0. I'll give your new release a shot tomorrow as well. Just wanted to check with you given that 8.1 is not working either.

Thanks ever so much
Georgina

 Error: Error building `Mosek`: 
│ [ Info: get version
│ [ Info: mosekbin = mosek.exe
│ ERROR: LoadError: Failed to get MOSEK download host
│ Stacktrace:
│  [1] error(::String) at .\error.jl:33
│  [2] top-level scope at C:\Users\georgina\.julia\packages\Mosek\vBHcL\deps\build.jl:155
│  [3] include at .\boot.jl:326 [inlined]
│  [4] include_relative(::Module, ::String) at .\loading.jl:1038
│  [5] include(::Module, ::String) at .\sysimg.jl:29
│  [6] include(::String) at .\client.jl:403
│  [7] top-level scope at none:0
│ in expression starting at C:\Users\georgina\.julia\packages\Mosek\vBHcL\deps\build.jl:110
└ @ Pkg.Operations C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Pkg\src\Operations.jl:1075

--
You received this message because you are subscribed to the Google Groups "mosek" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mosek+un...@googlegroups.com.
To post to this group, send email to mo...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mosek/073d2714-9469-4e88-88b9-9637eaf76aa8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

wfl...@gmail.com

unread,
Jun 21, 2019, 4:06:00 AM6/21/19
to mosek
I can reproduce the error, and I'm looking into why the build fails. I am fairly sure you are not doing anything wrong.

You can try to simply not set the MOSEKBINDIR and let the installer fetch and install the MOSEK binaries. This works for me. 

I will post when I have a fix for the build problem.
To unsubscribe from this group and stop receiving emails from it, send an email to mo...@googlegroups.com.

Georgina Hall

unread,
Jun 21, 2019, 8:17:07 AM6/21/19
to mosek
Thanks very much. I tried removing the package by doing Pkg.rm("Mosek") and then adding it on again Pkg.add("Mosek"). When I do "using Mosek" I still get an error however. I did not set the MOSEKBINDIR variable this time round and when I type in "ENV["MOSEKBINDIR"]" I get the error:

KeyError: key "MOSEKBINDER" not found
Stacktrace:
 [1] (::getfield(Base, Symbol("##434#435")))(::String) at .\env.jl:76
 [2] access_env(::getfield(Base, Symbol("##434#435")), ::String) at .\env.jl:14
 [3] getindex(::Base.EnvDict, ::String) at .\env.jl:76 
[4] top-level scope at In[10]:1


When I try Mosek.build, I get the usual error of course.

How did you do this: "You can try to simply not set the MOSEKBINDIR and let the installer fetch and install the MOSEK binaries. This works for me."?

Thanks again, I really appreciate the help!
Georgina

wfl...@gmail.com

unread,
Jun 21, 2019, 8:17:07 AM6/21/19
to mosek
I have not been able to figure out what the issue is beyond it being a mismatch between the MOSEK version installed and the one expected by Mosek.jl. I have added some debugging information to the build scripts that will hopefully provide a bit extra info.

wfl...@gmail.com

unread,
Jun 21, 2019, 1:19:23 PM6/21/19
to mosek
I am not sure what the problem is.  May I ask you to try this:

In the Julia prompt type ']' to enter package mode. Here type "add Mosek#b1.0-msk9.0" to switch to Mosek.jl for mosek 9.0. Still in package mode do "build Mosek". It should fetch the MOSEK binaries automatically. Errors should be more explicit now.

Georgina Hall

unread,
Jun 25, 2019, 4:18:06 PM6/25/19
to mosek
Sorry for the delay in getting back to you!

I tried what you asked - except that now I have Mosek 8.1 installed (this is what I switched to when I had the version error in the hopes it might fix it) so I slightly modified it to make it work with 8.1 (I hope that's okay). So I typed in:

add Mosek#b1.0-msk8.1

and got the error

ERROR: git object b1.0-msk8.1 could not be found"

Any ideas as to why this happens?

Thanks a lot!
Georgina

wfl...@gmail.com

unread,
Jun 26, 2019, 4:26:40 AM6/26/19
to mosek
I should have given that name too. Just to make things completely incomprehensible you have to use
add Mosek#b0.9
for version 8.1

Georgina Hall

unread,
Jun 26, 2019, 8:45:18 AM6/26/19
to mosek
Still get an error :(

Error: Error building `Mosek`:
│ File C:\Users\georgina\.julia\packages\Mosek\8UVwM\deps\winget.ps1 cannot be loaded because running scripts is
│ disabled on this system. For more information, see about_Execution_Policies at
│     + CategoryInfo          : SecurityError: (:) [], ParentContainsErrorRecordException
│     + FullyQualifiedErrorId : UnauthorizedAccess
│ [ Info: get version
│ [ Info: mosekbin = mosek.exe
│ [ Info: Download cmd = `powershell -file 'C:\Users\georgina\.julia\packages\Mosek\8UVwM\deps\winget.ps1' https://www.mosek.com/downloads/default_dns.txt 'C:\Users\georgina\.julia\packages\Mosek\8UVwM\deps\downloads\downloadhostname'`
│ ERROR: LoadError: failed process: Process(`powershell -file 'C:\Users\georgina\.julia\packages\Mosek\8UVwM\deps\winget.ps1' https://www.mosek.com/downloads/default_dns.txt 'C:\Users\georgina\.julia\packages\Mosek\8UVwM\deps\downloads\downloadhostname'`, ProcessExited(1)) [1]
│ Stacktrace:
│  [1] error(::String, ::Base.Process, ::String, ::Int64, ::String) at .\error.jl:42
│  [2] pipeline_error at .\process.jl:785 [inlined]
│  [3] #run#515(::Bool, ::Function, ::Cmd) at .\process.jl:726
│  [4] run(::Cmd) at .\process.jl:724
│  [5] top-level scope at C:\Users\georgina\.julia\packages\Mosek\8UVwM\deps\build.jl:158
│  [6] include at .\boot.jl:326 [inlined]
│  [7] include_relative(::Module, ::String) at .\loading.jl:1038
│  [8] include(::Module, ::String) at .\sysimg.jl:29
│  [9] include(::String) at .\client.jl:403
│  [10] top-level scope at none:0
│ in expression starting at C:\Users\georgina\.julia\packages\Mosek\8UVwM\deps\build.jl:111
└ @ Pkg.Operations C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.1\Pkg\src\Operations.jl:1075


Is this my computer?

Thanks a lot!
Georgina

Ulf Worsoe

unread,
Jun 26, 2019, 8:55:56 AM6/26/19
to mo...@googlegroups.com
That's an error i have not seen before! But that explains at least the last issue. We use powershell in the build step (to download and unpack).

If you now set the Mosekbindir as you initially did, what do you get?

To unsubscribe from this group and stop receiving emails from it, send an email to mosek+un...@googlegroups.com.

To post to this group, send email to mo...@googlegroups.com.

Georgina Hall

unread,
Jun 26, 2019, 9:35:37 AM6/26/19
to mosek
OMG it worked!! Thank you so much! 

I've managed to solve my very first JuMP model with Mosek :)

Thanks again!
Georgina

On Wednesday, June 26, 2019 at 1:55:56 PM UTC+1, Ulf Worsoe wrote:
That's an error i have not seen before! But that explains at least the last issue. We use powershell in the build step (to download and unpack).

If you now set the Mosekbindir as you initially did, what do you get?

Xuekui wang

unread,
Oct 18, 2021, 5:57:26 AM10/18/21
to mosek
HELLO,
when I was building Mosek, there are these erros.

what should I do?

Thanks,
Wangxk

julia> Pkg.build("Mosek")
    Building Mosek → `C:\Users\Lenovo\.julia\scratchspaces\44cfe95a-1eb2-52ea-b672-e2afdf69b78f\883be630ab4a25991037c2a2079d7170a5a8908e\build.log`
ERROR: Error building `Mosek`: 
┌ Info:
│ MOSEK Version 9.3.7 (Build date: 2021-10-11 10:42:47)
│ Copyright (c) MOSEK ApS, Denmark. WWW: mosek.com
│ Platform: Windows/64-X86
│ *** No input file specfied. No optimization is performed.
└ Return code - 0  [MSK_RES_OK]
[ Info: Got version: 9.3.7, expected version: 9.2
ERROR: LoadError: MOSEKBINDIR (D:\Program Files\Mosek\9.3\tools\platform\win64x86\bin) does not point to a MOSEK bin directory
Stacktrace:
 [1] error(s::String)
   @ Base .\error.jl:33
 [2] top-level scope
   @ C:\Users\Lenovo\.julia\packages\Mosek\6LuE3\deps\build.jl:150
 [3] include(fname::String)
   @ Base.MainInclude .\client.jl:444
 [4] top-level scope
   @ none:5
in expression starting at C:\Users\Lenovo\.julia\packages\Mosek\6LuE3\deps\build.jl:144
Stacktrace:
  [1] pkgerror(msg::String)
    @ Pkg.Types C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\Types.jl:55
  [2] (::Pkg.Operations.var"#82#87"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec})()
    @ Pkg.Operations C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\Operations.jl:1048
  [3] withenv(::Pkg.Operations.var"#82#87"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec}, ::Pair{String, String}, ::Vararg{Pair{String, B} where B, N} where N)
    @ Base .\env.jl:161
  [4] (::Pkg.Operations.var"#109#113"{String, Pkg.Operations.var"#82#87"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec}, Pkg.Types.PackageSpec})()
    @ Pkg.Operations C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\Operations.jl:1546
  [5] with_temp_env(fn::Pkg.Operations.var"#109#113"{String, Pkg.Operations.var"#82#87"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec}, Pkg.Types.PackageSpec}, temp_env::String)
    @ Pkg.Operations C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\Operations.jl:1448
  [6] (::Pkg.Operations.var"#108#112"{Pkg.Operations.var"#82#87"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec}, Pkg.Types.Context, Pkg.Types.PackageSpec, String, Pkg.Types.Project, String})(tmp::String)
    @ Pkg.Operations C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\Operations.jl:1521
  [7] mktempdir(fn::Pkg.Operations.var"#108#112"{Pkg.Operations.var"#82#87"{Bool, Pkg.Types.Context, String, Pkg.Types.PackageSpec}, Pkg.Types.Context, Pkg.Types.PackageSpec, String, Pkg.Types.Project, String}, parent::String; prefix::String)
    @ Base.Filesystem .\file.jl:729
  [8] mktempdir(fn::Function, parent::String) (repeats 2 times)
    @ Base.Filesystem .\file.jl:727
  [9] sandbox(fn::Function, ctx::Pkg.Types.Context, target::Pkg.Types.PackageSpec, target_path::String, sandbox_path::String, sandbox_project_override::Pkg.Types.Project)
    @ Pkg.Operations C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\Operations.jl:1487
 [10] build_versions(ctx::Pkg.Types.Context, uuids::Vector{Base.UUID}; verbose::Bool)
    @ Pkg.Operations C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\Operations.jl:1029
 [11] build(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}, verbose::Bool)
    @ Pkg.Operations C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\Operations.jl:910
 [12] build(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; verbose::Bool, kwargs::Base.Iterators.Pairs{Symbol, Base.TTY, Tuple{Symbol}, NamedTuple{(:io,), Tuple{Base.TTY}}})
    @ Pkg.API C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\API.jl:900
 [13] build(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Pkg.API C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\API.jl:80
 [14] build(pkgs::Vector{Pkg.Types.PackageSpec})
    @ Pkg.API C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\API.jl:78
 [15] #build#71
    @ C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\API.jl:76 [inlined]
 [16] build
    @ C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\API.jl:76 [inlined]
 [17] #build#70
    @ C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\API.jl:75 [inlined]
 [18] build(pkg::String)
    @ Pkg.API C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src\API.jl:75
 [19] top-level scope
    @ REPL[7]:1

Ulf Worsoe

unread,
Oct 18, 2021, 6:47:28 AM10/18/21
to mosek
The head revision should solve the problem. I can see that it should have been released, but apparently the release publication failed. Until I have resolved that you will have to check out the latest revision of branch `b1.2-msk9.3`.

Xuekui wang

unread,
Oct 18, 2021, 8:26:02 AM10/18/21
to mosek
thanks very much. I have tried 9.1, it failed.
then, I will try 9.2.
But when I add b1.1-msk9.3, there are errors as follows.

(@v1.6) pkg> add Mosek#b1.1-msk9.3
ERROR: Did not find rev b1.1-msk9.3 in repository

Xuekui wang

unread,
Oct 18, 2021, 8:26:02 AM10/18/21
to mosek
I have tried adding   b1.2-msk9.3.
they are all ok.
thanks very much, this problem has troubled me for many days.

在2021年10月18日星期一 UTC+8 下午6:47:28<Ulf Worsoe> 写道:
Reply all
Reply to author
Forward
0 new messages