Rmosek installation problem on Windows x64 system

524 views
Skip to first unread message

Henrik Alsing Friberg

unread,
May 1, 2012, 2:49:18 AM5/1/12
to mo...@googlegroups.com

The following question deserved its own thread:
https://groups.google.com/d/msg/mosek/mZO-4JybmTY/Tybt_K4Lbf0J


Hi Henrik,

I am not sure whether you are familiar with Rmosek in Windows x64 system.

I wanna install Rmosek in my windows computer, I got mosek installed and tested (it works as I typed mosek -f in command line), I got R 2.14.2 as well as R tools, but when I install the package Rmosk in R by typing: install.packages("Rmosek", type="source", INSTALL_opts="--no-multiarch")
,

 I got the following errors from R:

将程序包安装入‘C:/Users/linmusoccer/Documents/R/win-library/2.14’
(因为‘lib’没有被指定)
试开URL’http://cran.stat.sfu.ca/src/contrib/Rmosek_1.2.2.tar.gz'
Content type 'application/x-gzip' length 431308 bytes (421 Kb)
打开了URL
downloaded 421 Kb


* installing *source* package 'Rmosek' ...
** 成功将'Rmosek'程序包解包并MD5和检查
Configuring for the Windows platform (sub-architecture: "/x64")
cygwin warning:
  MS-DOS style path detected: C:/PROGRA~1/R/R-214~1.2/bin/Rscript
  Preferred POSIX equivalent is: /cygdrive/c/PROGRA~1/R/R-214~1.2/bin/Rscript
  CYGWIN environment variable option "nodosfilewarning" turns off this warning.
  Consult the user's guide for more details about POSIX paths:
    http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
Found package 'Matrix' version 1.0.5
Guessed variable definitions from command 'mosek' in Windows CMD
Using MOSEK home directory: C:\Program Files\Mosek\6\tools\platform\win64x86
Using MOSEK library: mosek64_6_0
Configuration done.
** libs
警告: this package has a non-empty 'configure.win' file,
so building only the main architecture

cygwin warning:
  MS-DOS style path detected: C:/PROGRA~1/R/R-214~1.2/etc/x64/Makeconf
  Preferred POSIX equivalent is: /cygdrive/c/PROGRA~1/R/R-214~1.2/etc/x64/Makeconf
  CYGWIN environment variable option "nodosfilewarning" turns off this warning.
  Consult the user's guide for more details about POSIX paths:
    http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
g++ -m64 -I"C:/PROGRA~1/R/R-214~1.2/include" -IC:/Program\ Files/Mosek/6/tools/platform/win64x86/h   -I"C:/Users/linmusoccer/Documents/R/win-library/2.14/Matrix/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -mtune=core2 -c Rmosek.cc -o Rmosek.o
Rmosek.cc:1:0: sorry, unimplemented: 64-bit mode not compiled in
compatibility/fallbacks.h:56:19: warning: 'MSK4::Matrix_DimSym' defined but not used
compatibility/fallbacks.h:57:19: warning: 'MSK4::Matrix_iSym' defined but not used
compatibility/fallbacks.h:58:19: warning: 'MSK4::Matrix_jSym' defined but not used
compatibility/fallbacks.h:59:19: warning: 'MSK4::Matrix_xSym' defined but not used
compatibility/fallbacks.h:60:19: warning: 'MSK4::Matrix_uploSym' defined but not used
compatibility/fallbacks.h:61:19: warning: 'MSK4::Matrix_diagSym' defined but not used
make: *** [Rmosek.o] Error 1
ERROR: compilation failed for package 'Rmosek'
* removing 'C:/Users/linmusoccer/Documents/R/win-library/2.14/Rmosek'

下载的程序包在
        ‘C:\Users\linmusoccer\AppData\Local\Temp\RtmpuSiBjY\downloaded_packages’里
警告信息:
1: 运行命令'C:/PROGRA~1/R/R-214~1.2/bin/x64/R CMD INSTALL -l "C:/Users/linmusoccer/Documents/R/win-library/2.14"   C:\Users\LINMUS~1\AppData\Local\Temp\RtmpuSiBjY/downloaded_packages/Rmosek_1.2.2.tar.gz'的状态是1
2: In install.packages("Rmosek", type = "source") :
  安装程序包‘Rmosek’时退出狀態的值不是0

I am sorry that my system language is chinese, but as you can read, the most important information (Configuration is done but still some errors after that) above is english, I also tried the manual configuration from http://r-forge.r-project.org/scm/viewvc.php/*checkout*/pkg/inst/doc/userguide.pdf?root=rmosek, but I cannnot get Rmosek installed either.

I really appretiate if you could help me over this problem, any suggestions or hints will be helpful:)

Thank you very much!

Henrik Alsing Friberg

unread,
May 1, 2012, 3:14:06 AM5/1/12
to mo...@googlegroups.com

Thank you for your question.

Yes, I have tested Rmosek on Windows x64 so it should be functional. I find the generated warnings interesting, and will look into that, but am also pretty certain that the warnings have nothing to do with the installation failure. What instead caught my eye was these lines:


g++ -m64 -I"C:/PROGRA~1/R/R-214~1.2/include" -IC:/Program\ Files/Mosek/6/tools/platform/win64x86/h   -I"C:/Users/linmusoccer/Documents/R/win-library/2.14/Matrix/include" -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -mtune=core2 -c Rmosek.cc -o Rmosek.o
Rmosek.cc:1:0: sorry, unimplemented: 64-bit mode not compiled in

Searching the web for the error "sorry, unimplemented: 64-bit mode not compiled in" led me, among other sites, to this:
http://r.789695.n4.nabble.com/Problems-when-building-a-package-for-Windows-64-td4464488.html

On that thread it helped to use Rtools v2.15, for R 2.14.2.. If this does not help, please verify that the g++ command used, is actually the g++ program from the Rtools installation folder. To do so, open your windows command prompt and type "where g++".

Kind regards,
Henrik Alsing Friberg

l...@ualberta.ca

unread,
May 1, 2012, 2:45:00 PM5/1/12
to mo...@googlegroups.com
Hi Henrik,

Thank you for you quick reply!

I noticed the R compatibility problem with Rtools, so now, I changed to R 2.13.2 and Rtools 2.13 and I re-installed the mosek and used the free acdemic license I got from mosek support.

I installed mosek first, test the license (work correctly) and type: mosek -f in command line, everything looks good and I noticed the operating system variables:

MOSEKLM_LICENSE_FILE : C:\Program Files\Mosek\6\Licenses\mosek.lic

PATH

c:\Rtools\bin
c:\Rtools\MinGW\bin
c:\Rtools\MinGW64\bin
C:\Program Files\Mosek\6\Licenses\mosek.lic
c:\Rtools\bin

c:\Rtools\MinGW\bin
c:\Rtools\MinGW64\bin
C:\Program Files\Mosek\6\Licenses\mosek.lic

So my first question is that whether is PATH is right or not? If it is not, how do I set those PATHs in order to make Rmosek work?

Then I installed R 2.13.2 and Rtools 2.13,

I tried in R with install.packages("Rmosek", type="source", INSTALL_opts="--no-multiarch") and it gives me
:


将程序包安装入‘C:/Users/linmusoccer/Documents/R/win-library/2.13’

(因为‘lib’没有被指定)
试开URL’http://cran.stat.sfu.ca/src/contrib/Rmosek_1.2.2.tar.gz'
Content type 'application/x-gzip' length 431308 bytes (421 Kb)
打开了URL
downloaded 421 Kb

* installing *source* package 'Rmosek' ...
Configuring for the Windows platform (sub-architecture: "/x64")
cygwin warning:
  MS-DOS style path detected: C:/PROGRA~1/R/R-213~1.2/bin/Rscript
  Preferred POSIX equivalent is: /cygdrive/c/PROGRA~1/R/R-213~1.2/bin/Rscript

  CYGWIN environment variable option "nodosfilewarning" turns off this warning.
  Consult the user's guide for more details about POSIX paths:
    http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
Found package 'Matrix' version 1.0.4
where: not found
*** No variable 'PKG_MOSEKHOME' in environment ***
*** No variable 'PKG_MOSEKHOME' in ./src/setup/x64/Localsys.txt file ***
*** Windows CMD command 'mosek' was not recognized - please validate your installation of MOSEK ***
***   >> PATH=/cygdrive/c/PROGRA~1/R/R-213~1.2/bin/x64:/usr/bin:/MinGW/bin:/MinGW64/bin:/cygdrive/c/Program Files/Mosek/6/tools/platform/win64x86/bin:/usr/bin:/MinGW/bin:/MinGW64/bin:/cygdrive/c/Program Files/Mosek/6/tools/platform/win64x86/bin ***
ERROR: configuration failed for package 'Rmosek'
* removing 'C:/Users/linmusoccer/Documents/R/win-library/2.13/Rmosek'

下载的程序包在
        ‘C:\Users\linmusoccer\AppData\Local\Temp\RtmpvtmSDj\downloaded_packages’里
警告信息:
1: 运行命令'C:/PROGRA~1/R/R-213~1.2/bin/x64/R CMD INSTALL --no-multiarch -l "C:/Users/linmusoccer/Documents/R/win-library/2.13"   C:\Users\LINMUS~1\AppData\Local\Temp\RtmpvtmSDj/downloaded_packages/Rmosek_1.2.2.tar.gz'的状态是1
2: In install.packages("Rmosek", type = "source", INSTALL_opts = "--no-multiarch") :
  安装程序包'Rmosek'时退出狀態的值不为0


What is this problem? It seems to be different from what I posted earlier. especially,  this part:

where: not found
*** No variable 'PKG_MOSEKHOME' in environment ***
*** No variable 'PKG_MOSEKHOME' in ./src/setup/x64/Localsys.txt file ***
*** Windows CMD command 'mosek' was not recognized - please validate your installation of MOSEK ***
***   >> PATH=/cygdrive/c/PROGRA~1/R/R-213~1.2/bin/x64:/usr/bin:/MinGW/bin:/MinGW64/bin:/cygdrive/c/Program Files/Mosek/6/tools/platform/win64x86/bin:/usr/bin:/MinGW/bin:/MinGW64/bin:/cygdrive/c/Program Files/Mosek/6/tools/platform/win64x86/bin ***
ERROR: configuration failed for package 'Rmosek'
* removing 'C:/Users/linmusoccer/Documents/R/win-library/2.13/Rmosek'

Dose it mean that my mosek installation have some problem?

I also tried manual configuration following the three steps from uesrguide, which I thought should solve the errors, but the R gives me the same outputs(errors)  as above.!

Sorry for so many questions, thanks for you patience and help.



Mu Lin


在 2012年5月1日星期二UTC-6上午1时14分06秒,Henrik Alsing Friberg写道:

Henrik Alsing Friberg

unread,
May 2, 2012, 3:54:15 AM5/2/12
to mo...@googlegroups.com

Hi Mu,

I am truly sorry if the userguide have been misleading in any way, but if that is the only content of your PATH variable I believe you have overwritten system definitions that need to be there. Before you had:

Guessed variable definitions from command 'mosek' in Windows CMD
Using MOSEK home directory: C:\Program Files\Mosek\6\tools\platform\win64x86
Using MOSEK library: mosek64_6_0

And now you have:

where: not found
*** No variable 'PKG_MOSEKHOME' in environment ***
*** No variable 'PKG_MOSEKHOME' in ./src/setup/x64/Localsys.txt file ***

This tells me that the "where.exe" program, recognized earlier, could no longer be located on your computer. If you have not changed computer, my guess is that you have removed the location of "where.exe" from your PATH variable. On my computer this program is located in C:\Windows\System32, and if this is also correct on your computer, the location C:\Windows\System32 should be added to your PATH variable. Remember to separate each location with a semicolon. Your PATH variable could look something like below, enabling respectively: Rtools commands, Windows commands, R commands and MOSEK commands:


c:\Rtools\bin;
c:\Rtools\MinGW\bin;
c:\Rtools\MinGW64\bin;
C:\Windows;
C:\Windows\System32;
C:\Windows\System32\Wbem;
C:\Windows\System32\WindowsPowerShell\v1.0;
C:\Program Files\R\R-2.13.2\bin;
C:\Program Files\Mosek\6\6\tools\platform\win64x86\bin;

JUST AN EXAMPLE, NOT NECESSARILY HOW YOUR PATH VARIABLE SHOULD LOOK LIKE!

Notice that the "mosek.lic" file does not have to be part of the PATH variable, as this location is read from the MOSEKLM_LICENSE_FILE variable. To edit these variables (called environment variables) from Windows 7: Control Panel / System / Advance System Settings / Advanced tab / Environment Variables button. In the lower part of the Environment Variables window, select Path. Then click Edit.

You may have to logout/login to your computer in order to make the changes work. Try to call "where mosek" from the command prompt without changing directory. This should verify whether the "where.exe" program can be automatically located or not..

PS. I am not certain that stepping back to R 2.13.2 is the best solution, but lets see how it goes when you have restored your PATH variable.


Kind regards,
Henrik Alsing Friberg


Mu Lin

unread,
May 2, 2012, 8:45:09 PM5/2/12
to mo...@googlegroups.com
Hi Henrik:

Thank you very much! Your suggestions really works this time, after adding those PATH variables, Rmosek works in my computer.

My choice of Rtools 2.13 and R 2.13.2 is fine, for others who might have the compatibility problem as I had at the first time, my suggestion is that do not use the  R version R >2.14.1 to R 2.15.x in windows at this time.

If people did that, they need to use Rtools 2.15 for R compatibility, but when I use Rtools 2.15, I clearly remembered when I installed it, there are packages like: R toolset, the Cygwin DLLs, but there is no option to install MinGW compilers, which is a required package for Rmosek to work. The missing package here could cause another problem when you installed Rmosek in R.

So using lower version of Rtools like Rtools 2.14 or 2.13 should be fine, and one can choose the corresponding version of R for R compatibility with Rtools.

Anyway, thank you very much for your expert help with this Rmosek question.

Best wishes!

Sincerely,

Mu Lin

l...@ualberta.ca

unread,
May 2, 2012, 8:48:18 PM5/2/12
to mo...@googlegroups.com
Hi Henrik:

Thank you very much! Your suggestions really works this time, after adding those PATH variables, Rmosek works in my computer.

My choice of Rtools 2.13 and R 2.13.2 is fine, for others who might have the compatibility problem as I had at the first time, my suggestion is that do not use the  R version R >2.14.1 to R 2.15.x in windows at this time.

If people did that, they need to use Rtools 2.15 for R compatibility, but when I use Rtools 2.15, I clearly remembered when I installed it, there are packages like: R toolset, the Cygwin DLLs, but there is no option to install MinGW compilers, which is a required package for Rmosek to work. The missing package here could cause another problem when you installed Rmosek in R.

So using lower version of Rtools like Rtools 2.14 or 2.13 should be fine, and one can choose the corresponding version of R for R compatibility with Rtools.

Anyway, thank you very much for your expert help with this Rmosek question.

Best wishes!

Sincerely,

Mu Lin


在 2012年5月2日星期三UTC-6上午1时54分15秒,Henrik Alsing Friberg写道:

Henrik Alsing Friberg

unread,
May 3, 2012, 3:04:27 AM5/3/12
to mo...@googlegroups.com

Dear Mu,

Thank you for pointing out that the new Rtools no longer have MinGW. I now see that the installation manual in my userguide needs to be updated..! Note, however, that I managed to get R 2.15.0 (build 2012-03-30) to work with Rtools version 2.15.0.1919 (not frozen) in 64bit mode on a 64bit Windows. The following steps assumes that you already have locations to the "where.exe" and "mosek.exe" in your PATH variable as shown in my previous post.

I first uninstalled previously installed R and Rtools.
I then installed R with components: "Core Files", "32-bit Files" and "64-bit Files".
I then installed Rtools with components: "R toolset", "Cygwin DLLs" and "R 2.15.x toolchain".

During the installation of Rtools the following locations where added to the beginning of my PATH variable:
c:\Rtools\bin;c:\Rtools\gcc-4.6.3\bin;

Opening "R x64" (NOT "i386"), and typing
install.packages("Rmosek", type="source")

Did the job for me.. For people on Windows XP and earlier the "where.exe" command does not exists, and so a manual configuration is necessary (described in the userguide). I hope this will help you and other users get the most out of R. Feel free to come back and ask me again if you wish to upgrade to a newer R and have problems doing so..


Kind regards,
Henrik Alsing Friberg


Reply all
Reply to author
Forward
0 new messages