Skip to content

Instantly share code, notes, and snippets.

@qinwf
Forked from jeroen/readme.md
Last active August 29, 2015 14:18
Show Gist options
  • Save qinwf/5ec4ea0e4557c2eeef28 to your computer and use it in GitHub Desktop.
Save qinwf/5ec4ea0e4557c2eeef28 to your computer and use it in GitHub Desktop.

R on Solaris

By Jeroen Ooms, April 2015. Suggestions welcome.

VirtualBox Image: http://bit.ly/r-solaris
Username: root
Password: solaris11

You must accept the OTN License Agreement for Oracle Solaris and Oracle Solaris Studio OTN Developer License Agreement to download this software.

What is this

A VirtualBox image of Solaris 11.2 to test building of R packages. It is based of the official Oracle Solaris 11.2 VM template. The installation includes two versions of R, two compilers and some other software:

How to use

Install VirtualBox for your system and download the image from the URL above (it's about 4gb). Double click the image file to import it in VirtualBox (or use the import function from the tool bar). After booting the Solaris system, it will show you a graphical login screen. Login with username root and password solaris11.

loginscreen

Open a terminal by clicking the terminal icon on the top menu bar. The ORD version of R is available from the PATH, just run:

R

Programs from CSW are not added to the PATH. To run the GCC build of R:

/opt/csw/bin/R

Both installations use separate directories to store their R package libraries so they should not conflict.

terminalscreen

Third party libraries

CSW is an open source package manager and repository that is also used by CRAN. It is preinstalled on this system. Use pkgutil to install a library:

/opt/csw/bin/pkgutil -y -i libcurl_dev

It is unclear to me where the compilers look for headers. CRAN is setting a bunch of environment variables but it often seems to work out of the box.

A list of available CSW software: http://www.opencsw.org/get-it/packages/

Compile errors on ORC

Some R packages such as Rcpp and RJSONIO only seem to build with GCC and not with on ORD. From the very sparse information from BDR I get the sense that CRAN builds these packages with GCC as well. However I am not sure about this, please let me know if you figure out how to build these packages with ORD / Solaris Studio.

Host or convert the image

The image is in ova format, which is simply a tar ball containing the virtual disk (vmdk file) and a small config file. To extract the virtual disk for deploying it elsewhere:

tar xzvf Solaris11.ova

VirtualBox tricks

VirtualBox has some nice features that can be enabled from the "Devices" menu in the toolbar:

  • Enable shared clipboard to copy/paste text or commands to the guest machine.
  • Enable Drag'n'drop to copy a file (e.g. a source package) by dragging it from your mac/win desktop into solaris.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment