rmosek install question

746 views
Skip to first unread message

Roger Koenker

unread,
Oct 20, 2011, 8:45:30 AM10/20/11
to mosek, rkoe...@illinois.edu
I've just discovered the rmosek package on r-forge. As a long time
user of Mosek (usually via R.matlab
and Mosek's matlab interface) I'm naturally eager to try it out. My
initial attempt to install on
$platform [1] "x86_64-apple-darwin9.8.0" with R 2.14.... got almost
all the way to the end, but then



* DONE (Matrix)
* installing *source* package 'rmosek' ...
Configuring for a UNIX-alike platform (sub-architecture: "/x86_64")
Guessed variable definitions from shell command 'mosek'
*** Variable 'PKG_MOSEKLIB' was not found here ***
ERROR: configuration failed for package 'rmosek'
* removing '/Users/roger/Library/R/2.14/library/rmosek'

I have mosek in /usr/local/bin but don't have PKG_MOSEKLIB set. Any
advice would be most welcome.

Thanks,
Roger

Henrik Alsing Friberg

unread,
Oct 24, 2011, 3:34:31 AM10/24/11
to mosek
At this state of development the rmosek package have only been tested
on Linux and Windows systems, but I will start working on support for
Macintosh systems now. Hopefully you wont have to wait long..

In the mean time I can inform you that the following line means: auto-
configuration was attempted and found a program called mosek on the
PATH.
>> Guessed variable definitions from shell command 'mosek'

Since auto-configuration then fails, the user could instead try to
perform a manual configuration where the two variables PKG_MOSEKHOME
and PKG_MOSEKLIB are set as "configure.vars" in the install.packages()
command. Please consult the userguide section 1.2 on manual
configuration for more information about this, and ask if this causes
any issues.

Henrik Alsing Friberg

Henrik Alsing Friberg

unread,
Oct 28, 2011, 3:26:05 AM10/28/11
to mosek
Support have now been added to the Apple-Darwin platform, giving
Macintosh users a chance to try the rmosek package. The last couple of
CRAN mirrors should be fully updated in a few hours, but you can
already get the source package version 0.9.3 or newer from most
repositories.

Note that if auto-configuration still fails, you should try to execute
the following command from the R Console:
>> Sys.getenv("PATH")

This list should include a "/bin" directory from a valid MOSEK
installation, and the first such "/bin" directory should point to a
platform consistent with the R Console (e.g. ...../platform/osx64x86/
bin for 64 bit R, or ...../platform/osx32x86/bin for 32 bit R).

Best regards,
Henrik Alsing Friberg

Roger Koenker

unread,
Oct 30, 2011, 5:32:42 PM10/30/11
to mosek
I'm still having trouble with the specification of the PKG_MOSEKHOME
and PKG_MOSEKLIB. I thought that my setup was fairly standard. There
is an executable mosek in /usr/local/bin and libraries in /usr/local/
lib:

yzzy: cd /usr/local/lib
yzzy: ls *mosek*
libmosek.6.0.dylib libmoseknoomp.6.0.dylib
libmosek.dylib libmoseknoomp.dylib
libmosekglb.6.0.dylib libmosekxx6_0.dylib
libmosekglbnoomp.6.0.dylib

I tried a couple of variants without any success, could you tell me
how
to specify these?

Henrik Alsing Friberg

unread,
Oct 31, 2011, 5:40:16 AM10/31/11
to mo...@googlegroups.com
With that setup my best guess is that you are using symbolic links..
Is this correct?
With revision 36 on R-forge, the configure-script have been updated to
recognize and follow symbolic links. However, the revision will not be
on the nightly build (repos="http://R-Forge.R-project.org") until
tomorrow, and it may take yet another day for it to reach CRAN. On my
test system I had the MOSEK "/bin" directory added to the variables
PATH and DYLD_LIBRARY_PATH in the ~/.MacOSX/environment.plist file
which is another possibility.


For a manual configuration, the PKG_MOSEKHOME variable must be the
platform-specific path to a folder in your MOSEK installation
containing a "/bin" and a "/h" subdirectory. That is, if you have the
executable
"~/mosek/6/tools/platform/osx64x86/bin/mosek"
... then set,
PKG_MOSEKHOME="~/mosek/6/tools/platform/osx64x86/"

Furthermore, the PKG_MOSEKLIB should be the name (without prefix and
extension) to optimization library you wish to utilize. That is, if
you which to utilize the library
"~/mosek/6/tools/platform/osx64x86/bin/libmosek64.dylib"
... then set,
PKG_MOSEKLIB="mosek64"

See the userguide section 1.2 on manual configuration for more
details. The link to the newest version of the userguide is available
on the r-forge project homepage:
http://rmosek.r-forge.r-project.org/


Please tell me if this solves your problem, and if not, specify your
MOSEK installation, the commands you have tried and the resulting
output..

Thank you for your patience,
Henrik Alsing Friberg

Roger Koenker

unread,
Oct 31, 2011, 9:34:14 AM10/31/11
to mosek
That got me a bit further along. I put this in ./src/setup/x86_64/
Localsys.txt

PKG_MOSEKHOME=/usr/local/mosek/6/tools/platform/osx32x86
PKG_MOSEKLIB=mosekxx6_0

Then there was a bit of compiling and this warning....

g++-4.2 -arch x86_64 -dynamiclib -Wl,-headerpad_max_install_names -
undefined dynamic_lookup -single_module -multiply_defined suppress -L/
usr/local/lib -o rmosek.so local_stubs.o msg_system.o rmosek.o -L/usr/
local/mosek/6/tools/platform/osx32x86/bin -lmosekxx6_0 -F/Library/
Frameworks/R.framework/.. -framework R -Wl,-framework -
Wl,CoreFoundation
ld: warning: in /usr/local/lib/libmosekxx6_0.dylib, file was built for
i386 which is not the architecture being linked (x86_64)
installing to /Users/roger/Library/R/2.14/library/rmosek/libs/x86_64

suggesting that there would be trouble ahead, and then I see:

** R
** inst
** preparing package for lazy loading
Loading required package: lattice

Attaching package: 'Matrix'

The following object(s) are masked from 'package:base':

det

** help
*** installing help indices
** building package indices ...
** testing if installed package can be loaded
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/Users/roger/Library/R/2.14/library/
rmosek/libs/x86_64/rmosek.so':
dlopen(/Users/roger/Library/R/2.14/library/rmosek/libs/x86_64/
rmosek.so, 6): Symbol not found: _MSK_append
Referenced from: /Users/roger/Library/R/2.14/library/rmosek/libs/
x86_64/rmosek.so
Expected in: flat namespace
in /Users/roger/Library/R/2.14/library/rmosek/libs/x86_64/rmosek.so
Error: loading failed
Execution halted
ERROR: loading failed


I might speculate at this point, but this probably isn't worthwhile,
better to let you read the tea leaves.

Thanks for your help,
Roger



On Oct 31, 4:40 am, Henrik Alsing Friberg

Henrik Alsing Pedersen

unread,
Nov 1, 2011, 9:14:03 AM11/1/11
to mosek
First of all, I would like to apologize for any inconvenience it may
bring you that the package have now changed name from "rmosek" to
"Rmosek". That being said, I think you should give the automatic
configuration in the nightly build of Rmosek a try once you have read
my guidelines below. The repository is called http://R-Forge.R-project.org,
and the package can be installed with the following command. Soon this
package will be on CRAN too.
install.packages("Rmosek", repos="http://R-Forge.R-project.org",
type="source")

--- Guidelines ---
However, you should be careful about the architectures of the R-
console and MOSEK installation as these should always match. If you
want to link to a 32 bit MOSEK installation (osx32x86), as your
settings suggested:
PKG_MOSEKHOME=/usr/local/mosek/6/tools/platform/osx32x86
PKG_MOSEKLIB=mosekxx6_0

... you will have to perform the installation from a 32 bit R-console
(i386). Doing so, of course, implies that you can only use the Rmosek
package from this 32 bit R-console. To also use the Rmosek package
from the 64 bit R-console (x86_64), you will have to make a separate
installation of Rmosek from this 64 bit R-console, this time linking
to a 64 bit MOSEK installation (osx64x86).

In fact, I believe this concern is what the compiler warns about in
the output you sent me..
-----------------------------------------
ld: warning: in /usr/local/lib/libmosekxx6_0.dylib,
file was built for i386 which is not the architecture being linked
(x86_64)
-----------------------------------------

Let me know if that helped..

Kind regards,
Henrik Alsing Friberg

Roger Koenker

unread,
Nov 12, 2011, 4:35:03 PM11/12/11
to mosek
Yes, this now works perfectly as you suggest for the 32 version.
Thanks very
much for your help. Can you give us any estimate of when mskscopt or
its
equivalent might be incorporated? Apologies for the delay in my
response on
this.

On Nov 1, 7:14 am, Henrik Alsing Pedersen <metronw...@gmail.com>
wrote:
> First of all, I would like to apologize for any inconvenience it may
> bring you that the package have now changed name from "rmosek" to
> "Rmosek". That being said, I think you should give the automatic
> configuration in the nightly build of Rmosek a try once you have read
> my guidelines below. The repository is calledhttp://R-Forge.R-project.org,

nabi...@ualberta.ca

unread,
Mar 27, 2014, 1:22:40 PM3/27/14
to mo...@googlegroups.com, rogerk...@gmail.com
Hi there,

I am trying to install Rmosek, on R 3.0.3 and windows 8, but it the error is:

Installing package into ‘C:/Users/Majid/Documents/R/win-library/3.0’
(as ‘lib’ is unspecified)
* installing *source* package 'Rmosek' ...
** package 'Rmosek' successfully unpacked and MD5 sums checked
Warning: running command 'sh ./configure.win' had status 127
ERROR: configuration failed for package 'Rmosek'
* removing 'C:/Users/Majid/Documents/R/win-library/3.0/Rmosek'
Warning messages:
1: running command '"C:/PROGRA~1/R/R-30~1.3/bin/i386/R" CMD INSTALL -l "C:\Users\Majid\Documents\R\win-library\3.0" "Rmosek_1.2.5.1.tar.gz"' had status 1 
2: In install.packages("Rmosek_1.2.5.1.tar.gz", repos = NULL, type = "source") :
  installation of package ‘Rmosek_1.2.5.1.tar.gz’ had non-zero exit status

Thank you for help.

Henrik Alsing Friberg

unread,
Mar 27, 2014, 1:52:14 PM3/27/14
to mo...@googlegroups.com, rogerk...@gmail.com, nabi...@ualberta.ca
Hi there.

You should definitely post a new question in a new thread, to avoid confusing me or others users looking to find solutions of already answered questions. While you do this, I will try to locate the problem. My guess is that it is related to windows 8, as I haven't tried it on this platform..

Kind regards,
Henrik.
Reply all
Reply to author
Forward
0 new messages