Issue about installing Rmosek on windows

242 views
Skip to first unread message

Peian Lu

unread,
May 25, 2022, 12:34:47 AM5/25/22
to mosek
Dear Mosek people:

I've successfully installed the Rmosek packages and successfully used them following the guidance on https://docs.mosek.com/9.3/rmosek/install-interface.html. But after I accidentally solved another problem in VSCODE related to system permission by switching/changing/deleting the accounts( don't know what I did exactly, just follow the guidance), the solver 'MOSEK' seemed to be uninstalled instantly. When I tried to repeat the exact same procedure as before, I encountered the following errors when I used attachbuilder() and install.rmosek():the 
install.png
The following screenshot is the information about my mosek:
mosek_run.png
rversion.png
Could anyone tell me what mistakes I made or what extra information should I provide? The weird thing was, I have been running the codes, and suddenly the solver 'disappeared' (which asked me to install 'MOSEK' as I haven't installed it) even when I didn't close the Rstudio.
Sorry for occupying your time. I've failed to solve this problem after trying all kinds of solutions that can be found online.( I've tried to re-install the related software such as Rtool, Rstudio,R and MOSEK) 

Kindest regards,
Peian



Utkarsh Detha

unread,
May 25, 2022, 8:31:45 AM5/25/22
to mosek
Hi Peian,

I could reproduce the error. I am looking into the matter and will reach out as soon as I know more

Regards,
Utkarsh

Peian Lu

unread,
May 25, 2022, 3:44:22 PM5/25/22
to mosek
Hi  Utkarsh,

Sincerely thank you for your concern. Sorry to disturb you. Please let me know if I need to provide more information.

Kindest regards,
Peian 

Utkarsh Detha

unread,
May 25, 2022, 7:52:47 PM5/25/22
to mosek
Hi again,

This issue is most likely caused because windows cannot find the MOSEK dll. I will ask that you verify if the PATH variable in your system includes the MOSEK binary directory (something like "<MSKHOME>\mosek\9.3\tools\platform\<PLATFORM>\bin"). Once you have verified this, please attempt the Rmosek installation again.
 
You may also read the MOSEK installation guide (see the last point in the installation guides for windows).

I hope this helps, but please feel free to reach out again if it does not.

Thank you.

Regards,
Utkarsh

Peian Lu

unread,
May 26, 2022, 1:03:59 AM5/26/22
to mosek
Hi Utkarsh ,

This is the screenshot of my OS variable Path.
path.png
I think I've added it into the OS variable Path, and I've tried to strictly follow the path format(\mosek\9.3\tools\platform) by creating a new file called 'mosek' and putting the file '9.3' in. Tried to install different versions of mosek and installed it manually by setting up the environment variables(I think this is what 'builder.R' wrapper does). Tried to uninstall and install in different paths.
They all ended with that error.
Since I've succeeded before, I'm pretty sure I'm taking the same actions as before, including setting the environment variables. If there are some commands that I can try to test whether I've added correctly? The following screenshot is the output by 'attachbuilder()'.
attach_builder.png
Sorry for bothering you again. Thank you so much.

Kindest regards,
Peian

Utkarsh Detha

unread,
May 26, 2022, 9:17:32 AM5/26/22
to mosek
Hi,

As a final small suggestion, you should try installing MOSEK using the MSI installer (link to download win64 installer) and then restart your system before installing Rmosek in the usual fashion. You can see if the MOSEK binary directory is listed under PATH by issuing the command echo %PATH% in the command prompt. 

Regarding what "builder.R" does: it will set the variables that are used during the compilation of Rmosek. But, when loading the library, it is windows that needs to know where the MOSEK libraries are. That is done via the PATH variable.

If nothing has worked so far, then you can do the following to debug your issue:

1.) Install Rmosek like usual but turn off test loading in the final step, i.e. use the call install.rmosek(INSTALL_opts="--no-test-load"). This should then allow the installation to go through without any issues.
2.) Install WinDbg to your system (you only need WinDbg, so you can uncheck all the other options that will be suggested when installing Windows SDK).
3.) Open a command prompt, type C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\gflags /i Rterm.exe +sls. (gflags is usually installed on the path shown)
4.) Start an R session and get the associated process id by Sys.getpid()
5.) Launch WinDbg (found in the same folder as gflags), press F6 and type in the process id from the previous step. Type 'g' in the prompt that opens and press enter.
6.) Now, go back to the R session and try library(Rmosek) in the R process you started. This will lead to a library load failure (similar to what you have been seeing so far during your installation process). 
7.) Within the windbg prompt (from step 5), you will be able to see which DLL load failure was the culprit. 

Now, if the DLL that cannot be loaded turns out to be mosek64_9_3.dll, then it essentially means that MOSEK was not installed correctly in the first place. In any case, I ask that you share the output of step 7 above so that I can see if it is something I can help with.

I hope this helps.

Regards,
Utkarsh

Peian Lu

unread,
May 28, 2022, 2:15:04 AM5/28/22
to mosek
Hi  Utkarsh,

Here is my PATH
I've re-installed mosek from your blue link and set it in the following default path. Restarted the system.
path.png

After implementing your instructions from (1) to (7), I got the following output finally:
windb.png
Does it mean that the 'Rmosek.ddl' can't be loaded? 
Additionally, in R console, the error was the same as before (can't load Rmosek.ddl)
load_fail.png
I'm wondering whether it would be something related to license. Since all the things I did cause these to happen were some operations about changing system permission. Maybe what I've done was similar to deleting current administrator and then resetting another so that the mosek couldn't recognise me anymore? However, the 'msktestlic' command outputted that 'A license was checked out correctly.'

I sincerely appreciate your patient and detailed solution. I'm aware this is the final suggestion. If that's too tricky to deal with this problem, I can use Python version or Matlab to apply mosek package. Don't worry; I wouldn't want to bring you more troubles with such a basic installation problem.

Kindest regards,
Peian 

Utkarsh Detha

unread,
May 28, 2022, 5:44:17 AM5/28/22
to mosek
Hi,

This is unusual. Could I ask you to share the full log (preferably in a text file) of the WinDbg output to sup...@mosek.com
I would like to take a deeper look at this. 

Thank you for your patience. 

Regards,
Utkarsh

Peian Lu

unread,
May 28, 2022, 11:47:08 PM5/28/22
to mosek
Hi  Utkarsh

I have sent it to sup...@mosek.com. Thank you very much.

Kindest regards,
Peian 

Reply all
Reply to author
Forward
0 new messages