Installing an R Build Environment on Solaris

R

Run R CMD check or devtools::check() on a local Solaris VM

shikokuchuo
2021-08-23

                                                            sha256
1 6019ae519a7e66506bedd541440c2eb115163b6e0ea4c2b77538bfd64639b669

Setup

The R-hub solarischeck repository1, provides a full set of instructions by Gábor Csárdi for setting up R on a Solaris system. However, due to the ever-evolving software landscape, the instructions as they stand are no longer likely to produce a working system.

This guide builds on and completes the set of instructions so that a full build system can be set up with relative ease, complete with ‘devtools’ installed and ready for package testing on a CRAN-like Solaris environment.

Where ‘Instructions’ are mentioned below, they refer to those found at the original solarischeck repository:

https://github.com/r-hub/solarischeck/tree/master/packer.

[1]

Follow steps 1-3 of the Instructions, including installing the latest Packer version from its website. The website provides clear guidance on the best installation method - for example, for Ubuntu Linux users, a PPA is provided for a straightforward install process.

[2]

Follow step 4 of the Instructions and edit ‘solaris10.json’ to point to the locations of the downloaded Solaris 10 iso and Oracle Developer Studio tar.bz2.

In addition, find the following line in ‘solaris10.json’:

"iso_checksum_type": "sha1",

It appears twice. Delete both of these lines.

[3]

Open up a terminal and cd to where the ‘solaris10.json’ file is located. Execute the following command to create an updated Packer configuration from the json file:

packer hcl2_upgrade solaris10.json

You should get a confirmation message such as:

Successfully created solaris10.json.pkr.hcl. Exit 0

[4]

Follow step 5 of the Instructions and make sure VirtualBox or VMware is installed.

[5]

From where your solaris10.json is located, execute:

packer build .

The automated build will now run for a while, with the console showing the commands as they are run.

As per step 7 of the Instructions, do not attempt to interact with the VM window. Even if it appears static, processes will be running in the background.

Wait for the build to finish.

[6]

Complete the remaining installation steps 8-10 from the Instructions.

For those using VirtualBox: you should have a successfully-imported virtual machine at this point. Before launching it, first choose ‘settings’. On the ‘system’ tab feel free to allocate some more base memory (staying within the recommended green band). On the ‘display tab’, similarly allocate some more video memory - this is important otherwise increasing the screen resolution later may fail.

[7]

Launch the virtual machine and log in using the ‘rhub’ account as per the Instructions.

Choose the Sun Java Desktop Environment (however much you are tempted to use the awesome CDE). Once you arrive at a desktop, right click and set the desired screen resolution. (Here, if not enough video memory was allocated in the previous step you may get a black screen. If you do not get back to a usable dektop, power off the VM and try again.)

[8]

Open a terminal window and install the following packages from openCSW, the Solaris open source software repository, by issuing the following command:

sudo pkgutil -y -i cmake gmake curl libcurl_dev libssh2_dev libssl_dev libxml2_dev libiconv_dev

These are utilities and system libraries that are required to install the various dependencies of ‘devtools’.

[19]

‘libgit2’ is required but not available on openCSW, and hence must be built. In a terminal window, execute the commands in the following instructions by Jeroen Ooms:

https://gist.github.com/jeroen/4f13ff48596b449283ca98af7b95601d

Start from # Download latest release as we have already installed the dependencies as part of the previous step.

[10]

For the final step, load up a terminal window. Enter the following to set the environment variable:

export MAKE=gmake

From the same terminal window, launch R:

R

At the R prompt, proceed to install the ‘devtools’ package:

install.packages("devtools")

You will be prompted if you would like to use and create a personal library. Proceed with ‘yes’ both times.

All the dependencies of ‘devtools’ will now be downloaded and install will take a while.

The installation should complete successfully leaving you with a full R development environment on Solaris.

Bonus

Install the last released Firefox build 52.0esr for Solaris - this allows modern websites such as Github to load.

Open up a terminal and enter the following:

cd Desktop

# Download file
curl -OL https://ftp.mozilla.org/pub/firefox/releases/52.0esr/contrib/solaris_pkgadd/firefox-52.0esr.en-US.solaris-10-fcs-i386-pkg.bz2

# Decompress file
bzip2 -d firefox-52.0esr.en-US.solaris-10-fcs-i386-pkg.bz2

# Install package
sudo pkgadd -d ./firefox-52.0esr.en-US.solaris-10-fcs-i386-pkg

Respond ‘yes’ to all install prompts.

It does not overwrite the bundled version, so set up a shortcut by right-clicking on the desktop, and select ‘Create Launcher’.

For ‘Name’ enter Firefox, for ‘Command’ enter /opt/sfw/lib/firefox/firefox

Double-click the new launcher icon on the desktop to bring up Firefox.

Power off

To turn off the VM, open up a terminal window and issue:

sudo poweroff

This article (excluding the photograph) is licensed under CC BY 4.0


  1. Copyright, the R Consortium↩︎

Citation

For attribution, please cite this work as

shikokuchuo (2021, Aug. 23). shikokuchuo{net}: Installing an R Build Environment on Solaris. Retrieved from https://shikokuchuo.net/posts/14-r-on-solaris/

BibTeX citation

@misc{shikokuchuo2021installing,
  author = {shikokuchuo, },
  title = {shikokuchuo{net}: Installing an R Build Environment on Solaris},
  url = {https://shikokuchuo.net/posts/14-r-on-solaris/},
  year = {2021}
}